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
*226148 13902 0 0x1802 0x4080080 1 syz-executor2883823057
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437
panic(ffffffff8259bd82) at panic+0x177 sys/kern/subr_prf.c:202
__assert(ffffffff8261504d,ffffffff8261b5a3,3f,ffffffff8264d4fb) 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(ffff800021232548,1,c) at single_thread_check_locked+0x1f6 sys/kern/kern_sig.c:2037
single_thread_check(ffff800021232548,1) at single_thread_check+0x4b sys/kern/kern_sig.c:2057
sleep_finish(ffff8000212c2550,1) at sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline]
sleep_finish(ffff8000212c2550,1) at sleep_finish+0x75 sys/kern/kern_synch.c:400
rwsleep(ffff800021232548,ffffffff82957750,120,ffffffff82595e88,0) at rwsleep+0xd5 sys/kern/kern_synch.c:314
futex_wait(bc96a93640,1,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:260
sys_futex(ffff800021232548,ffff8000212c26e0,ffff8000212c2740) at sys_futex+0xf8 sys/kern/sys_futex.c:111
syscall(ffff8000212c27b0) at syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff8000212c27b0) at syscall+0x484 sys/arch/amd64/amd64/trap.c:585
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xbcc5099500, 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{1}>
ddb{1}> set $lines = 0
ddb{1}> set $maxwidth = 0
ddb{1}> show panic
*cpu1: kernel diagnostic assertion "__mp_lock_held(&sched_lock, curcpu()) == 0" failed: file "/syzkaller/managers/setuid/kernel/sys/kern/kern_lock.c", line 63
ddb{1}> trace
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437
panic(ffffffff8259bd82) at panic+0x177 sys/kern/subr_prf.c:202
__assert(ffffffff8261504d,ffffffff8261b5a3,3f,ffffffff8264d4fb) 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(ffff800021232548,1,c) at single_thread_check_locked+0x1f6 sys/kern/kern_sig.c:2037
single_thread_check(ffff800021232548,1) at single_thread_check+0x4b sys/kern/kern_sig.c:2057
sleep_finish(ffff8000212c2550,1) at sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline]
sleep_finish(ffff8000212c2550,1) at sleep_finish+0x75 sys/kern/kern_synch.c:400
rwsleep(ffff800021232548,ffffffff82957750,120,ffffffff82595e88,0) at rwsleep+0xd5 sys/kern/kern_synch.c:314
futex_wait(bc96a93640,1,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:260
sys_futex(ffff800021232548,ffff8000212c26e0,ffff8000212c2740) at sys_futex+0xf8 sys/kern/sys_futex.c:111
syscall(ffff8000212c27b0) at syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff8000212c27b0) at syscall+0x484 sys/arch/amd64/amd64/trap.c:585
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xbcc5099500, count: -12
ddb{1}> show registers
rdi 0
rsi 0x1
rbp 0xffff8000212c2310
rbx 0xffff800020dd9bb7
rdx 0x3fd
rcx 0
rax 0x9f
r8 0x101010101010101
r9 0x8080808080808080
r10 0x3b3e1894665f128c
r11 0x7302afdd430d6aad
r12 0xffff800020dd99b8
r13 0
r14 0
r15 0x1
rip 0xffffffff81477f68 db_enter+0x18
cs 0x8
rflags 0x246
rsp 0xffff8000212c2300
ss 0x10
db_enter+0x18: addq $0x8,%rsp
ddb{1}> show proc
PROC (syz-executor2883823057) pid=226148 stat=onproc
flags process=1802<EXEC,COREDUMP,SINGLEEXIT> proc=4080080<SINTR,SUSPSINGLE,THREAD>
pri=52, usrpri=52, nice=20
forw=0xffffffffffffffff, list=0xffff800021233a48,0xffffffff82ae5bb0
process=0xffff8000ffff10b0 user=0xffff8000212bd000, vmspace=0xfffffd807effd450
estcpu=2, cpticks=0, pctcpu=0.0
user=0, sys=0, intr=0
ddb{1}> ps
PID TID PPID UID S FLAGS WAIT COMMAND
13902 344694 23130 0 2 0x3802 syz-executor2883823057
*13902 226148 23130 0 7 0x4081882 syz-executor2883823057
23130 385634 76440 0 3 0x10008a sigsusp ksh
76440 29313 65506 0 3 0x9a kqread sshd
95913 287839 1 0 3 0x100083 ttyin getty
65506 148128 1 0 3 0x88 kqread sshd
62671 98026 96552 73 3 0x1100090 kqread syslogd
96552 311686 1 0 3 0x100082 netio syslogd
50429 379011 1 0 3 0x100080 kqread resolvd
89371 503269 64993 77 3 0x100092 kqread dhcpleased
97655 176247 64993 77 3 0x100092 kqread dhcpleased
64993 120395 1 0 3 0x80 kqread dhcpleased
3118 392503 0 0 3 0x14200 bored smr
605 361361 0 0 3 0x14200 pgzero zerothread
85162 142689 0 0 3 0x14200 aiodoned aiodoned
45741 485789 0 0 3 0x14200 syncer update
35012 262224 0 0 3 0x14200 cleaner cleaner
75116 185128 0 0 3 0x14200 reaper reaper
79943 462738 0 0 3 0x14200 pgdaemon pagedaemon
62164 479814 0 0 3 0x14200 bored viomb
15524 293409 0 0 3 0x40014200 acpi0 acpi0
89569 79084 0 0 3 0x40014200 idle1
23750 277942 0 0 3 0x14200 bored softnet
93256 6832 0 0 3 0x14200 bored softnet
90721 370093 0 0 3 0x14200 bored softnet
86336 16639 0 0 3 0x14200 bored softnet
16269 147355 0 0 3 0x14200 bored systqmp
93611 6797 0 0 3 0x14200 bored systq
4323 195309 0 0 3 0x40014200 bored softclock
91359 359082 0 0 7 0x40014200 idle0
1 151075 0 0 3 0x82 wait init
0 0 -1 0 3 0x10200 scheduler swapper
ddb{1}> show all locks
CPU 1:
exclusive sched_lock &sched_lock r = 0 (0xffffffff82b5eeb8)
#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{1}> show malloc
Type InUse MemUse HighUse Limit Requests Type Lim
devbuf 10146 6388K 6420K 78643K 11236 0
pcb 13 8K 8K 78643K 13 0
rtable 58 1K 2K 78643K 104 0
ifaddr 24 7K 7K 78643K 24 0
counters 40 33K 33K 78643K 40 0
ioctlops 0 0K 2K 78643K 25 0
mount 1 1K 1K 78643K 1 0
log 0 0K 0K 78643K 5 0
vnodes 1166 73K 73K 78643K 1179 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 2 0K 0K 78643K 2 0
dirhash 12 2K 2K 78643K 12 0
ACPI 1697 195K 286K 78643K 12548 0
file desc 1 0K 0K 78643K 1 0
proc 55 78K 79K 78643K 226 0
NFS srvsock 1 0K 0K 78643K 1 0
NFS daemon 1 16K 16K 78643K 1 0
in_multi 11 0K 0K 78643K 11 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 389 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 59 11K 11K 78643K 1401 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 3 0K 0K 78643K 3 0
temp 18 4705K 4769K 78643K 2266 0
kqueue 11 16K 18K 78643K 24 0
SYN cache 2 16K 16K 78643K 2 0
ddb{1}> 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 17 0 14 1 0 1 1 0 8 0
rtentry 112 23 0 1 1 0 1 1 0 8 0
unpcb 136 33 0 20 1 0 1 1 0 8 0
syncache 296 5 0 5 2 1 1 1 0 8 1
tcpcb 736 8 0 5 1 0 1 1 0 8 0
arp 120 2 0 0 1 0 1 1 0 8 0
inpcb 320 25 0 19 1 0 1 1 0 8 0
art_heap8 4096 1 0 0 1 0 1 1 0 8 0
art_heap4 256 97 0 0 7 0 7 7 0 8 0
art_table 32 98 0 0 1 0 1 1 0 8 0
art_node 16 22 0 2 1 0 1 1 0 8 0
dirhash 1024 17 0 0 3 0 3 3 0 8 0
dino2pl 256 1416 0 38 87 0 87 87 0 8 0
ffsino 272 1416 0 38 92 0 92 92 0 8 0
nchpl 144 1603 0 47 58 0 58 58 0 8 0
uvmvnodes 80 1425 0 0 30 0 30 30 0 8 0
vnodes 224 1425 0 0 84 0 84 84 0 8 0
namei 1024 4171 0 4171 2 1 1 1 0 8 1
percpumem 16 32 0 0 1 0 1 1 0 8 0
kstatmem 264 6 0 0 1 0 1 1 0 8 0
scxspl 216 4008 0 4008 10 8 2 8 0 8 2
plimitpl 152 17 0 10 1 0 1 1 0 8 0
sigapl 424 294 0 264 4 0 4 4 0 8 0
futexpl 64 1 0 0 1 0 1 1 0 8 0
knotepl 120 50 0 0 2 0 2 2 0 8 0
kqueuepl 224 20 0 13 1 0 1 1 0 8 0
pipepl 336 79 0 76 2 1 1 1 0 8 0
fdescpl 496 277 0 264 3 1 2 3 0 8 0
filepl 152 1043 0 990 3 0 3 3 0 8 0
lockfpl 104 6 0 4 1 0 1 1 0 8 0
lockfspl 48 4 0 2 1 0 1 1 0 8 0
sessionpl 144 17 0 9 1 0 1 1 0 8 0
pgrppl 48 17 0 9 1 0 1 1 0 8 0
ucredpl 104 64 0 54 1 0 1 1 0 8 0
zombiepl 144 264 0 264 2 1 1 1 0 8 1
processpl 1064 294 0 264 3 0 3 3 0 8 0
procpl 672 295 0 264 3 0 3 3 0 8 0
sockpl 480 75 0 53 3 0 3 3 0 8 0
mcl8k 8192 3 0 0 1 0 1 1 0 8 0
mcl4k 4096 5 0 0 1 0 1 1 0 8 0
mcl2k 2048 76 0 0 9 0 9 9 0 8 0
mtagpl 96 3 0 0 1 0 1 1 0 8 0
mbufpl 256 119 0 0 7 0 7 7 0 8 0
bufpl 288 1945 0 86 133 0 133 133 0 8 0
anonpl 24 35567 0 33567 15 2 13 13 0 186 0
amapchunkpl 152 2550 0 2449 5 1 4 5 0 158 0
amappl16 200 85 0 80 1 0 1 1 0 8 0
amappl15 192 1 0 1 1 1 0 1 0 8 0
amappl13 176 32 0 31 2 1 1 1 0 8 0
amappl12 168 3 0 3 2 1 1 1 0 8 1
amappl11 160 60 0 47 1 0 1 1 0 8 0
amappl10 152 1 0 1 1 1 0 1 0 8 0
amappl9 144 493 0 490 1 0 1 1 0 8 0
amappl8 136 333 0 331 2 1 1 1 0 8 0
amappl7 128 48 0 45 1 0 1 1 0 8 0
amappl6 120 94 0 84 1 0 1 1 0 8 0
amappl5 112 81 0 73 1 0 1 1 0 8 0
amappl4 104 565 0 546 1 0 1 1 0 8 0
amappl3 96 400 0 378 1 0 1 1 0 8 0
amappl2 88 416 0 378 1 0 1 1 0 8 0
amappl1 80 8759 0 8368 9 0 9 9 0 8 0
amappl 88 1147 0 1107 2 1 1 2 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 277 0 264 1 0 1 1 0 8 0
uaddrbest 32 2 0 0 1 0 1 1 0 8 0
uaddr 24 277 0 264 1 0 1 1 0 8 0
vmmpekpl 168 6036 0 6023 1 0 1 1 0 8 0
vmmpepl 168 24953 0 24124 40 2 38 38 0 357 0
vmsppl 368 276 0 264 2 0 2 2 0 8 0
rwobjpl 56 9116 0 7145 29 0 29 29 0 8 0
pdppl 4096 561 0 528 51 18 33 41 0 8 0
pvpl 32 118885 0 115008 34 1 33 33 0 265 0
pmappl 248 276 0 264 2 1 1 2 0 8 0
extentpl 40 58 0 38 1 0 1 1 0 8 0
phpool 112 402 0 22 11 0 11 11 0 8 0
ddb{1}> machine ddbcpu 0
Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp
x86_ipi_db(ffffffff8292aff0) 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
__mp_lock(ffffffff82b5ecb0) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline]
__mp_lock(ffffffff82b5ecb0) at __mp_lock+0x122 sys/kern/kern_lock.c:147
__mp_acquire_count(ffffffff82b5ecb0,1) at __mp_acquire_count+0x48 sys/kern/kern_lock.c:227
mi_switch() at mi_switch+0x3d4 sys/kern/sched_bsd.c:419
sched_idle(ffffffff8292aff0) at sched_idle+0x1a6 sys/kern/kern_sched.c:164
end trace frame: 0x0, count: 8
ddb{0}> trace
x86_ipi_db(ffffffff8292aff0) 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
__mp_lock(ffffffff82b5ecb0) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline]
__mp_lock(ffffffff82b5ecb0) at __mp_lock+0x122 sys/kern/kern_lock.c:147
__mp_acquire_count(ffffffff82b5ecb0,1) at __mp_acquire_count+0x48 sys/kern/kern_lock.c:227
mi_switch() at mi_switch+0x3d4 sys/kern/sched_bsd.c:419
sched_idle(ffffffff8292aff0) at sched_idle+0x1a6 sys/kern/kern_sched.c:164
end trace frame: 0x0, count: -7
ddb{0}> machine ddbcpu 1
Stopped at db_enter+0x18: addq $0x8,%rsp
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437
panic(ffffffff8259bd82) at panic+0x177 sys/kern/subr_prf.c:202
__assert(ffffffff8261504d,ffffffff8261b5a3,3f,ffffffff8264d4fb) 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(ffff800021232548,1,c) at single_thread_check_locked+0x1f6 sys/kern/kern_sig.c:2037
single_thread_check(ffff800021232548,1) at single_thread_check+0x4b sys/kern/kern_sig.c:2057
sleep_finish(ffff8000212c2550,1) at sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline]
sleep_finish(ffff8000212c2550,1) at sleep_finish+0x75 sys/kern/kern_synch.c:400
rwsleep(ffff800021232548,ffffffff82957750,120,ffffffff82595e88,0) at rwsleep+0xd5 sys/kern/kern_synch.c:314
futex_wait(bc96a93640,1,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:260
sys_futex(ffff800021232548,ffff8000212c26e0,ffff8000212c2740) at sys_futex+0xf8 sys/kern/sys_futex.c:111
syscall(ffff8000212c27b0) at syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff8000212c27b0) at syscall+0x484 sys/arch/amd64/amd64/trap.c:585
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xbcc5099500, count: 3
ddb{1}> trace
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437
panic(ffffffff8259bd82) at panic+0x177 sys/kern/subr_prf.c:202
__assert(ffffffff8261504d,ffffffff8261b5a3,3f,ffffffff8264d4fb) 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(ffff800021232548,1,c) at single_thread_check_locked+0x1f6 sys/kern/kern_sig.c:2037
single_thread_check(ffff800021232548,1) at single_thread_check+0x4b sys/kern/kern_sig.c:2057
sleep_finish(ffff8000212c2550,1) at sleep_finish+0x75 sleep_signal_check sys/kern/kern_synch.c:464 [inline]
sleep_finish(ffff8000212c2550,1) at sleep_finish+0x75 sys/kern/kern_synch.c:400
rwsleep(ffff800021232548,ffffffff82957750,120,ffffffff82595e88,0) at rwsleep+0xd5 sys/kern/kern_synch.c:314
futex_wait(bc96a93640,1,0,2) at futex_wait+0x13c sys/kern/sys_futex.c:260
sys_futex(ffff800021232548,ffff8000212c26e0,ffff8000212c2740) at sys_futex+0xf8 sys/kern/sys_futex.c:111
syscall(ffff8000212c27b0) at syscall+0x484 mi_syscall sys/sys/syscall_mi.h:102 [inline]
syscall(ffff8000212c27b0) at syscall+0x484 sys/arch/amd64/amd64/trap.c:585
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0xbcc5099500, count: -12
ddb{1}>