]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: Fix suspicious RCU usage warning in ip6mr
authorMadhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Sat, 16 May 2020 07:45:15 +0000 (13:15 +0530)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 May 2020 20:41:53 +0000 (13:41 -0700)
commit0df02770a9abc32b1824da791242da2387dc813e
tree36bf56fa15943f762cc5ccd338ed26fb7c74e316
parent6c8fc4b0826d569e3bda470513a5ad71654f889d
ipv6: Fix suspicious RCU usage warning in ip6mr

This patch fixes the following warning:

=============================
WARNING: suspicious RCU usage
5.7.0-rc4-next-20200507-syzkaller #0 Not tainted
-----------------------------
net/ipv6/ip6mr.c:124 RCU-list traversed in non-reader section!!

ipmr_new_table() returns an existing table, but there is no table at
init. Therefore the condition: either holding rtnl or the list is empty
is used.

Fixes: fa4a490165bdd ("ipv6: ip6mr: support multiple tables")
Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6mr.c