Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

plip: avoid rcu debug splat

WARNING: suspicious RCU usage
5.2.0-rc2-00605-g2638eb8b50cfc #1 Not tainted
drivers/net/plip/plip.c:1110 suspicious rcu_dereference_check() usage!

plip_open is called with RTNL held, switch to the correct helper.

Fixes: 2638eb8b50cf ("net: ipv4: provide __rcu annotation for ifa_list")
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Link: https://lore.kernel.org/r/20220807115304.13257-1-fw@strlen.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Florian Westphal and committed by
Jakub Kicinski
bc3c8fe3 1b7680c6

+1 -1
+1 -1
drivers/net/plip/plip.c
··· 1111 1111 /* Any address will do - we take the first. We already 1112 1112 have the first two bytes filled with 0xfc, from 1113 1113 plip_init_dev(). */ 1114 - const struct in_ifaddr *ifa = rcu_dereference(in_dev->ifa_list); 1114 + const struct in_ifaddr *ifa = rtnl_dereference(in_dev->ifa_list); 1115 1115 if (ifa != NULL) { 1116 1116 dev_addr_mod(dev, 2, &ifa->ifa_local, 4); 1117 1117 }