Files
linux/include/linux
Eric Dumazet fc93db153b net: disable preemption in dev_core_stats_XXX_inc() helpers
syzbot was kind enough to remind us that dev->{tx_dropped|rx_dropped}
could be increased in process context.

BUG: using smp_processor_id() in preemptible [00000000] code: syz-executor413/3593
caller is netdev_core_stats_alloc+0x98/0x110 net/core/dev.c:10298
CPU: 1 PID: 3593 Comm: syz-executor413 Not tainted 5.17.0-rc7-syzkaller-02426-g97aeb877de7f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 check_preemption_disabled+0x16b/0x170 lib/smp_processor_id.c:49
 netdev_core_stats_alloc+0x98/0x110 net/core/dev.c:10298
 dev_core_stats include/linux/netdevice.h:3855 [inline]
 dev_core_stats_rx_dropped_inc include/linux/netdevice.h:3866 [inline]
 tun_get_user+0x3455/0x3ab0 drivers/net/tun.c:1800
 tun_chr_write_iter+0xe1/0x200 drivers/net/tun.c:2015
 call_write_iter include/linux/fs.h:2074 [inline]
 new_sync_write+0x431/0x660 fs/read_write.c:503
 vfs_write+0x7cd/0xae0 fs/read_write.c:590
 ksys_write+0x12d/0x250 fs/read_write.c:643
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f2cf4f887e3
Code: 5d 41 5c 41 5d 41 5e e9 9b fd ff ff 66 2e 0f 1f 84 00 00 00 00 00 90 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 48 89 54 24 18
RSP: 002b:00007ffd50dd5fd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ffd50dd6000 RCX: 00007f2cf4f887e3
RDX: 000000000000002a RSI: 0000000000000000 RDI: 00000000000000c8
RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd50dd5ff0 R14: 00007ffd50dd5fe8 R15: 00007ffd50dd5fe4
 </TASK>

Fixes: 625788b584 ("net: add per-cpu storage and net->core_stats")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: jeffreyji <jeffreyji@google.com>
Cc: Brian Vazquez <brianvv@google.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/20220312214505.3294762-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-03-14 10:15:00 -07:00
..
2021-09-20 12:43:34 +01:00
2022-02-01 14:25:50 +02:00
2022-01-22 08:33:34 +02:00
2022-01-15 08:47:31 -08:00
2021-10-18 14:43:23 -06:00
2022-01-09 10:36:51 -07:00
2021-11-17 10:36:15 -05:00
2021-09-08 15:32:35 -07:00
2021-12-10 17:10:55 -08:00
2021-12-10 12:51:28 +01:00
2021-12-01 00:06:43 +01:00
2021-08-26 15:32:28 -04:00
2021-07-27 11:00:36 +02:00
2021-09-06 07:20:56 -04:00
2022-01-15 08:47:31 -08:00
2021-06-25 19:57:01 -04:00
2021-07-26 15:09:44 +02:00
2022-01-20 08:52:54 +02:00
2021-07-27 20:11:45 +01:00
2021-07-27 20:11:44 +01:00
2021-10-18 07:49:38 -04:00
2022-01-04 13:15:33 -05:00
2022-03-02 22:44:49 -08:00
2021-08-05 11:46:42 +01:00
2021-12-17 09:06:15 +01:00
2021-12-20 09:03:05 +01:00
2021-10-05 06:54:16 -05:00
2022-02-05 15:20:34 +00:00
2021-07-27 17:05:06 +01:00
2021-06-01 10:29:21 +01:00
2021-10-18 07:49:39 -04:00
2022-01-27 13:53:26 +00:00
2021-06-17 13:09:27 -04:00
2021-06-15 17:46:57 +02:00
2021-09-30 12:46:44 -06:00
2021-07-01 11:06:05 -07:00
2021-12-16 22:22:20 +01:00
2021-08-23 13:19:12 +02:00
2021-09-21 13:44:55 -07:00
2022-02-09 09:24:40 -05:00
2022-01-12 10:14:09 -06:00
2021-11-16 19:07:53 -08:00
2021-09-17 13:52:17 +01:00
2021-09-27 09:27:29 -04:00
2021-09-27 17:00:21 +02:00
2021-06-16 17:20:40 -05:00
2021-07-06 10:37:46 -05:00
2021-10-14 13:29:18 +02:00
2021-06-07 14:11:47 -07:00
2021-08-18 22:08:24 +02:00
2022-01-22 08:33:37 +02:00
2022-01-08 12:43:57 -06:00
2021-11-18 09:36:39 +01:00
2021-10-07 16:51:57 +02:00
2022-01-24 14:45:02 +01:00
2021-11-30 17:25:20 -08:00
2021-10-18 07:49:39 -04:00
2021-10-18 17:20:50 +02:00
2022-01-22 08:33:37 +02:00
2022-01-22 08:33:38 +02:00
2022-03-09 11:22:58 +00:00
2021-08-06 13:41:48 -07:00
2021-08-19 09:02:55 +09:00
2021-06-24 15:49:32 +02:00
2021-11-03 11:41:25 -07:00
2021-07-01 11:06:03 -07:00
2021-11-25 18:35:23 +01:00
2021-09-08 15:32:35 -07:00
2022-01-27 13:53:27 +00:00
2021-10-12 11:41:39 -03:00
2021-12-30 12:13:04 +01:00
2021-08-11 06:44:24 -04:00
2021-12-09 10:49:56 -08:00
2022-01-08 00:28:41 -05:00
2021-10-19 23:44:30 +08:00