b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH maint] batman-adv: Modify neigh_list only with rcu-list functions
@ 2016-09-29 15:22 Sven Eckelmann
  2016-10-06  3:14 ` Linus Lüssing
  2016-10-18 11:32 ` [B.A.T.M.A.N.] [maint] " Sven Eckelmann
  0 siblings, 2 replies; 3+ messages in thread
From: Sven Eckelmann @ 2016-09-29 15:22 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

The batadv_hard_iface::neigh_list is accessed via rcu based primitives.
Thus all operations done on it have to fulfill the requirements by RCU. So
using non-RCU mechanisms like hlist_add_head is not allowed because it
misses the barriers required to protect concurrent readers when accessing
the data behind the pointer.

Fixes: fed2826b490c ("batman-adv: add list of unique single hop neighbors per hard-interface")
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
---
 net/batman-adv/originator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 3940b5d..3e9667e 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -537,7 +537,7 @@ batadv_hardif_neigh_create(struct batadv_hard_iface *hard_iface,
 	if (bat_priv->algo_ops->neigh.hardif_init)
 		bat_priv->algo_ops->neigh.hardif_init(hardif_neigh);
 
-	hlist_add_head(&hardif_neigh->list, &hard_iface->neigh_list);
+	hlist_add_head_rcu(&hardif_neigh->list, &hard_iface->neigh_list);
 
 out:
 	spin_unlock_bh(&hard_iface->neigh_list_lock);
-- 
2.9.3


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

* Re: [B.A.T.M.A.N.] [PATCH maint] batman-adv: Modify neigh_list only with rcu-list functions
  2016-09-29 15:22 [B.A.T.M.A.N.] [PATCH maint] batman-adv: Modify neigh_list only with rcu-list functions Sven Eckelmann
@ 2016-10-06  3:14 ` Linus Lüssing
  2016-10-18 11:32 ` [B.A.T.M.A.N.] [maint] " Sven Eckelmann
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Lüssing @ 2016-10-06  3:14 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking; +Cc: Sven Eckelmann

On Thu, Sep 29, 2016 at 05:22:58PM +0200, Sven Eckelmann wrote:
> The batadv_hard_iface::neigh_list is accessed via rcu based primitives.
> Thus all operations done on it have to fulfill the requirements by RCU. So
> using non-RCU mechanisms like hlist_add_head is not allowed because it
> misses the barriers required to protect concurrent readers when accessing
> the data behind the pointer.
> 
> Fixes: fed2826b490c ("batman-adv: add list of unique single hop neighbors per hard-interface")
> Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>

Acked-by: Linus Lüssing <linus.luessing@c0d3.blue>

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

* Re: [B.A.T.M.A.N.] [maint] batman-adv: Modify neigh_list only with rcu-list functions
  2016-09-29 15:22 [B.A.T.M.A.N.] [PATCH maint] batman-adv: Modify neigh_list only with rcu-list functions Sven Eckelmann
  2016-10-06  3:14 ` Linus Lüssing
@ 2016-10-18 11:32 ` Sven Eckelmann
  1 sibling, 0 replies; 3+ messages in thread
From: Sven Eckelmann @ 2016-10-18 11:32 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

On Donnerstag, 29. September 2016 17:22:58 CEST Sven Eckelmann wrote:
> The batadv_hard_iface::neigh_list is accessed via rcu based primitives.
> Thus all operations done on it have to fulfill the requirements by RCU. So
> using non-RCU mechanisms like hlist_add_head is not allowed because it
> misses the barriers required to protect concurrent readers when accessing
> the data behind the pointer.
> 
> Fixes: fed2826b490c ("batman-adv: add list of unique single hop neighbors
> per hard-interface") Signed-off-by: Sven Eckelmann
> <sven.eckelmann@open-mesh.com>
> Acked-by: Linus Lüssing <linus.luessing@c0d3.blue>
> ---
>  net/batman-adv/originator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied in 0e384ddb1995ae400766cf33b95537fb115a7800 [1].

Kind regards,
	Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/0e384ddb1995ae400766cf33b95537fb115a7800

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

end of thread, other threads:[~2016-10-18 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-29 15:22 [B.A.T.M.A.N.] [PATCH maint] batman-adv: Modify neigh_list only with rcu-list functions Sven Eckelmann
2016-10-06  3:14 ` Linus Lüssing
2016-10-18 11:32 ` [B.A.T.M.A.N.] [maint] " Sven Eckelmann

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).