]> git.baikalelectronics.ru Git - kernel.git/commitdiff
plip: avoid rcu debug splat
authorFlorian Westphal <fw@strlen.de>
Sun, 7 Aug 2022 11:53:04 +0000 (13:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:18:24 +0000 (11:18 +0200)
commit 9f7b07fb8e7c0852072ae5b0fcbaab4091362b9f upstream.

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: a062ebaf8b1c ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/plip/plip.c

index e89cdebae6f13fb75b7358400b4d420e9de2c005..e8b7d596d7492538f424b311a9a280a25c5bf174 100644 (file)
@@ -1103,7 +1103,7 @@ plip_open(struct net_device *dev)
                /* Any address will do - we take the first. We already
                   have the first two bytes filled with 0xfc, from
                   plip_init_dev(). */
-               const struct in_ifaddr *ifa = rcu_dereference(in_dev->ifa_list);
+               const struct in_ifaddr *ifa = rtnl_dereference(in_dev->ifa_list);
                if (ifa != NULL) {
                        memcpy(dev->dev_addr+2, &ifa->ifa_local, 4);
                }