witness: panic: kernel diagnostic assertion "_kernel_lock_held()" failed: file "/syzkaller/managers/setuid/kernel/sys/kern/kern_event.c", line 1076 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 168626 86843 32767 0x10 0 1 syz-executor.1 * 67480 86843 32767 0x10 0x4000000 0 syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:208 __assert(ffffffff81f8c2bf,ffffffff81f90d96,434,ffffffff81f96de6) at __assert+0x2e sys/kern/subr_prf.c:155 knote_enqueue(fffffd806ed60bd0) at knote_enqueue+0x216 sys/kern/kern_event.c:1076 knote(ffffffff8234b168,1000000) at knote+0xbd sys/kern/kern_event.c:957 selwakeup(ffffffff8234b168) at selwakeup+0x3b sys/kern/sys_generic.c:795 logwakeup() at logwakeup+0x3b sys/kern/subr_log.c:310 printf(ffffffff81f6acf3) at printf+0x9f sys/kern/subr_prf.c:519 witness_warn(2,0,ffffffff81f92281) at witness_warn+0x211 sys/kern/subr_witness.c:1416 userret(ffff800020b75788) at userret+0x32a sys/kern/kern_sig.c:1902 syscall(ffff800020c23b00) at syscall+0x614 mi_syscall_return sys/sys/syscall_mi.h:122 [inline] syscall(ffff800020c23b00) at syscall+0x614 sys/arch/amd64/amd64/trap.c:596 Xsyscall(6,5,c,0,3,4f655ae1010) at Xsyscall+0x128 end of kernel end trace frame: 0x3ba, 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 kernel diagnostic assertion "_kernel_lock_held()" failed: file "/syzkaller/managers/setuid/kernel/sys/kern/kern_event.c", line 1076 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:208 __assert(ffffffff81f8c2bf,ffffffff81f90d96,434,ffffffff81f96de6) at __assert+0x2e sys/kern/subr_prf.c:155 knote_enqueue(fffffd806ed60bd0) at knote_enqueue+0x216 sys/kern/kern_event.c:1076 knote(ffffffff8234b168,1000000) at knote+0xbd sys/kern/kern_event.c:957 selwakeup(ffffffff8234b168) at selwakeup+0x3b sys/kern/sys_generic.c:795 logwakeup() at logwakeup+0x3b sys/kern/subr_log.c:310 printf(ffffffff81f6acf3) at printf+0x9f sys/kern/subr_prf.c:519 witness_warn(2,0,ffffffff81f92281) at witness_warn+0x211 sys/kern/subr_witness.c:1416 userret(ffff800020b75788) at userret+0x32a sys/kern/kern_sig.c:1902 syscall(ffff800020c23b00) at syscall+0x614 mi_syscall_return sys/sys/syscall_mi.h:122 [inline] syscall(ffff800020c23b00) at syscall+0x614 sys/arch/amd64/amd64/trap.c:596 Xsyscall(6,5,c,0,3,4f655ae1010) at Xsyscall+0x128 end of kernel end trace frame: 0x3ba, count: -12 ddb{0}> show registers rdi 0xffffffff81c2c857 db_enter+0x17 rsi 0x3e8c __ALIGN_SIZE+0x2e8c rbp 0xffff800020c23670 rbx 0xffff800020c23720 rdx 0x3e8d __ALIGN_SIZE+0x2e8d rcx 0xffff8000009a0000 rax 0xffff8000009a0000 r8 0xffffffff81df1983 kprintf+0x173 r9 0x1 r10 0x25 r11 0xe269736b94915395 r12 0x3000000008 r13 0xffff800020c23680 r14 0x100 r15 0x1 rip 0xffffffff81c2c858 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c23660 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=67480 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=70, nice=20 forw=0xffffffffffffffff, list=0xffff800020b75530,0xffff800020b74be0 process=0xffff800020b8c360 user=0xffff800020c1e000, vmspace=0xfffffd807effdb40 estcpu=20, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 86843 168626 61658 32767 7 0x10 syz-executor.1 *86843 67480 61658 32767 7 0x4000010 syz-executor.1 86843 447177 61658 32767 2 0x4000010 syz-executor.1 86843 423308 61658 32767 3 0x4000090 fsleep syz-executor.1 86843 484607 61658 32767 3 0x4000090 fsleep syz-executor.1 86843 70960 61658 32767 2 0x4000010 syz-executor.1 56787 205338 14227 32767 3 0x90 nanosleep syz-executor.0 56787 374977 14227 32767 3 0x4000090 ttyout syz-executor.0 56787 122185 14227 32767 3 0x4000090 fsleep syz-executor.0 61658 50504 81042 32767 3 0x90 nanosleep syz-executor.1 81042 35606 6952 0 3 0x82 wait syz-executor.1 14227 63964 91755 32767 3 0x90 nanosleep syz-executor.0 91755 309467 6952 0 3 0x82 wait syz-executor.0 30719 159304 0 0 3 0x14200 bored sosplice 6952 231006 30819 0 3 0x82 thrsleep syz-fuzzer 6952 29068 30819 0 3 0x4000082 thrsleep syz-fuzzer 6952 488328 30819 0 3 0x4000082 thrsleep syz-fuzzer 6952 302110 30819 0 3 0x4000082 thrsleep syz-fuzzer 6952 481297 30819 0 3 0x4000082 kqread syz-fuzzer 6952 415625 30819 0 3 0x4000082 thrsleep syz-fuzzer 6952 43517 30819 0 3 0x4000082 thrsleep syz-fuzzer 6952 347996 30819 0 3 0x4000082 thrsleep syz-fuzzer 6952 412597 30819 0 3 0x4000082 thrsleep syz-fuzzer 6952 337439 30819 0 3 0x4000082 thrsleep syz-fuzzer 30819 228289 43736 0 3 0x10008a pause ksh 43736 351056 29079 0 3 0x92 select sshd 79558 330641 1 0 3 0x100083 ttyin getty 29079 394715 1 0 3 0x80 select sshd 66897 6711 61837 73 3 0x100090 kqread syslogd 61837 518314 1 0 3 0x100082 netio syslogd 45783 290441 1 77 3 0x100090 poll dhclient 90019 169665 1 0 3 0x80 poll dhclient 93636 119206 0 0 3 0x14200 pgzero zerothread 78007 318603 0 0 3 0x14200 aiodoned aiodoned 76254 413927 0 0 3 0x14200 syncer update 33323 496803 0 0 3 0x14200 cleaner cleaner 14635 423142 0 0 3 0x14200 reaper reaper 46507 289769 0 0 3 0x14200 pgdaemon pagedaemon 8535 216671 0 0 3 0x14200 bored crynlk 3043 491561 0 0 3 0x14200 bored crypto 22162 104082 0 0 3 0x40014200 acpi0 acpi0 83794 465771 0 0 3 0x40014200 idle1 35322 21057 0 0 3 0x14200 bored softnet 27113 364160 0 0 3 0x14200 bored systqmp 44192 323116 0 0 3 0x14200 bored systq 64638 374705 0 0 3 0x40014200 bored softclock 25179 482310 0 0 3 0x40014200 idle0 82044 121030 0 0 3 0x14200 bored smr 1 164794 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 86843 (syz-executor.1) thread 0xffff800020b75788 (67480) exclusive rrwlock inode r = 0 (0xfffffd8071dcbb38) #0 witness_lock+0x52e sys/kern/subr_witness.c:1161 #1 rw_enter+0x414 sys/kern/kern_rwlock.c:278 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:407 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_write+0x169 vn_lock sys/kern/vfs_vnops.c:549 [inline] #4 vn_write+0x169 sys/kern/vfs_vnops.c:393 #5 dofilewritev+0x1a9 sys/kern/sys_generic.c:364 #6 sys_write+0x83 sys/kern/sys_generic.c:284 #7 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #7 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #8 Xsyscall+0x128 Process 56787 (syz-executor.0) thread 0xffff800020b74978 (374977) exclusive rwlock fdlock r = 0 (0xfffffd8072047438) #0 witness_lock+0x52e sys/kern/subr_witness.c:1161 #1 dodup3+0x1c4 sys/kern/kern_descrip.c:362 #2 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #2 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #3 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9460 6321K 6321K 78643K 10657 0 0 pcb 25 9K 11K 78643K 783 0 0 rtable 105 3K 3K 78643K 1191 0 0 ifaddr 35 10K 10K 78643K 170 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 46 0 0 iov 0 0K 24K 78643K 156 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1201 75K 75K 78643K 1827 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 5K 78643K 25 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 171 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 8 25K 33K 78643K 1322 0 0 sigio 0 0K 0K 78643K 25 0 0 proc 41 38K 58K 78643K 1327 0 0 subproc 68 69634K 69634K 78643K 816 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 0K 78643K 198 0 0 in_multi 33 2K 2K 78643K 326 0 0 ether_multi 1 0K 0K 78643K 9 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 60 265K 265K 78643K 60 0 0 exec 0 0K 1K 78643K 530 0 0 pagedep 1 8K 8K 78643K 1 0 0 inodedep 1 32K 32K 78643K 1 0 0 newblk 1 0K 0K 78643K 1 0 0 VM swap 7 26K 26K 78643K 7 0 0 UVM amap 86 20K 29K 78643K 5125 0 0 UVM aobj 68 3K 3K 78643K 72 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 0K 78643K 70 0 0 NDP 5 0K 0K 78643K 75 0 0 temp 121 2719K 2786K 78643K 8363 0 0 kqueue 0 0K 0K 78643K 15 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 50 0 44 1 0 1 1 0 8 0 inpcbpl 280 762 0 755 1 0 1 1 0 8 0 plimitpl 152 134 0 125 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 287 0 243 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 10 0 10 1 1 0 1 0 8 0 tcpcb 544 300 0 296 1 0 1 1 0 8 0 nd6 48 72 0 66 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1172 0 981 12 0 12 12 0 8 0 art_table 32 1173 0 981 2 0 2 2 0 8 0 art_node 16 286 0 246 1 0 1 1 0 8 0 sysvmsgpl 40 9 0 9 3 3 0 1 0 8 0 semapl 112 169 0 159 1 0 1 1 0 8 0 shmpl 112 70 0 4 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2845 0 1395 47 0 47 47 0 8 0 ffsino 272 2845 0 1395 97 0 97 97 0 8 0 nchpl 144 4616 0 2987 61 0 61 61 0 8 0 uvmvnodes 72 3262 0 0 60 0 60 60 0 8 0 vnodes 200 3262 0 0 172 0 172 172 0 8 0 namei 1024 16375 0 16375 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 14251 0 14251 16 15 1 6 0 8 1 sigapl 432 1426 0 1410 3 1 2 3 0 8 0 futexpl 56 12858 0 12855 1 0 1 1 0 8 0 knotepl 112 800 0 780 1 0 1 1 0 8 0 kqueuepl 104 332 0 329 1 0 1 1 0 8 0 pipepl 112 1142 0 1123 6 4 2 2 0 8 1 fdescpl 488 1427 0 1410 3 0 3 3 0 8 0 filepl 152 8937 0 8828 9 3 6 7 0 8 1 lockfpl 104 275 0 275 3 2 1 1 0 8 1 lockfspl 32 93 0 93 3 2 1 1 0 8 1 sessionpl 112 39 0 29 1 0 1 1 0 8 0 pgrppl 48 51 0 41 1 0 1 1 0 8 0 ucredpl 96 2326 0 2317 1 0 1 1 0 8 0 zombiepl 144 1410 0 1410 2 1 1 1 0 8 1 processpl 840 1443 0 1410 4 0 4 4 0 8 0 procpl 600 3553 0 3504 4 0 4 4 0 8 0 srpgc 64 132 0 132 5 4 1 1 0 8 1 sosppl 128 35 0 35 5 4 1 1 0 8 1 sockpl 384 1570 0 1551 4 1 3 4 0 8 1 mcl64k 65536 2 0 0 1 0 1 1 0 8 0 mcl16k 16384 3 0 0 1 0 1 1 0 8 0 mcl12k 12288 8 0 0 1 0 1 1 0 8 0 mcl9k 9216 8 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 9 0 0 2 0 2 2 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 118 0 0 14 0 14 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 215 0 0 11 0 11 11 0 8 0 bufpl 256 8441 0 1424 439 0 439 439 0 8 0 anonpl 16 171985 0 164624 93 55 38 47 0 125 6 amapchunkpl 152 11366 0 11270 27 18 9 9 0 158 4 amappl16 192 6184 0 5802 76 55 21 32 0 8 1 amappl15 184 575 0 573 1 0 1 1 0 8 0 amappl14 176 264 0 259 2 1 1 1 0 8 0 amappl13 168 6 0 6 1 1 0 1 0 8 0 amappl12 160 78 0 73 1 0 1 1 0 8 0 amappl11 152 389 0 373 1 0 1 1 0 8 0 amappl10 144 221 0 219 1 0 1 1 0 8 0 amappl9 136 940 0 936 1 0 1 1 0 8 0 amappl8 128 454 0 435 1 0 1 1 0 8 0 amappl7 120 227 0 217 1 0 1 1 0 8 0 amappl6 112 312 0 301 1 0 1 1 0 8 0 amappl5 104 330 0 320 1 0 1 1 0 8 0 amappl4 96 1589 0 1558 2 1 1 2 0 8 0 amappl3 88 236 0 230 1 0 1 1 0 8 0 amappl2 80 9666 0 9601 2 0 2 2 0 8 0 amappl1 72 46309 0 45825 24 14 10 19 0 8 0 amappl 72 4163 0 4122 1 0 1 1 0 75 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma64 64 259 0 259 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 17 0 17 1 1 0 1 0 8 0 aobjpl 64 71 0 4 2 0 2 2 0 8 0 uaddrrnd 24 1427 0 1410 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1427 0 1410 1 0 1 1 0 8 0 vmmpekpl 168 15585 0 15562 2 0 2 2 0 8 0 vmmpepl 168 165348 0 163793 107 34 73 78 0 357 5 vmsppl 360 1426 0 1410 2 0 2 2 0 8 0 pdppl 4096 2862 0 2820 6 0 6 6 0 8 0 pvpl 32 481724 0 471048 187 81 106 122 0 265 15 pmappl 232 1426 0 1410 2 1 1 2 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 593 0 3 17 0 17 17 0 8 0