Eric Dumazet
ea4fdbaa2f
net/sched: sch_taprio: do not schedule in taprio_reset()
As reported by syzbot and hinted by Vinicius, I should not have added
a qdisc_synchronize() call in taprio_reset()
taprio_reset() can be called with qdisc spinlock held (and BH disabled)
as shown in included syzbot report [1].
Only taprio_destroy() needed this synchronization, as explained
in the blamed commit changelog.
[1]
BUG: scheduling while atomic: syz-executor150/5091/0x00000202
2 locks held by syz-executor150/5091:
Modules linked in:
Preemption disabled at:
[<0000000000000000>] 0x0
Kernel panic - not syncing: scheduling while atomic: panic_on_warn set ...
CPU: 1 PID: 5091 Comm: syz-executor150 Not tainted 6.2.0-rc3-syzkaller-00219-g010a74f52203 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106
panic+0x2cc/0x626 kernel/panic.c:318
check_panic_on_warn.cold+0x19/0x35 kernel/panic.c:238
__schedule_bug.cold+0xd5/0xfe kernel/sched/core.c:5836
schedule_debug kernel/sched/core.c:5865 [inline]
__schedule+0x34e4/0x5450 kernel/sched/core.c:6500
schedule+0xde/0x1b0 kernel/sched/core.c:6682
schedule_timeout+0x14e/0x2a0 kernel/time/timer.c:2167
schedule_timeout_uninterruptible kernel/time/timer.c:2201 [inline]
msleep+0xb6/0x100 kernel/time/timer.c:2322
qdisc_synchronize include/net/sch_generic.h:1295 [inline]
taprio_reset+0x93/0x270 net/sched/sch_taprio.c:1703
qdisc_reset+0x10c/0x770 net/sched/sch_generic.c:1022
dev_reset_queue+0x92/0x130 net/sched/sch_generic.c:1285
netdev_for_each_tx_queue include/linux/netdevice.h:2464 [inline]
dev_deactivate_many+0x36d/0x9f0 net/sched/sch_generic.c:1351
dev_deactivate+0xed/0x1b0 net/sched/sch_generic.c:1374
qdisc_graft+0xe4a/0x1380 net/sched/sch_api.c:1080
tc_modify_qdisc+0xb6b/0x19a0 net/sched/sch_api.c:1689
rtnetlink_rcv_msg+0x43e/0xca0 net/core/rtnetlink.c:6141
netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356
netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1932
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg+0xd3/0x120 net/socket.c:734
____sys_sendmsg+0x712/0x8c0 net/socket.c:2476
___sys_sendmsg+0x110/0x1b0 net/socket.c:2530
__sys_sendmsg+0xf7/0x1c0 net/socket.c:2559
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
Fixes: 3a415d59c1 ("net/sched: sch_taprio: fix possible use-after-free")
Link: https://lore.kernel.org/netdev/167387581653.2747.13878941339893288655.git-patchwork-notify@kernel.org/T/
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Link: https://lore.kernel.org/r/20230123084552.574396-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-24 18:17:29 -08:00
..
2023-01-12 17:02:20 -06:00
2022-12-25 13:38:09 -08:00
2022-10-28 20:13:54 -07:00
2022-11-24 17:12:15 +01:00
2022-11-16 13:31:03 +00:00
2022-12-13 15:47:48 -08:00
2023-01-17 15:59:02 -08:00
2022-12-17 14:06:53 -06:00
2022-12-25 13:38:09 -08:00
2023-01-05 10:19:36 +01:00
2022-12-13 15:47:48 -08:00
2022-12-19 17:28:49 -08:00
2023-01-20 18:51:18 -08:00
2022-11-15 15:27:43 +01:00
2022-11-29 13:04:52 -08:00
2022-11-01 10:04:52 -07:00
2022-12-13 09:49:29 +01:00
2022-12-07 20:02:44 -08:00
2023-01-24 17:44:14 +01:00
2022-12-01 20:26:22 -08:00
2022-12-07 17:33:26 -08:00
2023-01-23 21:37:39 -08:00
2023-01-23 11:17:37 +00:00
2022-11-15 12:42:26 +01:00
2022-11-29 20:50:51 -08:00
2023-01-18 14:44:54 +00:00
2023-01-16 17:28:52 +02:00
2022-12-08 18:19:59 -08:00
2022-12-19 17:20:22 -08:00
2022-10-28 20:13:54 -07:00
2023-01-13 21:55:45 -08:00
2022-12-06 17:29:14 -08:00
2023-01-23 21:38:33 +01:00
2023-01-23 21:35:53 -08:00
2023-01-24 11:54:01 +01:00
2023-01-13 20:53:44 -08:00
2022-12-21 17:48:12 -08:00
2022-12-13 15:47:48 -08:00
2022-11-04 10:09:50 +00:00
2022-11-24 17:12:15 +01:00
2022-11-02 11:57:30 +00:00
2023-01-12 21:51:55 -08:00
2023-01-24 18:17:29 -08:00
2022-12-13 15:47:48 -08:00
2022-11-25 13:01:55 -05:00
2023-01-10 15:03:06 -06:00
2023-01-06 12:53:10 +00:00
2022-12-13 15:47:48 -08:00
2022-12-15 11:35:18 +01:00
2022-12-13 15:47:48 -08:00
2022-12-16 03:54:54 -08:00
2022-11-15 20:22:19 -08:00
2022-11-15 09:00:27 -08:00
2022-12-19 17:28:49 -08:00
2022-11-25 13:01:55 -05:00
2022-09-20 14:23:56 -07:00
2022-12-13 15:47:48 -08:00