]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: use correct this_cpu primitive in dev_recursion_level
authorFlorian Westphal <fw@strlen.de>
Wed, 3 Apr 2019 06:28:35 +0000 (08:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Apr 2019 00:34:58 +0000 (17:34 -0700)
syzbot reports:
BUG: using __this_cpu_read() in preemptible code:
caller is dev_recursion_level include/linux/netdevice.h:3052 [inline]
 __this_cpu_preempt_check+0x246/0x270 lib/smp_processor_id.c:47
 dev_recursion_level include/linux/netdevice.h:3052 [inline]
 ip6_skb_dst_mtu include/net/ip6_route.h:245 [inline]

I erronously downgraded a this_cpu_read to __this_cpu_read when
moving dev_recursion_level() around.

Reported-by: syzbot+51471b4aae195285a4a3@syzkaller.appspotmail.com
Fixes: 97cdcf37b57e ("net: place xmit recursion in softnet data")
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h

index eb9f05e0863dc5d6faea2274db2b3be5b5a99f33..521eb869555e26ad40a9b61a4e3a5d081ff17985 100644 (file)
@@ -3049,7 +3049,7 @@ DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
 
 static inline int dev_recursion_level(void)
 {
-       return __this_cpu_read(softnet_data.xmit.recursion);
+       return this_cpu_read(softnet_data.xmit.recursion);
 }
 
 #define XMIT_RECURSION_LIMIT   10