Eric Dumazet
400199d6e6
macvlan: macvlan_count_rx() needs to be aware of preemption
[ Upstream commit dd4fa1dae9 ]
macvlan_count_rx() can be called from process context, it is thus
necessary to disable preemption before calling u64_stats_update_begin()
syzbot was able to spot this on 32bit arch:
WARNING: CPU: 1 PID: 4632 at include/linux/seqlock.h:271 __seqprop_assert include/linux/seqlock.h:271 [inline]
WARNING: CPU: 1 PID: 4632 at include/linux/seqlock.h:271 __seqprop_assert.constprop.0+0xf0/0x11c include/linux/seqlock.h:269
Modules linked in:
Kernel panic - not syncing: panic_on_warn set ...
CPU: 1 PID: 4632 Comm: kworker/1:3 Not tainted 5.12.0-rc2-syzkaller #0
Hardware name: ARM-Versatile Express
Workqueue: events macvlan_process_broadcast
Backtrace:
[<82740468>] (dump_backtrace) from [<827406dc>] (show_stack+0x18/0x1c arch/arm/kernel/traps.c:252)
r7:00000080 r6:60000093 r5:00000000 r4:8422a3c4
[<827406c4>] (show_stack) from [<82751b58>] (__dump_stack lib/dump_stack.c:79 [inline])
[<827406c4>] (show_stack) from [<82751b58>] (dump_stack+0xb8/0xe8 lib/dump_stack.c:120)
[<82751aa0>] (dump_stack) from [<82741270>] (panic+0x130/0x378 kernel/panic.c:231)
r7:830209b4 r6:84069ea4 r5:00000000 r4:844350d0
[<82741140>] (panic) from [<80244924>] (__warn+0xb0/0x164 kernel/panic.c:605)
r3:8404ec8c r2:00000000 r1:00000000 r0:830209b4
r7:0000010f
[<80244874>] (__warn) from [<82741520>] (warn_slowpath_fmt+0x68/0xd4 kernel/panic.c:628)
r7:81363f70 r6:0000010f r5:83018e50 r4:00000000
[<827414bc>] (warn_slowpath_fmt) from [<81363f70>] (__seqprop_assert include/linux/seqlock.h:271 [inline])
[<827414bc>] (warn_slowpath_fmt) from [<81363f70>] (__seqprop_assert.constprop.0+0xf0/0x11c include/linux/seqlock.h:269)
r8:5a109000 r7:0000000f r6:a568dac0 r5:89802300 r4:00000001
[<81363e80>] (__seqprop_assert.constprop.0) from [<81364af0>] (u64_stats_update_begin include/linux/u64_stats_sync.h:128 [inline])
[<81363e80>] (__seqprop_assert.constprop.0) from [<81364af0>] (macvlan_count_rx include/linux/if_macvlan.h:47 [inline])
[<81363e80>] (__seqprop_assert.constprop.0) from [<81364af0>] (macvlan_broadcast+0x154/0x26c drivers/net/macvlan.c:291)
r5:89802300 r4:8a927740
[<8136499c>] (macvlan_broadcast) from [<81365020>] (macvlan_process_broadcast+0x258/0x2d0 drivers/net/macvlan.c:317)
r10:81364f78 r9:8a86d000 r8:8a9c7e7c r7:8413aa5c r6:00000000 r5:00000000
r4:89802840
[<81364dc8>] (macvlan_process_broadcast) from [<802696a4>] (process_one_work+0x2d4/0x998 kernel/workqueue.c:2275)
r10:00000008 r9:8404ec98 r8:84367a02 r7:ddfe6400 r6:ddfe2d40 r5:898dac80
r4:8a86d43c
[<802693d0>] (process_one_work) from [<80269dcc>] (worker_thread+0x64/0x54c kernel/workqueue.c:2421)
r10:00000008 r9:8a9c6000 r8:84006d00 r7:ddfe2d78 r6:898dac94 r5:ddfe2d40
r4:898dac80
[<80269d68>] (worker_thread) from [<80271f40>] (kthread+0x184/0x1a4 kernel/kthread.c:292)
r10:85247e64 r9:898dac80 r8:80269d68 r7:00000000 r6:8a9c6000 r5:89a2ee40
r4:8a97bd00
[<80271dbc>] (kthread) from [<80200114>] (ret_from_fork+0x14/0x20 arch/arm/kernel/entry-common.S:158)
Exception stack(0x8a9c7fb0 to 0x8a9c7ff8)
Fixes: 412ca1550c ("macvlan: Move broadcasts into a work queue")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Reported-by: syzbot <syzkaller@googlegroups.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-30 14:31:57 +02:00
..
2021-03-17 17:06:11 +01:00
2020-10-12 15:29:27 +02:00
2020-10-12 15:29:26 +02:00
2020-10-29 17:22:59 -05:00
2020-11-24 15:13:54 +01:00
2020-10-15 18:42:13 -07:00
2021-03-17 17:06:17 +01:00
2020-12-30 11:54:19 +01:00
2020-10-15 07:57:55 +02:00
2020-10-29 17:22:59 -05:00
2021-03-04 11:38:07 +01:00
2021-02-03 23:28:44 +01:00
2020-10-25 14:51:49 -07:00
2020-12-08 12:57:39 +01:00
2021-03-11 14:17:23 +01:00
2020-10-17 11:18:18 -07:00
2021-03-25 09:04:14 +01:00
2021-03-17 17:06:34 +01:00
2020-10-24 10:39:22 -07:00
2021-03-04 11:38:14 +01:00
2020-11-12 15:05:34 +00:00
2021-02-13 13:55:12 +01:00
2020-10-28 13:18:56 +01:00
2021-03-09 11:11:13 +01:00
2021-03-17 17:06:18 +01:00
2020-10-08 17:17:27 +02:00
2020-10-28 11:13:36 +00:00
2020-10-13 11:37:11 +02:00
2020-10-16 11:11:20 -07:00
2020-10-13 15:05:05 -06:00
2020-10-05 10:47:43 -06:00
2021-01-12 20:18:17 +01:00
2021-01-12 20:18:17 +01:00
2020-11-19 08:55:44 -05:00
2020-10-02 14:59:25 -07:00
2020-10-22 09:59:21 -07:00
2021-03-25 09:04:10 +01:00
2020-10-02 15:00:49 -07:00
2020-12-11 14:02:14 -08:00
2020-10-16 11:11:19 -07:00
2020-10-25 14:51:49 -07:00
2020-10-13 18:38:34 -07:00
2020-10-12 16:44:57 -07:00
2020-10-25 14:51:49 -07:00
2020-10-29 20:01:46 -07:00
2021-03-17 17:06:35 +01:00
2021-01-19 18:27:21 +01:00
2020-11-14 11:26:03 -08:00
2020-10-16 11:11:21 -07:00
2020-10-25 14:51:49 -07:00
2020-11-10 18:31:17 +01:00
2020-10-16 12:21:15 -07:00
2020-10-16 17:21:51 +02:00
2020-10-13 15:58:10 -07:00
2021-03-09 11:11:13 +01:00
2020-10-19 14:28:30 -07:00
2020-10-30 08:37:39 +01:00
2020-10-16 07:28:20 +02:00
2021-03-04 11:38:44 +01:00
2021-01-27 11:55:18 +01:00
2021-01-19 18:27:22 +01:00
2020-10-06 07:07:06 +02:00
2020-10-20 10:41:07 +02:00
2020-10-20 10:41:07 +02:00
2020-10-25 14:51:49 -07:00
2021-03-11 14:17:27 +01:00
2021-03-25 09:04:18 +01:00
2020-12-11 14:02:14 -08:00
2021-03-17 17:06:36 +01:00
2020-10-06 06:16:01 -07:00
2021-03-04 11:38:41 +01:00
2020-10-25 14:51:49 -07:00
2020-10-16 11:11:22 -07:00
2021-03-04 11:37:22 +01:00
2020-10-25 14:51:49 -07:00
2020-10-15 10:46:16 -07:00
2020-12-30 11:53:49 +01:00
2020-12-26 16:02:43 +01:00
2020-12-30 11:54:18 +01:00
2020-10-08 15:29:06 -04:00
2020-11-12 13:59:04 -07:00
2020-10-15 14:43:29 -07:00
2020-10-22 22:44:35 +02:00
2020-10-13 18:38:32 -07:00
2021-03-30 14:31:54 +02:00
2021-02-10 09:29:20 +01:00
2021-03-04 11:38:46 +01:00
2020-10-12 12:08:35 +02:00
2020-10-16 11:11:20 -07:00
2021-03-30 14:31:57 +02:00
2020-10-05 13:37:03 +02:00
2020-10-25 14:51:49 -07:00
2020-10-25 14:51:49 -07:00
2020-10-16 17:35:36 +02:00
2021-01-12 20:18:24 +01:00
2020-10-25 14:51:49 -07:00
2020-11-04 10:22:56 -07:00
2020-10-20 07:10:14 -06:00
2020-11-04 08:52:46 -08:00
2021-03-04 11:38:01 +01:00
2020-10-16 11:11:18 -07:00
2021-03-04 11:38:46 +01:00
2021-02-10 09:29:17 +01:00
2020-11-30 12:21:31 +01:00
2020-10-08 18:00:08 +02:00
2020-11-19 22:38:29 -05:00
2020-10-29 13:17:58 -05:00
2020-10-16 11:11:19 -07:00
2020-10-13 18:38:32 -07:00
2021-01-09 13:46:23 +01:00
2020-10-05 13:37:04 +02:00
2020-10-25 14:51:49 -07:00
2021-03-04 11:37:50 +01:00
2021-03-04 11:37:59 +01:00
2021-03-04 11:38:46 +01:00
2021-03-04 11:38:20 +01:00
2021-02-10 09:29:16 +01:00
2021-02-07 15:37:17 +01:00
2020-10-23 03:42:13 -04:00
2021-02-03 23:28:40 +01:00
2020-10-16 11:11:20 -07:00
2020-10-09 08:53:08 +02:00
2020-10-09 08:55:17 +02:00
2020-10-07 09:23:39 +02:00
2020-10-25 14:51:49 -07:00
2020-10-15 07:49:46 +02:00
2020-10-13 18:38:35 -07:00
2021-03-30 14:31:47 +02:00
2020-11-22 10:48:22 -08:00
2021-03-17 17:06:25 +01:00
2021-03-04 11:38:21 +01:00
2020-10-02 11:33:47 +02:00
2020-10-16 11:11:19 -07:00
2021-03-30 14:31:52 +02:00
2021-03-30 14:31:54 +02:00
2020-10-13 18:38:31 -07:00
2021-03-09 11:11:14 +01:00
2020-10-28 14:08:54 +00:00
2020-10-25 14:51:49 -07:00
2021-02-10 09:29:17 +01:00
2020-10-05 18:40:01 -07:00
2021-03-07 12:34:07 +01:00
2020-10-30 12:57:39 +01:00
2020-10-30 12:57:39 +01:00
2020-10-21 18:24:08 -07:00
2020-10-07 14:28:39 -04:00
2020-10-07 14:28:39 -04:00
2020-11-30 10:52:22 -05:00
2020-10-21 10:31:20 -04:00
2020-10-07 14:28:39 -04:00
2020-10-16 11:11:18 -07:00
2020-10-16 11:11:19 -07:00
2020-11-22 10:48:22 -08:00
2021-02-07 15:37:16 +01:00
2020-10-25 14:51:49 -07:00
2021-03-09 11:11:13 +01:00
2020-10-13 18:38:35 -07:00
2020-10-17 11:18:18 -07:00
2020-10-16 11:11:15 -07:00
2020-10-16 11:11:16 -07:00
2020-11-22 10:48:22 -08:00
2020-10-22 13:00:44 -07:00
2020-10-25 14:51:49 -07:00
2020-10-06 07:29:36 -06:00
2021-03-17 17:06:34 +01:00
2020-11-09 18:12:34 +01:00
2021-03-17 17:06:28 +01:00
2020-10-28 11:41:15 -06:00
2020-10-18 09:27:10 -07:00
2020-10-16 17:53:22 +02:00
2020-11-16 09:37:01 -08:00
2020-10-24 20:21:57 +02:00
2020-10-25 14:51:49 -07:00
2020-12-30 11:53:56 +01:00
2020-10-14 16:09:32 -07:00
2020-10-24 10:39:22 -07:00
2020-10-13 08:41:26 -04:00
2020-10-13 18:38:28 -07:00
2021-03-04 11:38:35 +01:00
2020-10-28 11:41:15 -06:00
2020-10-05 18:35:30 +01:00
2020-10-13 19:20:54 -05:00
2021-03-04 11:38:21 +01:00
2020-10-04 19:51:43 -07:00
2021-01-09 13:46:24 +01:00
2020-10-05 20:45:45 -03:00
2020-11-22 13:26:07 -08:00
2020-12-10 16:01:47 -08:00
2020-12-30 11:53:42 +01:00
2020-11-06 10:05:18 -08:00
2021-03-17 17:06:34 +01:00
2020-10-25 14:51:49 -07:00
2020-10-29 13:17:58 -05:00
2020-10-15 18:42:13 -07:00
2020-10-11 18:09:44 -07:00
2020-10-25 11:39:02 -07:00
2020-10-25 14:51:49 -07:00
2020-10-22 14:15:51 -06:00
2021-03-30 14:31:53 +02:00
2021-03-30 14:31:53 +02:00
2020-12-08 14:52:29 -08:00
2021-03-17 17:06:34 +01:00
2020-10-06 11:18:04 +02:00
2020-10-13 18:38:30 -07:00
2021-03-07 12:34:15 +01:00
2020-11-16 14:58:23 -08:00
2021-01-17 14:16:59 +01:00
2020-10-02 12:02:30 +02:00
2020-10-17 15:05:30 -06:00
2020-10-12 12:08:36 +02:00
2021-03-25 09:04:16 +01:00
2020-10-26 11:48:11 +01:00
2021-03-04 11:38:29 +01:00
2020-10-25 14:51:49 -07:00
2020-12-30 11:53:42 +01:00
2020-10-05 12:43:53 +02:00
2020-10-17 15:04:36 -06:00
2020-10-15 15:51:28 -07:00
2021-02-10 09:29:16 +01:00
2021-03-04 11:37:36 +01:00
2021-01-27 11:55:30 +01:00
2021-03-30 14:31:51 +02:00
2020-10-24 10:57:57 -07:00
2021-02-17 11:02:28 +01:00
2021-03-25 09:04:14 +01:00
2021-03-17 17:06:19 +01:00
2020-10-23 11:55:27 -04:00
2020-10-23 11:00:57 -07:00
2021-03-17 17:06:11 +01:00
2021-02-10 09:29:21 +01:00
2020-10-16 11:11:19 -07:00
2020-10-05 13:21:49 +02:00
2020-10-20 14:39:37 -07:00
2021-03-07 12:34:15 +01:00