panic: kernel diagnostic assertion "__mp_lock_held(&sched_lock, curcpu()) == 0" failed: file "/syzkaller/managers/setuid/kernel/sys/kern/kern_lock.c", line 63 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *433020 35611 32767 0x1810 0x4080080 0 syz-executor.4 439150 7346 32767 0x10 0 1 syz-executor.5 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff825a1086) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff82613da6,ffffffff82617104,3f,ffffffff8264968f) 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(ffff8000fffec550,1,c) at single_thread_check_locked+0x1f6 sys/kern/kern_sig.c:2037 single_thread_check(ffff8000fffec550,1) at single_thread_check+0x4b sys/kern/kern_sig.c:2057 sleep_finish(ffff800027e403b0,1) at sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline] sleep_finish(ffff800027e403b0,1) at sleep_finish+0x75 sys/kern/kern_synch.c:400 rwsleep(ffff8000fffec550,ffffffff8296a1a0,120,ffffffff82595f34,0) at rwsleep+0xd5 sys/kern/kern_synch.c:314 futex_wait(9a6a8b66a50,1,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:260 sys_futex(ffff8000fffec550,ffff800027e40540,ffff800027e405a0) at sys_futex+0xf8 sys/kern/sys_futex.c:111 syscall(ffff800027e40610) at syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800027e40610) at syscall+0x484 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9a5dfb92720, 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/setuid/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(ffffffff825a1086) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff82613da6,ffffffff82617104,3f,ffffffff8264968f) 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(ffff8000fffec550,1,c) at single_thread_check_locked+0x1f6 sys/kern/kern_sig.c:2037 single_thread_check(ffff8000fffec550,1) at single_thread_check+0x4b sys/kern/kern_sig.c:2057 sleep_finish(ffff800027e403b0,1) at sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline] sleep_finish(ffff800027e403b0,1) at sleep_finish+0x75 sys/kern/kern_synch.c:400 rwsleep(ffff8000fffec550,ffffffff8296a1a0,120,ffffffff82595f34,0) at rwsleep+0xd5 sys/kern/kern_synch.c:314 futex_wait(9a6a8b66a50,1,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:260 sys_futex(ffff8000fffec550,ffff800027e40540,ffff800027e405a0) at sys_futex+0xf8 sys/kern/sys_futex.c:111 syscall(ffff800027e40610) at syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800027e40610) at syscall+0x484 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9a5dfb92720, count: -12 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff800027e40170 rbx 0xffffffff82989bb7 cpu_info_full_primary+0x2bb7 rdx 0 rcx 0 rax 0xffff8000fffec550 r8 0x101010101010101 r9 0x8080808080808080 r10 0x617a7f67dadab62b r11 0xd823bc3ee5b24475 r12 0xffffffff829899b8 cpu_info_full_primary+0x29b8 r13 0 r14 0 r15 0x1 rip 0xffffffff813e2898 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800027e40160 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.4) pid=433020 stat=onproc flags process=1810 proc=4080080 pri=78, usrpri=78, nice=20 forw=0xffffffffffffffff, list=0xffff8000fffed270,0xffff8000fffed7c0 process=0xffff8000fffea580 user=0xffff800027e3b000, vmspace=0xfffffd80669448b8 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 3992 244979 40408 32767 2 0x10 syz-executor.6 3992 425972 40408 32767 2 0x4000010 syz-executor.6 35611 165432 14645 32767 2 0x3810 syz-executor.4 *35611 433020 14645 32767 7 0x4081890 syz-executor.4 7346 439150 69168 32767 7 0x10 syz-executor.5 7346 473150 69168 32767 2 0x4000010 syz-executor.5 75044 42710 60949 32767 3 0x90 nanoslp syz-executor.3 75044 296336 60949 32767 3 0x4000090 netio syz-executor.3 75044 54694 60949 32767 3 0x4000090 fsleep syz-executor.3 84484 88699 0 0 3 0x14200 bored sosplice 14645 354415 40073 32767 3 0x90 nanoslp syz-executor.4 69168 120261 98159 32767 3 0x90 nanoslp syz-executor.5 32864 471138 79757 32767 3 0x90 piperd syz-executor.7 40408 379121 76812 32767 3 0x90 nanoslp syz-executor.6 79757 419431 5079 0 3 0x82 wait syz-executor.7 76812 109308 5079 0 3 0x82 wait syz-executor.6 98159 189416 5079 0 3 0x82 wait syz-executor.5 40073 6330 5079 0 3 0x82 wait syz-executor.4 60949 402845 4693 32767 3 0x90 nanoslp syz-executor.3 27982 208655 66517 32767 2 0x10 syz-executor.2 4693 105848 5079 0 3 0x82 wait syz-executor.3 18459 213280 18930 32767 3 0x90 piperd syz-executor.0 88619 103214 89925 32767 3 0x90 piperd syz-executor.1 66517 426023 5079 0 3 0x82 wait syz-executor.2 89925 381082 5079 0 3 0x82 wait syz-executor.1 18930 64107 5079 0 3 0x82 wait syz-executor.0 5079 305461 91673 0 3 0x82 thrsleep syz-fuzzer 5079 264478 91673 0 3 0x4000082 thrsleep syz-fuzzer 5079 105567 91673 0 3 0x4000082 thrsleep syz-fuzzer 5079 512756 91673 0 3 0x4000082 thrsleep syz-fuzzer 5079 213422 91673 0 3 0x4000082 thrsleep syz-fuzzer 5079 252674 91673 0 3 0x4000082 kqread syz-fuzzer 5079 221225 91673 0 3 0x4000082 thrsleep syz-fuzzer 5079 312382 91673 0 3 0x4000082 thrsleep syz-fuzzer 5079 66197 91673 0 3 0x4000082 thrsleep syz-fuzzer 91673 366052 70937 0 3 0x10008a sigsusp ksh 70937 171637 63911 0 3 0x9a kqread sshd 59170 466675 1 0 3 0x100083 ttyin getty 63911 39719 1 0 3 0x88 kqread sshd 73340 65971 89563 73 3 0x1100090 kqread syslogd 89563 206253 1 0 3 0x100082 netio syslogd 88029 283109 1 0 3 0x100080 kqread resolvd 58993 338858 16909 77 3 0x100092 kqread dhcpleased 95119 367050 16909 77 3 0x100092 kqread dhcpleased 16909 323494 1 0 3 0x80 kqread dhcpleased 36422 332516 0 0 3 0x14200 bored smr 58393 311250 0 0 2 0x14200 zerothread 35217 15984 0 0 3 0x14200 aiodoned aiodoned 55962 60470 0 0 3 0x14200 syncer update 31790 1111 0 0 3 0x14200 cleaner cleaner 69713 221122 0 0 3 0x14200 reaper reaper 69144 485827 0 0 3 0x14200 pgdaemon pagedaemon 2597 59444 0 0 3 0x14200 bored viomb 99026 112246 0 0 3 0x40014200 acpi0 acpi0 3906 322465 0 0 3 0x40014200 idle1 35134 453363 0 0 3 0x14200 bored softnet 54104 54977 0 0 3 0x14200 bored softnet 40298 460340 0 0 3 0x14200 bored softnet 31683 467527 0 0 3 0x14200 bored softnet 76631 500373 0 0 3 0x14200 bored systqmp 25530 201444 0 0 3 0x14200 bored systq 82955 510856 0 0 3 0x40014200 bored softclock 78895 157012 0 0 3 0x40014200 idle0 1 50301 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 (0xffffffff82a153e0) #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 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10178 6408K 6420K 78643K 11268 0 pcb 13 10K 12K 78643K 15 0 rtable 238 6K 7K 78643K 420 0 ifaddr 81 16K 16K 78643K 82 0 sysctl 3 1K 2K 78643K 8 0 counters 56 35K 35K 78643K 56 0 ioctlops 0 0K 2K 78643K 33 0 iov 0 0K 24K 78643K 256 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1270 79K 79K 78643K 1539 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 20 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 322 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 22 81K 117K 78643K 1656 0 sigio 0 0K 0K 78643K 13 0 proc 56 78K 103K 78643K 557 0 subproc 104 6K 6K 78643K 104 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 75 0 in_multi 99 6K 6K 78643K 124 0 ether_multi 1 0K 0K 78643K 12 0 mrt 2 0K 0K 78643K 2 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 67 307K 307K 78643K 67 0 exec 0 0K 2K 78643K 758 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 235 82K 86K 78643K 11687 0 UVM aobj 80 3K 3K 78643K 97 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 72 0 NDP 11 0K 2K 78643K 27 0 temp 124 4722K 4786K 78643K 7183 0 kqueue 12 18K 24K 78643K 159 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 128 0 125 1 0 1 1 0 8 0 rtentry 112 114 0 2 4 0 4 4 0 8 0 unpcb 136 745 0 731 5 3 2 4 0 8 1 syncache 296 11 0 11 4 4 0 1 0 8 0 tcpqe 32 91 0 91 3 3 0 1 0 8 0 tcpcb 736 337 0 329 15 13 2 8 0 8 0 arp 120 20 0 0 1 0 1 1 0 8 0 inpcb 320 971 0 956 23 21 2 12 0 8 0 nd6 48 25 0 1 1 0 1 1 0 8 0 kcovpl 48 8 0 0 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 467 0 13 30 1 29 30 0 8 0 art_table 32 468 0 13 4 0 4 4 0 8 0 art_node 16 113 0 11 1 0 1 1 0 8 0 sysvmsgpl 40 40 0 9 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 316 0 306 1 0 1 1 0 8 0 shmpl 112 94 0 17 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 3518 0 2083 91 0 91 91 0 8 0 ffsino 272 3518 0 2083 97 0 97 97 0 8 0 nchpl 144 5826 0 4154 63 0 63 63 0 8 0 uvmvnodes 80 3631 0 0 75 0 75 75 0 8 0 vnodes 224 3631 0 0 214 0 214 214 0 8 0 namei 1024 20571 0 20571 2 1 1 2 0 8 1 percpumem 16 40 0 0 1 0 1 1 0 8 0 kstatmem 264 22 0 0 2 0 2 2 0 8 0 scxspl 216 16461 0 16461 14 12 2 8 0 8 2 plimitpl 152 575 0 552 4 3 1 2 0 8 0 sigapl 424 1944 0 1893 7 0 7 7 0 8 0 futexpl 64 16521 0 16519 1 0 1 1 0 8 0 knotepl 120 249 0 0 8 0 8 8 0 8 0 kqueuepl 224 774 0 766 23 18 5 5 0 8 4 pipepl 336 614 0 586 23 15 8 8 0 8 5 fdescpl 496 1926 0 1893 7 2 5 6 0 8 0 filepl 152 13086 0 12852 35 18 17 17 0 8 7 lockfpl 104 168 0 166 1 0 1 1 0 8 0 lockfspl 48 74 0 72 1 0 1 1 0 8 0 sessionpl 144 23 0 7 1 0 1 1 0 8 0 pgrppl 48 26 0 10 1 0 1 1 0 8 0 ucredpl 104 1912 0 1894 1 0 1 1 0 8 0 zombiepl 144 1894 0 1893 1 0 1 1 0 8 0 processpl 1064 1944 0 1893 4 0 4 4 0 8 0 procpl 672 5130 0 5066 10 3 7 8 0 8 1 sosppl 168 25 0 25 4 3 1 1 0 8 1 sockpl 480 1871 0 1845 50 42 8 20 0 8 4 mcl64k 65536 12 0 0 2 0 2 2 0 8 0 mcl16k 16384 12 0 0 2 0 2 2 0 8 0 mcl12k 12288 11 0 0 2 0 2 2 0 8 0 mcl9k 9216 6 0 0 1 0 1 1 0 8 0 mcl8k 8192 13 0 0 2 0 2 2 0 8 0 mcl4k 4096 15 0 0 2 0 2 2 0 8 0 mcl2k2 2112 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 177 0 0 21 1 20 21 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 396 0 0 24 1 23 23 0 8 0 bufpl 288 5743 0 137 401 0 401 401 0 8 0 anonpl 24 398008 0 385967 126 31 95 104 0 186 3 amapchunkpl 152 32225 0 31645 29 3 26 28 0 158 0 amappl16 200 6945 0 6599 51 30 21 32 0 8 2 amappl15 192 4 0 1 1 0 1 1 0 8 0 amappl14 184 18 0 15 1 0 1 1 0 8 0 amappl13 176 272 0 267 1 0 1 1 0 8 0 amappl12 168 209 0 204 1 0 1 1 0 8 0 amappl11 160 467 0 446 1 0 1 1 0 8 0 amappl10 152 235 0 227 2 1 1 1 0 8 0 amappl9 144 894 0 887 1 0 1 1 0 8 0 amappl8 136 774 0 714 3 0 3 3 0 8 0 amappl7 128 306 0 294 1 0 1 1 0 8 0 amappl6 120 604 0 584 2 1 1 2 0 8 0 amappl5 112 1859 0 1837 1 0 1 1 0 8 0 amappl4 104 1205 0 1180 1 0 1 1 0 8 0 amappl3 96 5582 0 5532 2 0 2 2 0 8 0 amappl2 88 2453 0 2388 3 1 2 3 0 8 0 amappl1 80 47652 0 46986 20 4 16 19 0 8 0 amappl 88 11194 0 11036 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 96 0 17 2 0 2 2 0 8 0 uaddrrnd 24 1926 0 1893 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1926 0 1893 1 0 1 1 0 8 0 vmmpekpl 168 19425 0 19379 3 0 3 3 0 8 0 vmmpepl 168 191779 0 189283 154 27 127 135 0 357 5 vmsppl 368 1925 0 1893 4 0 4 4 0 8 0 rwobjpl 56 53743 0 48737 74 2 72 72 0 8 0 pdppl 4096 3859 0 3786 157 76 81 91 0 8 8 pvpl 32 826859 0 809878 246 73 173 240 0 265 17 pmappl 248 1925 0 1893 4 1 3 3 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 880 0 110 22 0 22 22 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(ffffffff825a1086) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff82613da6,ffffffff82617104,3f,ffffffff8264968f) 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(ffff8000fffec550,1,c) at single_thread_check_locked+0x1f6 sys/kern/kern_sig.c:2037 single_thread_check(ffff8000fffec550,1) at single_thread_check+0x4b sys/kern/kern_sig.c:2057 sleep_finish(ffff800027e403b0,1) at sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline] sleep_finish(ffff800027e403b0,1) at sleep_finish+0x75 sys/kern/kern_synch.c:400 rwsleep(ffff8000fffec550,ffffffff8296a1a0,120,ffffffff82595f34,0) at rwsleep+0xd5 sys/kern/kern_synch.c:314 futex_wait(9a6a8b66a50,1,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:260 sys_futex(ffff8000fffec550,ffff800027e40540,ffff800027e405a0) at sys_futex+0xf8 sys/kern/sys_futex.c:111 syscall(ffff800027e40610) at syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800027e40610) at syscall+0x484 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9a5dfb92720, count: -12 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020de8ff0) 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_pc() at __sanitizer_cov_trace_pc+0x28 kd_curproc sys/dev/kcov.c:577 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x28 sys/dev/kcov.c:148 __mp_lock(ffffffff82a151d8) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82a151d8) at __mp_lock+0x133 sys/kern/kern_lock.c:147 preempt() at preempt+0x36 sys/kern/sched_bsd.c:307 ast(ffff80002b64c3e0) at ast+0x108 mi_ast sys/sys/syscall_mi.h:184 [inline] ast(ffff80002b64c3e0) at ast+0x108 sys/arch/amd64/amd64/trap.c:508 intr_user_exit() at intr_user_exit+0x3c end of kernel end trace frame: 0x7f7ffffc6b60, count: 7 ddb{1}> trace x86_ipi_db(ffff800020de8ff0) 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_pc() at __sanitizer_cov_trace_pc+0x28 kd_curproc sys/dev/kcov.c:577 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x28 sys/dev/kcov.c:148 __mp_lock(ffffffff82a151d8) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82a151d8) at __mp_lock+0x133 sys/kern/kern_lock.c:147 preempt() at preempt+0x36 sys/kern/sched_bsd.c:307 ast(ffff80002b64c3e0) at ast+0x108 mi_ast sys/sys/syscall_mi.h:184 [inline] ast(ffff80002b64c3e0) at ast+0x108 sys/arch/amd64/amd64/trap.c:508 intr_user_exit() at intr_user_exit+0x3c end of kernel end trace frame: 0x7f7ffffc6b60, count: -8