syzbot


BUG: scheduling while atomic in msleep

Status: fixed on 2023/06/08 14:41
Subsystems: net
[Documentation on labels]
Fix commit: ea4fdbaa2f77 net/sched: sch_taprio: do not schedule in taprio_reset()
First crash: 465d, last: 457d
Cause bisection: introduced by (bisect log) :
commit 3a415d59c1dbec9d772dbfab2d2520d98360caae
Author: Eric Dumazet <edumazet@google.com>
Date: Fri Jan 13 16:48:49 2023 +0000

  net/sched: sch_taprio: fix possible use-after-free

Crash: BUG: scheduling while atomic in msleep (log)
Repro: C syz .config
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-6-1 BUG: scheduling while atomic in msleep 1 15d 15d 0/2 premoderation: reported on 2024/04/12 00:50

Sample crash report:
BUG: scheduling while atomic: syz-executor150/5091/0x00000202
2 locks held by syz-executor150/5091:
 #0: ffffffff8e0bde28 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:75 [inline]
 #0: ffffffff8e0bde28 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x3e9/0xca0 net/core/rtnetlink.c:6138
 #1: ffff888076af4108 (&sch->q.lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:355 [inline]
 #1: ffff888076af4108 (&sch->q.lock){+.-.}-{2:2}, at: dev_reset_queue+0x8a/0x130 net/sched/sch_generic.c:1283
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]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f7afb018ee9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd5329a8c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f7afb018ee9
RDX: 0000000000000000 RSI: 00000000200007c0 RDI: 0000000000000004
RBP: 0000000000000000 R08: 000000000000000d R09: 000000000000000d
R10: 000000000000000d R11: 0000000000000246 R12: 00007ffd5329a8e0
R13: 00000000000f4240 R14: 000000000000f13d R15: 00007ffd5329a8d4
 </TASK>
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (40):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/18 15:31 net-old 010a74f52203 42660d9e .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce BUG: scheduling while atomic in msleep
2023/01/18 15:00 linux-next f3381a7baf5c 42660d9e .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: scheduling while atomic in msleep
2023/01/26 05:31 upstream 7c46948a6e9c 9dfcf09c .config console log report info ci-upstream-kasan-gce-selinux-root BUG: scheduling while atomic in msleep
2023/01/25 19:11 upstream 948ef7bb70c4 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root BUG: scheduling while atomic in msleep
2023/01/24 02:36 upstream 7bf70dbb1882 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root BUG: scheduling while atomic in msleep
2023/01/23 07:30 upstream 2475bf0250de 44388686 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root BUG: scheduling while atomic in msleep
2023/01/23 00:36 upstream 2475bf0250de 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root BUG: scheduling while atomic in msleep
2023/01/22 06:57 upstream 2241ab53cbb5 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root BUG: scheduling while atomic in msleep
2023/01/22 02:00 upstream f67144022885 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce BUG: scheduling while atomic in msleep
2023/01/21 16:21 upstream f883675bf652 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root BUG: scheduling while atomic in msleep
2023/01/21 15:17 upstream f883675bf652 559a440a .config console log report info ci-upstream-kasan-gce-smack-root BUG: scheduling while atomic in msleep
2023/01/21 14:41 upstream f883675bf652 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root BUG: scheduling while atomic in msleep
2023/01/21 12:27 upstream f883675bf652 559a440a .config console log report info ci-upstream-kasan-gce-smack-root BUG: scheduling while atomic in msleep
2023/01/21 10:31 upstream f883675bf652 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root BUG: scheduling while atomic in msleep
2023/01/21 10:00 upstream f883675bf652 559a440a .config console log report info ci-upstream-kasan-gce BUG: scheduling while atomic in msleep
2023/01/21 00:05 upstream ff83fec8179e 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root BUG: scheduling while atomic in msleep
2023/01/20 22:03 upstream ff83fec8179e 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root BUG: scheduling while atomic in msleep
2023/01/24 04:28 upstream 7bf70dbb1882 9dfcf09c .config console log report info ci-upstream-kasan-gce-386 BUG: scheduling while atomic in msleep
2023/01/22 21:39 upstream 2241ab53cbb5 559a440a .config console log report info ci-upstream-kasan-gce-386 BUG: scheduling while atomic in msleep
2023/01/22 19:52 upstream 2241ab53cbb5 559a440a .config console log report info ci-upstream-kasan-gce-386 BUG: scheduling while atomic in msleep
2023/01/22 06:03 upstream f67144022885 559a440a .config console log report info ci-upstream-kasan-gce-386 BUG: scheduling while atomic in msleep
2023/01/22 02:28 upstream f67144022885 559a440a .config console log report info ci-upstream-kasan-gce-386 BUG: scheduling while atomic in msleep
2023/01/21 14:21 upstream f883675bf652 7374c4e5 .config console log report info ci-qemu-upstream-386 BUG: scheduling while atomic in msleep
2023/01/21 13:57 upstream f883675bf652 7374c4e5 .config console log report info ci-qemu-upstream-386 BUG: scheduling while atomic in msleep
2023/01/21 13:05 upstream f883675bf652 7374c4e5 .config console log report info ci-qemu-upstream-386 BUG: scheduling while atomic in msleep
2023/01/21 02:19 upstream ff83fec8179e 559a440a .config console log report info ci-upstream-kasan-gce-386 BUG: scheduling while atomic in msleep
2023/01/21 01:58 upstream edc00350d205 7374c4e5 .config console log report info ci-qemu-upstream-386 BUG: scheduling while atomic in msleep
2023/01/21 01:20 upstream edc00350d205 7374c4e5 .config console log report info ci-qemu-upstream-386 BUG: scheduling while atomic in msleep
2023/01/21 00:02 upstream edc00350d205 7374c4e5 .config console log report info ci-qemu-upstream-386 BUG: scheduling while atomic in msleep
2023/01/19 16:56 net-old 4fb58ac3368c 1b826a2f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce BUG: scheduling while atomic in msleep
2023/01/23 15:41 net-next-old 40e0b0908142 9dfcf09c .config console log report info ci-upstream-net-kasan-gce BUG: scheduling while atomic in msleep
2023/01/23 14:08 net-next-old 40e0b0908142 9dfcf09c .config console log report info ci-upstream-net-kasan-gce BUG: scheduling while atomic in msleep
2023/01/23 13:52 net-next-old 40e0b0908142 9dfcf09c .config console log report info ci-upstream-net-kasan-gce BUG: scheduling while atomic in msleep
2023/01/23 06:37 net-next-old a7b87d2a31dc 44388686 .config console log report info ci-upstream-net-kasan-gce BUG: scheduling while atomic in msleep
2023/01/22 18:28 net-next-old a7b87d2a31dc 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce BUG: scheduling while atomic in msleep
2023/01/22 12:44 net-next-old a7b87d2a31dc 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce BUG: scheduling while atomic in msleep
2023/01/21 08:58 net-next-old a7b87d2a31dc 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce BUG: scheduling while atomic in msleep
2023/01/19 19:27 linux-next aa5c49149a82 1b826a2f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: scheduling while atomic in msleep
2023/01/18 14:08 linux-next f3381a7baf5c 42660d9e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: scheduling while atomic in msleep
2023/01/18 00:06 linux-next 9ce08dd7ea24 aedf5331 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: scheduling while atomic in msleep
* Struck through repros no longer work on HEAD.