witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd8068ef2a28) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x46d sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_write+0x169 vn_lock sys/kern/vfs_vnops.c:561 [inline] #4 vn_write+0x169 sys/kern/vfs_vnops.c:401 #5 dofilewritev+0x1ac 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:92 [inline] #7 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #8 Xsyscall+0x128 panic: witness_warn Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *519764 72763 32767 0x10 0x4000000 0 syz-executor.1 364373 41109 73 0x100010 0 1 syslogd db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 witness_warn(2,0,ffffffff822095c0) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff822095c0) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020a89650) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024dc5240) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024dc5240) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,f0ef90d8010) at Xsyscall+0x128 end of kernel end trace frame: 0xf1122bf5bf0, count: 9 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 witness_warn 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:207 witness_warn(2,0,ffffffff822095c0) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff822095c0) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020a89650) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024dc5240) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024dc5240) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,f0ef90d8010) at Xsyscall+0x128 end of kernel end trace frame: 0xf1122bf5bf0, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800024dc4f80 rbx 0xffff800024dc5030 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800022d6c000 rax 0xffff800000a70540 r8 0xffffffff82080113 kprintf+0x173 r9 0x1 r10 0x25 r11 0x59de57d15e674def r12 0x3000000008 r13 0xffff800024dc4f90 r14 0x100 r15 0x1 rip 0xffffffff81ad8718 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024dc4f70 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=519764 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020a88ee8,0xffff800020a893e8 process=0xffff800020a8bc10 user=0xffff800024dc0000, vmspace=0xfffffd806e8aee68 estcpu=36, cpticks=6, pctcpu=0.0 user=0, sys=5, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 72763 518692 4201 32767 2 0x10 syz-executor.1 *72763 519764 4201 32767 7 0x4000010 syz-executor.1 72763 49843 4201 32767 2 0x4000010 syz-executor.1 72763 94336 4201 32767 3 0x4000010 inode syz-executor.1 72763 86418 4201 32767 3 0x4000090 fsleep syz-executor.1 27370 494010 88351 32767 3 0x90 piperd syz-executor.0 88351 489835 81395 0 3 0x82 wait syz-executor.0 4201 414735 46668 32767 2 0x490 syz-executor.1 46668 467617 81395 0 3 0x82 wait syz-executor.1 26591 507462 0 0 3 0x14200 bored sosplice 81395 235886 46904 0 3 0x82 thrsleep syz-fuzzer 81395 245059 46904 0 3 0x4000082 thrsleep syz-fuzzer 81395 209800 46904 0 3 0x4000082 thrsleep syz-fuzzer 81395 452792 46904 0 2 0x4000082 syz-fuzzer 81395 61379 46904 0 3 0x4000082 thrsleep syz-fuzzer 81395 178268 46904 0 3 0x4000082 thrsleep syz-fuzzer 81395 421237 46904 0 3 0x4000082 thrsleep syz-fuzzer 81395 316798 46904 0 3 0x4000082 thrsleep syz-fuzzer 81395 397471 46904 0 3 0x4000082 thrsleep syz-fuzzer 81395 372830 46904 0 3 0x4000082 thrsleep syz-fuzzer 46904 482837 92317 0 3 0x10008a pause ksh 92317 136493 61914 0 3 0x92 select sshd 53235 142559 1 0 3 0x100083 ttyin getty 61914 32869 1 0 3 0x80 select sshd 41109 364373 73128 73 7 0x100010 syslogd 73128 463635 1 0 3 0x100082 netio syslogd 62905 213245 1 77 3 0x100090 poll dhclient 34683 420428 1 0 3 0x80 poll dhclient 89751 281391 0 0 2 0x14200 zerothread 23336 273912 0 0 3 0x14200 aiodoned aiodoned 44631 462217 0 0 3 0x14200 syncer update 35933 185847 0 0 3 0x14200 cleaner cleaner 73980 60940 0 0 3 0x14200 reaper reaper 45813 287715 0 0 3 0x14200 pgdaemon pagedaemon 81759 226800 0 0 3 0x14200 bored crynlk 36304 75156 0 0 3 0x14200 bored crypto 40289 54002 0 0 3 0x40014200 acpi0 acpi0 41189 306793 0 0 3 0x40014200 idle1 12113 477250 0 0 3 0x14200 bored softnet 50939 101687 0 0 3 0x14200 bored systqmp 35773 468914 0 0 3 0x14200 bored systq 24856 396898 0 0 3 0x40014200 bored softclock 10222 412051 0 0 3 0x40014200 idle0 74185 163919 0 0 3 0x14200 bored smr 1 405338 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 72763 (syz-executor.1) thread 0xffff800020a89650 (519764) exclusive rrwlock inode r = 0 (0xfffffd8068ef2a28) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x46d sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_write+0x169 vn_lock sys/kern/vfs_vnops.c:561 [inline] #4 vn_write+0x169 sys/kern/vfs_vnops.c:401 #5 dofilewritev+0x1ac 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:92 [inline] #7 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #8 Xsyscall+0x128 Process 41109 (syslogd) thread 0xffff800020ac0c68 (364373) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8265bca8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 __mp_acquire_count+0x51 sys/kern/kern_lock.c:227 #2 mi_switch+0x38f sys/kern/sched_bsd.c:441 #3 sleep_finish+0x113 sys/kern/kern_synch.c:373 #4 tsleep+0x198 sleep_finish_timeout sys/kern/kern_synch.c:397 [inline] #4 tsleep+0x198 sleep_finish_all sys/kern/kern_synch.c:183 [inline] #4 tsleep+0x198 sys/kern/kern_synch.c:152 #5 vwaitforio+0x9d sys/kern/vfs_subr.c:1869 #6 ffs_fsync+0x3c5 sys/ufs/ffs/ffs_vnops.c:495 #7 VOP_FSYNC+0xc7 sys/kern/vfs_vops.c:352 #8 sys_fsync+0x128 sys/kern/vfs_syscalls.c:2806 #9 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #9 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #10 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806eb36098) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x46d sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:561 #5 sys_fsync+0x114 sys/kern/vfs_syscalls.c:2806 #6 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #6 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #7 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9463 6322K 6322K 78643K 11600 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 105 3K 3K 78643K 9597 0 0 ifaddr 37 14K 15K 78643K 1325 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 435 0 0 iov 0 0K 24K 78643K 796 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 76K 78643K 6337 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 138 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 1276 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 7 21K 33K 78643K 10994 0 0 sigio 0 0K 0K 78643K 111 0 0 proc 41 38K 70K 78643K 9906 0 0 subproc 34 2K 2K 78643K 3604 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 1252 0 0 in_multi 33 2K 2K 78643K 2612 0 0 ether_multi 1 0K 0K 78643K 51 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 66 291K 291K 78643K 66 0 0 exec 0 0K 1K 78643K 3536 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 93 21K 31K 78643K 36916 0 0 UVM aobj 130 5K 5K 78643K 158 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 647 0 0 NDP 5 0K 0K 78643K 639 0 0 temp 121 3554K 3629K 78643K 50268 0 0 kqueue 0 0K 0K 78643K 137 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 430 0 424 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 853 0 851 1 0 1 1 0 8 0 rtentry 112 2359 0 2315 2 0 2 2 0 8 0 unpcb 120 4432 0 4424 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 2961 0 2961 1 1 0 1 0 8 0 tcpcb 544 2337 0 2333 1 0 1 1 0 8 0 ipq 40 11 0 11 7 7 0 1 0 8 0 ipqe 40 30 0 30 7 7 0 1 0 8 0 inpcb 280 5977 0 5966 16 14 2 2 0 8 1 nd6 48 636 0 630 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 9668 0 9477 24 12 12 13 0 8 0 art_table 32 9669 0 9477 2 0 2 2 0 8 0 art_node 16 2358 0 2318 1 0 1 1 0 8 0 sysvmsgpl 40 15 0 9 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 1272 0 1262 1 0 1 1 0 8 0 shmpl 112 156 0 28 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 12303 0 10862 48 1 47 47 0 8 0 ffsino 272 12303 0 10862 97 0 97 97 0 8 0 nchpl 144 25096 0 23468 61 0 61 61 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 200 5926 0 0 312 0 312 312 0 8 0 namei 1024 106712 0 106712 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 68928 0 68928 50 48 2 7 0 8 2 plimitpl 152 1709 0 1700 1 0 1 1 0 8 0 sigapl 432 10535 0 10520 14 12 2 3 0 8 0 futexpl 56 100158 0 100157 2 1 1 1 0 8 0 knotepl 112 6488 0 6469 1 0 1 1 0 8 0 kqueuepl 104 2513 0 2511 1 0 1 1 0 8 0 pipepl 112 6890 0 6871 16 15 1 2 0 8 0 fdescpl 488 10536 0 10520 3 0 3 3 0 8 0 filepl 152 64253 0 64150 27 22 5 7 0 8 0 lockfpl 104 2127 0 2127 12 11 1 1 0 8 1 lockfspl 48 638 0 638 12 11 1 1 0 8 1 sessionpl 112 227 0 217 1 0 1 1 0 8 0 pgrppl 48 349 0 339 1 0 1 1 0 8 0 ucredpl 96 17650 0 17641 1 0 1 1 0 8 0 zombiepl 144 10520 0 10520 1 0 1 1 0 8 1 processpl 896 10552 0 10520 4 0 4 4 0 8 0 procpl 632 27394 0 27349 30 25 5 5 0 8 1 srpgc 64 420 0 420 31 30 1 1 0 8 1 sosppl 128 235 0 235 41 40 1 1 0 8 1 sockpl 384 11479 0 11462 13 10 3 4 0 8 1 mcl64k 65536 24 0 0 3 1 2 3 0 8 0 mcl16k 16384 14 0 0 2 0 2 2 0 8 0 mcl12k 12288 33 0 0 2 0 2 2 0 8 0 mcl9k 9216 33 0 0 2 0 2 2 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 13 0 0 2 0 2 2 0 8 0 mcl2k2 2112 7 0 0 1 0 1 1 0 8 0 mcl2k 2048 134 0 0 14 0 14 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 751 0 0 14 0 14 14 0 8 0 bufpl 256 20135 0 13121 439 0 439 439 0 8 0 anonpl 16 1165216 0 1157953 252 214 38 47 0 124 0 amapchunkpl 152 83893 0 83801 133 128 5 18 0 158 1 amappl16 192 47592 0 47191 321 295 26 33 0 8 4 amappl15 184 1434 0 1433 24 23 1 1 0 8 0 amappl14 176 2991 0 2980 1 0 1 1 0 8 0 amappl13 168 2007 0 2007 18 17 1 1 0 8 1 amappl12 160 1278 0 1274 1 0 1 1 0 8 0 amappl11 152 1710 0 1699 1 0 1 1 0 8 0 amappl10 144 1212 0 1210 1 0 1 1 0 8 0 amappl9 136 4517 0 4511 1 0 1 1 0 8 0 amappl8 128 3372 0 3345 2 0 2 2 0 8 1 amappl7 120 1597 0 1588 1 0 1 1 0 8 0 amappl6 112 1149 0 1141 1 0 1 1 0 8 0 amappl5 104 2718 0 2707 1 0 1 1 0 8 0 amappl4 96 10047 0 10016 2 1 1 2 0 8 0 amappl3 88 2801 0 2789 1 0 1 1 0 8 0 amappl2 80 68596 0 68528 3 1 2 3 0 8 0 amappl1 72 292348 0 291897 23 13 10 19 0 8 0 amappl 80 30936 0 30898 1 0 1 1 0 84 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 157 0 28 3 0 3 3 0 8 0 uaddrrnd 24 10536 0 10520 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 10536 0 10520 1 0 1 1 0 8 0 vmmpekpl 168 90186 0 90156 2 0 2 2 0 8 0 vmmpepl 168 1353098 0 1351481 322 236 86 95 0 357 14 vmsppl 368 10535 0 10520 2 0 2 2 0 8 0 pdppl 4096 21079 0 21040 6 0 6 6 0 8 1 pvpl 32 3119818 0 3109212 518 413 105 129 0 265 5 pmappl 232 10535 0 10520 25 24 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 614 0 15 18 0 18 18 0 8 0