]> git.baikalelectronics.ru Git - kernel.git/commit
rtnetlink: use rcu_dereference_raw to silence rcu splat
authorFlorian Westphal <fw@strlen.de>
Thu, 10 Aug 2017 14:52:57 +0000 (16:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Aug 2017 16:50:21 +0000 (09:50 -0700)
commited4d19e639f9a5ccc73018c40377771bb98b4bbf
treeeebe47c9f78e801c496cb3f483e0d7e5b6500bfb
parent23ad18f9468efbca7406e6b9a85f6f2d1b9ef189
rtnetlink: use rcu_dereference_raw to silence rcu splat

Ido reports a rcu splat in __rtnl_register.
The splat is correct; as rtnl_register doesn't grab any logs
and doesn't use rcu locks either.  It has always been like this.
handler families are not registered in parallel so there are no
races wrt. the kmalloc ordering.

The only reason to use rcu_dereference in the first place was to
avoid sparse from complaining about this.

Thus this switches to _raw() to not have rcu checks here.

The alternative is to add rtnl locking to register/unregister,
however, I don't see a compelling reason to do so as this has been
lockless for the past twenty years or so.

Fixes: b5dfd909cc ("rtnetlink: protect handler table with rcu")
Reported-by: Ido Schimmel <idosch@idosch.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c