Files
linux/net/core
Guillaume Nault 252fad3d02 netns: protect netns ID lookups with RCU
commit 2dce224f46 upstream.

__peernet2id() can be protected by RCU as it only calls idr_for_each(),
which is RCU-safe, and never modifies the nsid table.

rtnl_net_dumpid() can also do lockless lookups. It does two nested
idr_for_each() calls on nsid tables (one direct call and one indirect
call because of rtnl_net_dumpid_one() calling __peernet2id()). The
netnsid tables are never updated. Therefore it is safe to not take the
nsid_lock and run within an RCU-critical section instead.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
2021-09-15 09:47:31 +02:00
..
2021-06-18 09:59:00 +02:00
2020-12-30 11:51:30 +01:00
2019-04-27 09:07:04 -07:00
2019-07-22 20:47:56 -07:00