mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 06:34:12 +08:00
mctp: perform route destruction under RCU read lock
The kernel test robot reports: [ 843.509974][ T345] ============================= [ 843.524220][ T345] WARNING: suspicious RCU usage [ 843.538791][ T345] 5.14.0-rc2-00606-g889b7da23abf #1 Not tainted [ 843.553617][ T345] ----------------------------- [ 843.567412][ T345] net/mctp/route.c:310 RCU-list traversed in non-reader section!! - we're missing the rcu read lock acquire around the destruction path. This change adds the acquire/release - the path is already atomic, and we're using the _rcu list iterators. Reported-by: kernel test robot <oliver.sang@intel.com> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d9ea761fdd
commit
581edcd0c8
@ -1083,8 +1083,10 @@ static void __net_exit mctp_routes_net_exit(struct net *net)
|
||||
{
|
||||
struct mctp_route *rt;
|
||||
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(rt, &net->mctp.routes, list)
|
||||
mctp_route_release(rt);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
static struct pernet_operations mctp_net_ops = {
|
||||
|
Loading…
Reference in New Issue
Block a user