Eric Dumazet
0e3c83c121
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:37:00 +02:00
..
2021-03-17 16:43:42 +01:00
2020-10-01 13:14:28 +02:00
2020-11-05 11:08:34 +01:00
2020-12-30 11:25:45 +01:00
2020-06-30 23:17:12 -04:00
2021-03-17 16:43:51 +01:00
2020-12-11 13:25:03 +01:00
2021-02-13 13:51:14 +01:00
2020-11-05 11:08:40 +01:00
2021-01-19 18:22:36 +01:00
2021-02-13 13:51:15 +01:00
2020-08-19 08:15:05 +02:00
2021-03-04 09:39:30 +01:00
2020-12-30 11:25:39 +01:00
2020-09-09 19:04:31 +02:00
2020-07-22 09:32:00 +02:00
2020-07-22 09:32:00 +02:00
2021-01-30 13:32:11 +01:00
2021-03-24 11:07:31 +01:00
2020-12-30 11:25:40 +01:00
2021-01-23 15:49:55 +01:00
2021-03-24 11:07:31 +01:00
2020-11-05 11:08:35 +01:00
2020-10-01 13:14:28 +02:00
2021-03-04 09:39:57 +01:00
2021-01-23 15:49:55 +01:00
2021-03-11 14:05:02 +01:00
2020-09-03 11:24:23 +02:00
2021-02-10 09:21:06 +01:00
2020-06-25 15:33:02 +02:00
2021-03-04 09:39:33 +01:00
2020-10-14 10:31:21 +02:00
2021-01-30 13:32:13 +01:00
2021-01-06 14:44:58 +01:00
2021-01-06 14:44:58 +01:00
2020-11-05 11:08:35 +01:00
2021-01-30 13:32:12 +01:00
2021-03-11 14:04:59 +01:00
2020-09-09 19:04:22 +02:00
2020-11-05 11:08:54 +01:00
2021-02-10 09:21:08 +01:00
2020-08-11 15:32:33 +02:00
2020-09-23 12:10:59 +02:00
2021-03-04 09:39:59 +01:00
2021-03-30 14:37:00 +02:00
2020-07-22 09:32:00 +02:00
2021-02-03 23:23:26 +01:00
2020-07-29 10:16:57 +02:00
2021-03-04 09:39:59 +01:00
2020-08-21 11:05:28 +02:00
2020-07-16 08:17:26 +02:00
2021-01-09 13:43:48 +01:00
2021-03-04 09:39:42 +01:00
2021-03-04 09:39:44 +01:00
2020-10-14 10:31:26 +02:00
2021-02-13 13:51:13 +01:00
2021-02-07 14:48:38 +01:00
2020-10-01 13:14:54 +02:00
2020-09-09 19:04:28 +02:00
2020-11-10 12:35:58 +01:00
2020-10-07 08:00:08 +02:00
2020-07-29 10:16:52 +02:00
2021-02-10 09:21:07 +01:00
2021-03-17 16:43:42 +01:00
2020-11-18 19:18:44 +01:00
2020-11-18 19:18:44 +01:00
2020-12-02 08:48:07 +01:00
2020-10-01 13:14:41 +02:00
2020-10-07 08:00:08 +02:00
2021-01-06 14:45:00 +01:00
2020-10-29 09:55:15 +01:00
2020-10-30 10:38:20 +01:00
2020-10-01 13:14:40 +02:00
2020-11-18 19:18:52 +01:00
2020-07-22 09:32:13 +02:00
2021-01-12 20:10:17 +01:00
2020-08-07 09:36:21 +02:00
2021-03-04 09:39:50 +01:00
2021-01-30 13:32:12 +01:00
2020-12-30 11:26:06 +01:00
2020-12-30 11:26:01 +01:00
2020-10-01 13:14:30 +02:00
2021-01-23 15:49:56 +01:00
2021-03-17 16:43:51 +01:00
2021-02-13 13:51:15 +01:00
2021-03-07 12:19:01 +01:00
2020-07-31 18:37:48 +02:00
2021-03-24 11:07:37 +01:00
2020-11-18 19:18:40 +01:00
2020-12-30 11:26:01 +01:00
2020-08-19 08:14:47 +02:00
2020-12-11 13:25:01 +01:00
2021-03-30 14:36:58 +02:00
2020-09-09 19:04:29 +02:00
2021-03-24 11:07:34 +01:00
2021-03-17 16:43:43 +01:00
2020-10-07 08:00:05 +02:00
2020-08-11 15:32:34 +02:00
2021-03-07 12:19:01 +01:00