Message ID | 20210908041310.4014458-1-jk@codeconstruct.com.au (mailing list archive) |
---|---|
State | Accepted |
Commit | 581edcd0c8a076eba2ec9e20db50921ee80f5cbc |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] mctp: perform route destruction under RCU read lock | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | fail | Series targets non-next tree, but doesn't contain any Fixes tags |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | success | CCed 5 of 5 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 10 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Wed, 8 Sep 2021 12:13:10 +0800 you wrote: > 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!! > > [...] Here is the summary with links: - [net] mctp: perform route destruction under RCU read lock https://git.kernel.org/netdev/net/c/581edcd0c8a0 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/net/mctp/route.c b/net/mctp/route.c index 5265525011ad..5ca186d53cb0 100644 --- a/net/mctp/route.c +++ b/net/mctp/route.c @@ -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 = {
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> --- net/mctp/route.c | 2 ++ 1 file changed, 2 insertions(+)