linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/netlabel: Add list_next_rcu() in rcu_dereference().
@ 2017-11-16 17:03 Tim Hansen
  2017-11-18  1:35 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Hansen @ 2017-11-16 17:03 UTC (permalink / raw)
  To: linux-security-module

Add list_next_rcu() for fetching next list in rcu_deference safely.

Found with sparse in linux-next tree on tag next-20171116.

Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
---
 net/netlabel/netlabel_addrlist.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netlabel/netlabel_addrlist.h b/net/netlabel/netlabel_addrlist.h
index d0f38bc..ac709f0 100644
--- a/net/netlabel/netlabel_addrlist.h
+++ b/net/netlabel/netlabel_addrlist.h
@@ -87,7 +87,7 @@ static inline struct netlbl_af4list *__af4list_valid_rcu(struct list_head *s,
 	struct list_head *i = s;
 	struct netlbl_af4list *n = __af4list_entry(s);
 	while (i != h && !n->valid) {
-		i = rcu_dereference(i->next);
+		i = rcu_dereference(list_next_rcu(i));
 		n = __af4list_entry(i);
 	}
 	return n;
@@ -154,7 +154,7 @@ static inline struct netlbl_af6list *__af6list_valid_rcu(struct list_head *s,
 	struct list_head *i = s;
 	struct netlbl_af6list *n = __af6list_entry(s);
 	while (i != h && !n->valid) {
-		i = rcu_dereference(i->next);
+		i = rcu_dereference(list_next_rcu(i));
 		n = __af6list_entry(i);
 	}
 	return n;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] net/netlabel: Add list_next_rcu() in rcu_dereference().
  2017-11-16 17:03 [PATCH] net/netlabel: Add list_next_rcu() in rcu_dereference() Tim Hansen
@ 2017-11-18  1:35 ` David Miller
  2017-11-18 13:27   ` Paul Moore
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2017-11-18  1:35 UTC (permalink / raw)
  To: linux-security-module

From: Tim Hansen <devtimhansen@gmail.com>
Date: Thu, 16 Nov 2017 12:03:34 -0500

> Add list_next_rcu() for fetching next list in rcu_deference safely.
> 
> Found with sparse in linux-next tree on tag next-20171116.
> 
> Signed-off-by: Tim Hansen <devtimhansen@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] net/netlabel: Add list_next_rcu() in rcu_dereference().
  2017-11-18  1:35 ` David Miller
@ 2017-11-18 13:27   ` Paul Moore
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Moore @ 2017-11-18 13:27 UTC (permalink / raw)
  To: linux-security-module

On Fri, Nov 17, 2017 at 8:35 PM, David Miller <davem@davemloft.net> wrote:
> From: Tim Hansen <devtimhansen@gmail.com>
> Date: Thu, 16 Nov 2017 12:03:34 -0500
>
>> Add list_next_rcu() for fetching next list in rcu_deference safely.
>>
>> Found with sparse in linux-next tree on tag next-20171116.
>>
>> Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
>
> Applied.

Thanks guys.

My apologies I wasn't able to ACK the patch sooner, I was traveling
and had spotty network access.

-- 
paul moore
www.paul-moore.com
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-18 13:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-16 17:03 [PATCH] net/netlabel: Add list_next_rcu() in rcu_dereference() Tim Hansen
2017-11-18  1:35 ` David Miller
2017-11-18 13:27   ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).