witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd807e3a12c8) #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 panic: witness_warn Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *426357 19150 0 0x1000 0x4080000 1 syz-executor.1 486010 84674 73 0x100010 0 0 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,ffffffff8220cc71) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff8220cc71) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020abec70) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800020b4f0c0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800020b4f0c0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,0,fffffffffffffee5,0,1,a0a35f190e0) at Xsyscall+0x128 end of kernel end trace frame: 0xa0d0fd4de70, 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic witness_warn ddb{1}> 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,ffffffff8220cc71) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff8220cc71) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020abec70) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800020b4f0c0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800020b4f0c0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,0,fffffffffffffee5,0,1,a0a35f190e0) at Xsyscall+0x128 end of kernel end trace frame: 0xa0d0fd4de70, count: -6 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020b4ee00 rbx 0xffff800020b4eeb0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff80002197c000 rax 0xffff800000a45300 r8 0xffffffff8106c893 kprintf+0x173 r9 0x1 r10 0x25 r11 0x8269b04f3446c09b r12 0x3000000008 r13 0xffff800020b4ee10 r14 0x100 r15 0x1 rip 0xffffffff81be9be8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020b4edf0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=426357 stat=onproc flags process=1000 proc=4080000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020abe9f8,0xffff800020ac0a00 process=0xffff800020a8b510 user=0xffff800020b4a000, vmspace=0xfffffd807f00cb80 estcpu=36, cpticks=3, pctcpu=0.0 user=0, sys=3, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 5905 463082 44163 0 3 0x80 fsleep syz-executor.0 5905 461174 44163 0 3 0x4000080 ttyin syz-executor.0 19150 162436 72645 0 3 0x3000 suspend syz-executor.1 *19150 426357 72645 0 7 0x4081000 syz-executor.1 44163 515106 28578 0 3 0x82 nanosleep syz-executor.0 15668 512550 1 0 3 0x100083 ttyin getty 45288 403345 0 0 3 0x14200 bored sosplice 72645 518522 28578 0 3 0x82 nanosleep syz-executor.1 28578 53454 13341 0 3 0x82 thrsleep syz-fuzzer 28578 460600 13341 0 3 0x4000082 thrsleep syz-fuzzer 28578 36378 13341 0 3 0x4000082 thrsleep syz-fuzzer 28578 20911 13341 0 3 0x4000082 thrsleep syz-fuzzer 28578 521053 13341 0 3 0x4000082 thrsleep syz-fuzzer 28578 321544 13341 0 3 0x4000082 thrsleep syz-fuzzer 28578 398380 13341 0 3 0x4000082 thrsleep syz-fuzzer 28578 395877 13341 0 3 0x4000082 kqread syz-fuzzer 28578 246010 13341 0 3 0x4000082 thrsleep syz-fuzzer 28578 25638 13341 0 3 0x4000082 thrsleep syz-fuzzer 13341 273518 46703 0 3 0x10008a pause ksh 46703 136168 92873 0 3 0x92 select sshd 92873 176542 1 0 3 0x80 select sshd 13107 522899 76315 74 3 0x100092 bpf pflogd 76315 356093 1 0 3 0x80 netio pflogd 84674 486010 47532 73 7 0x100010 syslogd 47532 299578 1 0 3 0x100082 netio syslogd 10241 220141 1 77 3 0x100090 poll dhclient 57046 421747 1 0 3 0x80 poll dhclient 17977 52915 0 0 2 0x14200 zerothread 46033 494258 0 0 3 0x14200 aiodoned aiodoned 68177 137289 0 0 3 0x14200 syncer update 24703 501363 0 0 3 0x14200 cleaner cleaner 52423 8481 0 0 3 0x14200 reaper reaper 83423 13767 0 0 3 0x14200 pgdaemon pagedaemon 28686 62556 0 0 3 0x14200 bored crynlk 88558 153961 0 0 3 0x14200 bored crypto 5106 485881 0 0 3 0x40014200 acpi0 acpi0 83951 392093 0 0 3 0x40014200 idle1 94111 401830 0 0 3 0x14200 bored softnet 5977 29607 0 0 3 0x14200 bored systqmp 42829 146235 0 0 3 0x14200 bored systq 3116 501303 0 0 3 0x40014200 bored softclock 83264 107369 0 0 3 0x40014200 idle0 3773 317268 0 0 2 0x40014200 smr 1 490028 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 19150 (syz-executor.1) thread 0xffff800020abec70 (426357) exclusive rrwlock inode r = 0 (0xfffffd807e3a12c8) #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 Process 84674 (syslogd) thread 0xffff800020ac0288 (486010) exclusive rrwlock inode r = 0 (0xfffffd806ec01b38) #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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9526 6544K 6906K 78643K 11639 0 0 pcb 13 8K 8K 78643K 83 0 0 rtable 108 4K 4K 78643K 339 0 0 ifaddr 55 12K 13K 78643K 102 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1474 0 0 iov 0 0K 16K 78643K 36 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1211 76K 77K 78643K 1578 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 3 5K 5K 78643K 10 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 44 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 456 0 0 sigio 0 0K 0K 78643K 10 0 0 proc 54 51K 83K 78643K 495 0 0 subproc 32 2K 2K 78643K 51 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 45 0 0 in_multi 33 2K 2K 78643K 56 0 0 ether_multi 1 0K 0K 78643K 6 0 0 mrt 0 0K 0K 78643K 5 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 72 318K 318K 78643K 72 0 0 exec 0 0K 1K 78643K 241 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 103 21K 22K 78643K 2377 0 0 UVM aobj 21 2K 3K 78643K 25 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 66 0 0 NDP 11 0K 0K 78643K 29 0 0 temp 144 3546K 3611K 78643K 8272 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 8 0 2 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 32 0 30 1 0 1 1 0 8 0 rtentry 112 57 0 13 2 0 2 2 0 8 0 unpcb 120 125 0 113 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 9473 0 9473 2 2 0 2 0 8 0 tcpcb 544 91 0 87 1 0 1 1 0 8 0 inpcb 280 283 0 276 1 0 1 1 0 8 0 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 9 0 3 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 0 1 1 0 8 1 ppxss 1128 9 0 9 2 1 1 1 0 8 1 pfosfp 40 846 0 423 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 26 0 4 1 0 1 1 0 8 0 pfstkey 112 26 0 4 1 0 1 1 0 8 0 pfstate 328 26 0 4 2 0 2 2 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 235 0 44 12 0 12 12 0 8 0 art_table 32 236 0 44 2 0 2 2 0 8 0 art_node 16 56 0 16 1 0 1 1 0 8 0 sysvmsgpl 40 10 0 0 1 0 1 1 0 8 0 semapl 112 41 0 31 1 0 1 1 0 8 0 shmpl 112 23 0 4 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2068 0 644 47 0 47 47 0 8 0 ffsino 272 2068 0 644 96 0 96 96 0 8 0 nchpl 144 2877 0 1241 62 0 62 62 0 8 0 uvmvnodes 72 2367 0 0 44 0 44 44 0 8 0 vnodes 200 2367 0 0 125 0 125 125 0 8 0 namei 1024 8364 0 8364 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 7768 0 7768 11 9 2 7 0 8 2 plimitpl 152 66 0 57 1 0 1 1 0 8 0 sigapl 432 654 0 638 3 1 2 3 0 8 0 futexpl 56 5212 0 5211 1 0 1 1 0 8 0 knotepl 112 119 0 100 1 0 1 1 0 8 0 kqueuepl 104 88 0 86 1 0 1 1 0 8 0 pipepl 112 406 0 387 1 0 1 1 0 8 0 fdescpl 488 655 0 638 3 0 3 3 0 8 0 filepl 152 3559 0 3442 6 1 5 5 0 8 0 lockfpl 104 93 0 91 2 1 1 1 0 8 0 lockfspl 48 32 0 31 2 1 1 1 0 8 0 sessionpl 112 20 0 9 1 0 1 1 0 8 0 pgrppl 48 20 0 9 1 0 1 1 0 8 0 ucredpl 96 562 0 553 1 0 1 1 0 8 0 zombiepl 144 639 0 638 2 1 1 1 0 8 0 processpl 896 671 0 638 4 0 4 4 0 8 0 procpl 632 1574 0 1530 5 0 5 5 0 8 1 srpgc 64 3 0 3 2 1 1 1 0 8 1 sosppl 128 6 0 6 2 1 1 1 0 8 1 sockpl 384 450 0 429 4 1 3 3 0 8 0 mcl64k 65536 5 0 0 1 0 1 1 0 8 0 mcl12k 12288 4 0 0 1 0 1 1 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 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 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 251 0 0 29 0 29 29 0 8 0 mtagpl 80 10 0 0 1 0 1 1 0 8 0 mbufpl 256 272 0 0 17 1 16 16 0 8 0 bufpl 256 6509 0 1166 334 0 334 334 0 8 0 anonpl 16 67726 0 55969 59 7 52 55 0 124 0 amapchunkpl 152 3487 0 3372 12 6 6 10 0 158 1 amappl16 192 2639 0 1944 40 2 38 38 0 8 3 amappl15 184 8 0 7 1 0 1 1 0 8 0 amappl14 176 70 0 63 1 0 1 1 0 8 0 amappl13 168 15 0 14 2 1 1 1 0 8 0 amappl12 160 13 0 8 2 1 1 1 0 8 0 amappl11 152 61 0 46 1 0 1 1 0 8 0 amappl10 144 276 0 271 1 0 1 1 0 8 0 amappl9 136 821 0 814 1 0 1 1 0 8 0 amappl8 128 365 0 343 1 0 1 1 0 8 0 amappl7 120 241 0 235 1 0 1 1 0 8 0 amappl6 112 59 0 53 1 0 1 1 0 8 0 amappl5 104 141 0 126 1 0 1 1 0 8 0 amappl4 96 918 0 887 1 0 1 1 0 8 0 amappl3 88 192 0 182 1 0 1 1 0 8 0 amappl2 80 4272 0 4190 3 1 2 3 0 8 0 amappl1 72 23952 0 23484 25 15 10 19 0 8 0 amappl 80 1835 0 1793 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 24 0 4 1 0 1 1 0 8 0 uaddrrnd 24 655 0 638 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 655 0 638 1 0 1 1 0 8 0 vmmpekpl 168 9372 0 9341 2 0 2 2 0 8 0 vmmpepl 168 85328 0 83379 140 36 104 104 0 357 19 vmsppl 368 654 0 638 2 0 2 2 0 8 0 pdppl 4096 1317 0 1276 7 1 6 6 0 8 0 pvpl 32 216502 0 201496 163 27 136 141 0 265 6 pmappl 232 654 0 638 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 511 0 6 15 0 15 15 0 8 0