panic: kernel diagnostic assertion "__mp_lock_held(&sched_lock, curcpu()) == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_lock.c", line 63 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 67377 98027 0 0x1800 0x4080080 0 syz-executor.3 87724 44188 0 0x14000 0x200 1 softnet db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff825a0599) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff82615d07,ffffffff825891d5,3f,ffffffff8264bc7b) at __assert+0x25 sys/kern/subr_prf.c:161 _kernel_lock() at _kernel_lock+0xb2 sys/kern/kern_lock.c:63 single_thread_check_locked(ffff8000212f7a50,1,c) at single_thread_check_locked+0x1f6 sys/kern/kern_sig.c:2037 single_thread_check(ffff8000212f7a50,1) at single_thread_check+0x4b sys/kern/kern_sig.c:2057 sleep_finish(ffff80002da6cb40,1) at sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline] sleep_finish(ffff80002da6cb40,1) at sleep_finish+0x75 sys/kern/kern_synch.c:400 rwsleep(ffff8000212f7a50,ffffffff829990c0,120,ffffffff82599d73,0) at rwsleep+0xd5 sys/kern/kern_synch.c:314 futex_wait(1bb88bfb290,6,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:260 sys_futex(ffff8000212f7a50,ffff80002da6ccd0,ffff80002da6cd30) at sys_futex+0xf8 sys/kern/sys_futex.c:111 syscall(ffff80002da6cda0) at syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002da6cda0) at syscall+0x484 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1bbd3e85480, count: 3 https://www.openbsd.org/ddb.html describes the minimum info required in bug reports. Insufficient info makes it difficult to find and fix bugs. ddb{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic *cpu0: kernel diagnostic assertion "__mp_lock_held(&sched_lock, curcpu()) == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/kern/kern_lock.c", line 63 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff825a0599) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff82615d07,ffffffff825891d5,3f,ffffffff8264bc7b) at __assert+0x25 sys/kern/subr_prf.c:161 _kernel_lock() at _kernel_lock+0xb2 sys/kern/kern_lock.c:63 single_thread_check_locked(ffff8000212f7a50,1,c) at single_thread_check_locked+0x1f6 sys/kern/kern_sig.c:2037 single_thread_check(ffff8000212f7a50,1) at single_thread_check+0x4b sys/kern/kern_sig.c:2057 sleep_finish(ffff80002da6cb40,1) at sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline] sleep_finish(ffff80002da6cb40,1) at sleep_finish+0x75 sys/kern/kern_synch.c:400 rwsleep(ffff8000212f7a50,ffffffff829990c0,120,ffffffff82599d73,0) at rwsleep+0xd5 sys/kern/kern_synch.c:314 futex_wait(1bb88bfb290,6,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:260 sys_futex(ffff8000212f7a50,ffff80002da6ccd0,ffff80002da6cd30) at sys_futex+0xf8 sys/kern/sys_futex.c:111 syscall(ffff80002da6cda0) at syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002da6cda0) at syscall+0x484 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1bbd3e85480, count: -12 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002da6c900 rbx 0xffffffff8297fbb7 cpu_info_full_primary+0x2bb7 rdx 0xffff800000bef340 rcx 0 rax 0xffff8000212f7a50 r8 0x101010101010101 r9 0x8080808080808080 r10 0x1dd69fafa7e154b4 r11 0xbf8166ff93ebc3bd r12 0xffffffff8297f9b8 cpu_info_full_primary+0x29b8 r13 0 r14 0 r15 0x1 rip 0xffffffff816ef6f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002da6c8f0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.3) pid=67377 stat=onproc flags process=1800 proc=4080080 pri=63, usrpri=63, nice=20 forw=0xffffffffffffffff, list=0xffff8000fffeed28,0xffff8000212f7d00 process=0xffff8000fffe8018 user=0xffff80002da67000, vmspace=0xfffffd805fbe6188 estcpu=26, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 46243 171833 28190 0 2 0 syz-executor.0 46243 320342 28190 0 2 0x4000000 syz-executor.0 98027 419860 62829 0 2 0x3800 syz-executor.3 *98027 67377 62829 0 7 0x4081880 syz-executor.3 7696 402965 69025 0 2 0 syz-executor.7 94292 476532 18790 0 2 0 syz-executor.5 94292 32593 18790 0 2 0x4000000 syz-executor.5 54607 17755 16730 0 2 0 syz-executor.6 36102 106738 67611 0 2 0 syz-executor.1 75192 354178 31778 0 2 0 syz-executor.2 75192 275662 31778 0 3 0x4000080 fsleep syz-executor.2 75192 75299 31778 0 3 0x4000080 fsleep syz-executor.2 75192 107113 31778 0 2 0x4000000 syz-executor.2 69025 108352 26617 0 2 0x2 syz-executor.7 18790 462558 26617 0 3 0x82 nanoslp syz-executor.5 16730 55938 26617 0 3 0x82 nanoslp syz-executor.6 25250 132218 26617 0 2 0x2 syz-executor.4 62829 288938 26617 0 3 0x82 nanoslp syz-executor.3 31778 455016 26617 0 2 0x2 syz-executor.2 67611 958 26617 0 2 0x2 syz-executor.1 28190 396801 26617 0 3 0x82 nanoslp syz-executor.0 26617 500447 44343 0 3 0x82 nanoslp syz-fuzzer 26617 259423 44343 0 3 0x4000082 nanoslp syz-fuzzer 26617 268705 44343 0 3 0x4000082 thrsleep syz-fuzzer 26617 88108 44343 0 3 0x4000082 thrsleep syz-fuzzer 26617 264888 44343 0 3 0x4000082 thrsleep syz-fuzzer 26617 502100 44343 0 3 0x4000082 thrsleep syz-fuzzer 26617 262948 44343 0 3 0x4000082 thrsleep syz-fuzzer 26617 521840 44343 0 3 0x4000082 thrsleep syz-fuzzer 26617 111034 44343 0 3 0x4000082 kqread syz-fuzzer 44343 247912 63386 0 3 0x10008a sigsusp ksh 63386 376710 45002 0 3 0x9a kqread sshd 70847 3207 1 0 3 0x100083 ttyin getty 45002 52580 1 0 3 0x88 kqread sshd 74588 365818 3721 74 3 0x1100092 bpf pflogd 3721 486523 1 0 3 0x80 netio pflogd 72725 302547 97267 73 3 0x1100090 kqread syslogd 97267 89392 1 0 3 0x100082 netio syslogd 14523 11150 1 0 3 0x100080 kqread resolvd 17162 237699 39607 77 3 0x100092 kqread dhcpleased 90947 128627 39607 77 3 0x100092 kqread dhcpleased 39607 40408 1 0 3 0x80 kqread dhcpleased 80182 466874 0 0 3 0x14200 bored smr 83918 123075 0 0 2 0x14200 zerothread 29568 185346 0 0 3 0x14200 aiodoned aiodoned 98299 323145 0 0 3 0x14200 syncer update 9652 265794 0 0 3 0x14200 cleaner cleaner 8110 515753 0 0 3 0x14200 reaper reaper 66195 436349 0 0 3 0x14200 pgdaemon pagedaemon 68539 243094 0 0 3 0x14200 bored viomb 99340 323753 0 0 3 0x40014200 acpi0 acpi0 66133 93011 0 0 3 0x40014200 idle1 51832 485975 0 0 3 0x14200 bored softnet 62765 80296 0 0 3 0x14200 bored softnet 17049 138944 0 0 3 0x14200 bored softnet 44188 87724 0 0 7 0x14200 softnet 31916 28722 0 0 3 0x14200 bored systqmp 51058 473705 0 0 3 0x14200 bored systq 6125 380810 0 0 3 0x40014200 bored softclock 56202 303033 0 0 3 0x40014200 idle0 1 372802 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks CPU 0: exclusive sched_lock &sched_lock r = 0 (0xffffffff82a872c8) #0 witness_lock+0x44d #1 __mp_acquire_count+0x48 sys/kern/kern_lock.c:227 #2 mi_switch+0x3d4 sys/kern/sched_bsd.c:419 #3 single_thread_check_locked+0x17f sys/kern/kern_sig.c:2045 #4 single_thread_check+0x4b sys/kern/kern_sig.c:2057 #5 sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline] #5 sleep_finish+0x75 sys/kern/kern_synch.c:400 #6 rwsleep+0xd5 sys/kern/kern_synch.c:314 #7 futex_wait+0x13c sys/kern/sys_futex.c:260 #8 sys_futex+0xf8 sys/kern/sys_futex.c:111 #9 syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline] #9 syscall+0x484 sys/arch/amd64/amd64/trap.c:585 #10 Xsyscall+0x128 CPU 1: exclusive mutex &ifq->ifq_task_mtx r = 0 (0xffff8000001a0610) #0 witness_lock+0x44d #1 mtx_enter_try+0x100 #2 mtx_enter+0x4b sys/kern/kern_lock.c:266 #3 ifq_serialize+0x176 sys/net/ifq.c:104 #4 taskq_thread+0xe5 sys/kern/kern_task.c:449 #5 proc_trampoline+0x1c Process 44188 (softnet) thread 0xffff8000211e8000 (87724) shared rwlock softnet r = 0 (0xffff80000002d070) #0 witness_lock+0x44d #1 taskq_thread+0xca sys/kern/kern_task.c:445 #2 proc_trampoline+0x1c ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10179 6476K 6490K 78643K 11275 0 pcb 13 8K 8K 78643K 20 0 rtable 215 6K 7K 78643K 359 0 ifaddr 87 17K 17K 78643K 94 0 counters 56 35K 35K 78643K 56 0 ioctlops 0 0K 4K 78643K 1488 0 iov 0 0K 0K 78643K 11 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1271 79K 79K 78643K 1284 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 1K 78643K 2 0 VM map 2 1K 1K 78643K 2 0 sem 3 0K 0K 78643K 4 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 17 61K 85K 78643K 173 0 proc 67 91K 115K 78643K 506 0 subproc 104 6K 6K 78643K 104 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 88 5K 6K 78643K 99 0 ether_multi 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 25 122K 122K 78643K 25 0 exec 0 0K 2K 78643K 644 0 tdb 3 0K 0K 78643K 3 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 227 81K 81K 78643K 2565 0 UVM aobj 3 2K 2K 78643K 3 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 13 0K 2K 78643K 29 0 temp 92 4708K 4772K 78643K 3735 0 kqueue 12 18K 20K 78643K 30 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 22 0 0 1 0 1 1 0 8 0 rtpcb 120 33 0 30 1 0 1 1 0 8 0 rtentry 112 111 0 12 4 0 4 4 0 8 0 unpcb 136 41 0 26 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 39 0 39 1 1 0 1 0 8 0 tcpcb 736 8 0 4 1 0 1 1 0 8 0 arp 120 18 0 2 1 0 1 1 0 8 0 inpcb 320 70 0 62 1 0 1 1 0 8 0 nd6 48 24 0 3 1 0 1 1 0 8 0 pkpcb 40 3 0 3 1 0 1 1 0 8 1 kcovpl 48 8 0 0 1 0 1 1 0 8 0 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 21 0 0 1 0 1 1 0 8 0 pfstkey 120 21 0 0 1 0 1 1 0 8 0 pfstate 336 21 0 0 2 0 2 2 0 8 0 pfrule 1360 21 0 15 2 0 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 452 0 44 29 0 29 29 0 8 2 art_table 32 453 0 44 4 0 4 4 0 8 0 art_node 16 110 0 20 1 0 1 1 0 8 0 semapl 112 2 0 1 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1523 0 86 90 0 90 90 0 8 0 ffsino 272 1523 0 86 96 0 96 96 0 8 0 nchpl 144 1843 0 160 63 0 63 63 0 8 0 uvmvnodes 80 1637 0 0 34 0 34 34 0 8 0 vnodes 224 1637 0 0 97 0 97 97 0 8 0 namei 1024 6363 0 6363 3 1 2 2 0 8 2 percpumem 16 40 0 0 1 0 1 1 0 8 0 kstatmem 264 26 0 0 2 0 2 2 0 8 0 scxspl 216 5585 0 5585 2 1 1 2 0 8 1 plimitpl 152 24 0 8 1 0 1 1 0 8 0 sigapl 424 478 0 431 7 1 6 6 0 8 0 futexpl 64 566 0 563 1 0 1 1 0 8 0 knotepl 120 112 0 0 4 0 4 4 0 8 0 kqueuepl 224 29 0 20 1 0 1 1 0 8 0 pipepl 336 149 0 120 3 0 3 3 0 8 0 fdescpl 496 461 0 431 5 0 5 5 0 8 0 filepl 152 1882 0 1640 10 0 10 10 0 8 0 lockfpl 104 13 0 11 1 0 1 1 0 8 0 lockfspl 48 7 0 5 1 0 1 1 0 8 0 sessionpl 144 24 0 7 1 0 1 1 0 8 0 pgrppl 48 24 0 7 1 0 1 1 0 8 0 ucredpl 104 60 0 48 1 0 1 1 0 8 0 zombiepl 144 431 0 431 1 0 1 1 0 8 1 processpl 1064 478 0 431 4 0 4 4 0 8 0 procpl 672 564 0 503 7 1 6 6 0 8 0 srpgc 96 2 0 2 1 0 1 1 0 8 1 sockpl 480 147 0 121 4 0 4 4 0 8 0 mcl64k 65536 7 0 0 1 0 1 1 0 8 0 mcl16k 16384 5 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 171 0 0 21 0 21 21 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 229 0 0 14 0 14 14 0 8 0 bufpl 288 3685 0 141 254 0 254 254 0 8 0 anonpl 24 71049 0 55787 97 2 95 95 0 186 1 amapchunkpl 152 5958 0 5302 34 2 32 32 0 158 0 amappl16 200 830 0 375 25 0 25 25 0 8 0 amappl15 192 23 0 20 1 0 1 1 0 8 0 amappl14 184 17 0 13 1 0 1 1 0 8 0 amappl13 176 112 0 105 1 0 1 1 0 8 0 amappl12 168 5 0 3 2 1 1 1 0 8 0 amappl11 160 84 0 66 1 0 1 1 0 8 0 amappl10 152 50 0 42 1 0 1 1 0 8 0 amappl9 144 509 0 504 1 0 1 1 0 8 0 amappl8 136 572 0 530 2 0 2 2 0 8 0 amappl7 128 137 0 123 1 0 1 1 0 8 0 amappl6 120 214 0 197 2 1 1 2 0 8 0 amappl5 112 120 0 102 1 0 1 1 0 8 0 amappl4 104 835 0 810 2 1 1 2 0 8 0 amappl3 96 638 0 589 2 0 2 2 0 8 0 amappl2 88 729 0 668 3 1 2 3 0 8 0 amappl1 80 12646 0 12010 20 5 15 20 0 8 1 amappl 88 2126 0 1962 6 1 5 5 0 92 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 461 0 431 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 461 0 431 1 0 1 1 0 8 0 vmmpekpl 168 8533 0 8483 3 0 3 3 0 8 0 vmmpepl 168 47257 0 44819 128 0 128 128 0 357 18 vmsppl 368 460 0 431 4 0 4 4 0 8 0 rwobjpl 56 14046 0 10970 44 0 44 44 0 8 0 pdppl 4096 929 0 862 109 40 69 79 0 8 2 pvpl 32 263593 0 244034 237 4 233 237 0 265 73 pmappl 248 460 0 431 3 0 3 3 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 639 0 43 18 0 18 18 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff825a0599) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff82615d07,ffffffff825891d5,3f,ffffffff8264bc7b) at __assert+0x25 sys/kern/subr_prf.c:161 _kernel_lock() at _kernel_lock+0xb2 sys/kern/kern_lock.c:63 single_thread_check_locked(ffff8000212f7a50,1,c) at single_thread_check_locked+0x1f6 sys/kern/kern_sig.c:2037 single_thread_check(ffff8000212f7a50,1) at single_thread_check+0x4b sys/kern/kern_sig.c:2057 sleep_finish(ffff80002da6cb40,1) at sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline] sleep_finish(ffff80002da6cb40,1) at sleep_finish+0x75 sys/kern/kern_synch.c:400 rwsleep(ffff8000212f7a50,ffffffff829990c0,120,ffffffff82599d73,0) at rwsleep+0xd5 sys/kern/kern_synch.c:314 futex_wait(1bb88bfb290,6,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:260 sys_futex(ffff8000212f7a50,ffff80002da6ccd0,ffff80002da6cd30) at sys_futex+0xf8 sys/kern/sys_futex.c:111 syscall(ffff80002da6cda0) at syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002da6cda0) at syscall+0x484 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1bbd3e85480, count: -12 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020dd8ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __sanitizer_cov_trace_const_cmp4(0,1) at __sanitizer_cov_trace_const_cmp4+0x2a kd_curproc sys/dev/kcov.c:577 [inline] __sanitizer_cov_trace_const_cmp4(0,1) at __sanitizer_cov_trace_const_cmp4+0x2a sys/dev/kcov.c:225 msleep(ffff80000002d000,ffff80000002d018,20,ffffffff825d250b,0) at msleep+0x152 sys/kern/kern_synch.c:237 taskq_next_work(ffff80000002d000,ffff800021207790) at taskq_next_work+0x6e sys/kern/kern_task.c:402 taskq_thread(ffff80000002d000) at taskq_thread+0x135 sys/kern/kern_task.c:442 end trace frame: 0x0, count: 8 ddb{1}> trace x86_ipi_db(ffff800020dd8ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __sanitizer_cov_trace_const_cmp4(0,1) at __sanitizer_cov_trace_const_cmp4+0x2a kd_curproc sys/dev/kcov.c:577 [inline] __sanitizer_cov_trace_const_cmp4(0,1) at __sanitizer_cov_trace_const_cmp4+0x2a sys/dev/kcov.c:225 msleep(ffff80000002d000,ffff80000002d018,20,ffffffff825d250b,0) at msleep+0x152 sys/kern/kern_synch.c:237 taskq_next_work(ffff80000002d000,ffff800021207790) at taskq_next_work+0x6e sys/kern/kern_task.c:402 taskq_thread(ffff80000002d000) at taskq_thread+0x135 sys/kern/kern_task.c:442 end trace frame: 0x0, count: -7