witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd80698e0f80) #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 spec_open+0x431 sys/kern/spec_vnops.c:159 #6 VOP_OPEN+0x6a sys/kern/vfs_vops.c:153 #7 vn_open+0x495 sys/kern/vfs_vnops.c:174 #8 sys_ktrace+0x86 sys/kern/kern_ktrace.c:517 #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 panic: witness_warn Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *308832 8401 0 0x1010 0x4080000 0 syz-executor.1 431016 60524 73 0x100010 0 1K 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,ffffffff8220d283) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff8220d283) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020ab0ee8) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800020d47b90) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800020d47b90) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,d,ffffffffffffff82,0,4,e85716ff010) at Xsyscall+0x128 end of kernel end trace frame: 0xe880fdf4300, 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,ffffffff8220d283) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff8220d283) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020ab0ee8) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800020d47b90) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800020d47b90) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,d,ffffffffffffff82,0,4,e85716ff010) at Xsyscall+0x128 end of kernel end trace frame: 0xe880fdf4300, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020d478d0 rbx 0xffff800020d47980 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff80002196e000 rax 0xffff800000a87f80 r8 0xffffffff812e94e3 kprintf+0x173 r9 0x1 r10 0x25 r11 0x9c68d19c95052509 r12 0x3000000008 r13 0xffff800020d478e0 r14 0x100 r15 0x1 rip 0xffffffff81d56a38 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020d478c0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=308832 stat=onproc flags process=1010 proc=4080000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab0780,0xffff800020ac13e0 process=0xffff800020adc000 user=0xffff800020d42000, vmspace=0xfffffd807f00b5c0 estcpu=36, cpticks=5, pctcpu=0.0 user=0, sys=5, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 8401 477035 35242 0 3 0x3010 suspend syz-executor.1 * 8401 308832 35242 0 7 0x4081010 syz-executor.1 8401 259244 35242 0 2 0x4081010 syz-executor.1 8401 168993 35242 0 2 0x4081010 syz-executor.1 35242 370553 4554 0 3 0x82 nanosleep syz-executor.1 18881 290174 4554 0 3 0x82 piperd syz-executor.0 72837 304610 0 0 3 0x14200 acct acct 15172 189639 1 0 3 0x100083 ttyin getty 64443 218573 0 0 3 0x14200 bored sosplice 4554 302107 77112 0 3 0x82 thrsleep syz-fuzzer 4554 370629 77112 0 3 0x4000082 thrsleep syz-fuzzer 4554 347326 77112 0 3 0x4000082 thrsleep syz-fuzzer 4554 358515 77112 0 3 0x4000082 thrsleep syz-fuzzer 4554 216821 77112 0 3 0x4000082 thrsleep syz-fuzzer 4554 446972 77112 0 3 0x4000082 thrsleep syz-fuzzer 4554 177206 77112 0 3 0x4000082 thrsleep syz-fuzzer 4554 500187 77112 0 3 0x4000082 thrsleep syz-fuzzer 4554 270604 77112 0 3 0x4000082 kqread syz-fuzzer 4554 37674 77112 0 3 0x4000082 thrsleep syz-fuzzer 77112 258581 73446 0 3 0x10008a pause ksh 73446 298666 20296 0 3 0x92 select sshd 20296 410294 1 0 3 0x80 select sshd 46642 483482 44248 74 2 0x100492 pflogd 44248 461242 1 0 3 0x80 netio pflogd 60524 431016 58691 73 7 0x100010 syslogd 58691 245144 1 0 3 0x100082 netio syslogd 90519 371138 1 77 3 0x100090 poll dhclient 21463 343384 1 0 3 0x80 poll dhclient 6195 241236 0 0 3 0x14200 pgzero zerothread 24638 301811 0 0 3 0x14200 aiodoned aiodoned 68505 2474 0 0 3 0x14200 syncer update 70245 481057 0 0 3 0x14200 cleaner cleaner 52671 65085 0 0 3 0x14200 reaper reaper 55509 315955 0 0 3 0x14200 pgdaemon pagedaemon 61601 455029 0 0 3 0x14200 bored crynlk 88415 251740 0 0 3 0x14200 bored crypto 9163 376581 0 0 3 0x40014200 acpi0 acpi0 15252 39263 0 0 3 0x40014200 idle1 95678 19373 0 0 3 0x14200 bored softnet 95513 516682 0 0 3 0x14200 bored systqmp 56666 387739 0 0 3 0x14200 bored systq 69684 517634 0 0 2 0x40014200 softclock 89346 36085 0 0 3 0x40014200 idle0 99065 413099 0 0 2 0x40014200 smr 1 389811 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 8401 (syz-executor.1) thread 0xffff800020ab0ee8 (308832) exclusive rrwlock inode r = 0 (0xfffffd80698e0f80) #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 spec_open+0x431 sys/kern/spec_vnops.c:159 #6 VOP_OPEN+0x6a sys/kern/vfs_vops.c:153 #7 vn_open+0x495 sys/kern/vfs_vnops.c:174 #8 sys_ktrace+0x86 sys/kern/kern_ktrace.c:517 #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 Process 60524 (syslogd) thread 0xffff800020ac0778 (431016) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8265f5f8) #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 biowait+0xa1 sys/kern/vfs_bio.c:1231 #6 bwrite+0x1e1 sys/kern/vfs_bio.c:747 #7 ffs_update+0x2c2 sys/ufs/ffs/ffs_inode.c:113 #8 VOP_FSYNC+0xc7 sys/kern/vfs_vops.c:352 #9 sys_fsync+0x128 sys/kern/vfs_syscalls.c:2806 #10 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #10 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #11 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806eb49d58) #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 9561 6584K 7101K 78643K 15573 0 0 pcb 13 8K 8K 78643K 203 0 0 rtable 111 4K 5K 78643K 782 0 0 ifaddr 68 15K 17K 78643K 277 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1573 0 0 iov 0 0K 16K 78643K 169 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1216 76K 77K 78643K 3364 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 15 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 235 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 1969 0 0 sigio 0 0K 0K 78643K 44 0 0 proc 54 51K 83K 78643K 810 0 0 subproc 32 2K 2K 78643K 119 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 124 0 0 in_multi 33 2K 2K 78643K 127 0 0 ether_multi 1 0K 0K 78643K 5 0 0 mrt 1 0K 0K 78643K 6 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 415 0 0 pfkey data 0 0K 0K 78643K 2 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 107 22K 30K 78643K 7257 0 0 UVM aobj 75 5K 5K 78643K 87 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 184 0 0 NDP 17 0K 0K 78643K 82 0 0 temp 192 3552K 3627K 78643K 16440 0 0 kqueue 0 0K 0K 78643K 6 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 16 0 10 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 87 0 85 1 0 1 1 0 8 0 rtentry 112 105 0 61 2 0 2 2 0 8 0 unpcb 120 642 0 632 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 6735 0 6735 1 1 0 1 0 8 0 tcpcb 544 346 0 342 1 0 1 1 0 8 0 inpcb 280 1053 0 1046 1 0 1 1 0 8 0 ip6q 72 1 0 1 1 1 0 1 0 8 0 nd6 48 21 0 15 1 0 1 1 0 8 0 pkpcb 40 13 0 13 3 3 0 1 0 8 0 ppxss 1128 35 0 35 6 5 1 1 0 8 1 pffrag 232 5 0 5 3 3 0 1 0 482 0 pffrnode 88 5 0 5 3 3 0 1 0 8 0 pffrent 40 13 0 13 3 3 0 1 0 8 0 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 58 0 33 1 0 1 1 0 8 0 pfstkey 112 58 0 33 1 0 1 1 0 8 0 pfstate 328 58 0 33 3 0 3 3 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 422 0 229 13 0 13 13 0 8 0 art_table 32 423 0 229 2 0 2 2 0 8 0 art_node 16 99 0 59 1 0 1 1 0 8 0 sysvmsgpl 40 16 0 8 1 0 1 1 0 8 0 semapl 112 233 0 223 1 0 1 1 0 8 0 shmpl 112 85 0 12 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 4948 0 3524 47 0 47 47 0 8 0 ffsino 272 4948 0 3524 96 0 96 96 0 8 0 nchpl 144 7863 0 6236 62 0 62 62 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 25260 0 25260 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 4 0 4 2 2 0 1 0 8 0 scxspl 192 19919 0 19918 17 13 4 7 0 8 3 plimitpl 152 169 0 161 1 0 1 1 0 8 0 sigapl 432 2155 0 2140 3 1 2 3 0 8 0 futexpl 56 25072 0 25072 1 0 1 1 0 8 1 knotepl 112 455 0 436 1 0 1 1 0 8 0 kqueuepl 104 366 0 364 1 0 1 1 0 8 0 pipepl 112 1164 0 1145 3 1 2 2 0 8 1 fdescpl 488 2156 0 2140 3 0 3 3 0 8 0 filepl 152 13544 0 13440 10 3 7 7 0 8 2 lockfpl 104 596 0 596 2 1 1 1 0 8 1 lockfspl 48 188 0 188 2 1 1 1 0 8 1 sessionpl 112 24 0 13 1 0 1 1 0 8 0 pgrppl 48 37 0 26 1 0 1 1 0 8 0 ucredpl 96 3468 0 3457 1 0 1 1 0 8 0 zombiepl 144 2141 0 2140 2 1 1 1 0 8 0 processpl 896 2173 0 2140 4 0 4 4 0 8 0 procpl 632 6229 0 6184 7 2 5 5 0 8 1 srpgc 64 10 0 10 5 4 1 1 0 8 1 sosppl 128 16 0 16 5 4 1 1 0 8 1 sockpl 384 1819 0 1800 7 3 4 4 0 8 2 mcl64k 65536 14 0 0 2 0 2 2 0 8 0 mcl16k 16384 5 0 0 1 0 1 1 0 8 0 mcl12k 12288 14 0 0 2 0 2 2 0 8 0 mcl9k 9216 13 0 0 1 0 1 1 0 8 0 mcl8k 8192 9 0 0 2 0 2 2 0 8 0 mcl4k 4096 11 0 0 2 0 2 2 0 8 0 mcl2k2 2112 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 159 0 0 19 0 19 19 0 8 0 mtagpl 80 27 0 0 1 0 1 1 0 8 0 mbufpl 256 493 0 0 30 0 30 30 0 8 0 bufpl 256 9059 0 2040 439 0 439 439 0 8 0 anonpl 16 189099 0 179158 78 25 53 67 0 124 0 amapchunkpl 152 12228 0 12118 17 11 6 10 0 158 1 amappl16 192 9768 0 9065 61 24 37 48 0 8 1 amappl15 184 8 0 8 1 0 1 1 0 8 1 amappl14 176 81 0 75 1 0 1 1 0 8 0 amappl13 168 25 0 22 3 2 1 1 0 8 0 amappl12 160 341 0 340 2 1 1 1 0 8 0 amappl11 152 421 0 406 1 0 1 1 0 8 0 amappl10 144 501 0 496 1 0 1 1 0 8 0 amappl9 136 1305 0 1300 1 0 1 1 0 8 0 amappl8 128 848 0 822 1 0 1 1 0 8 0 amappl7 120 476 0 470 1 0 1 1 0 8 0 amappl6 112 414 0 403 1 0 1 1 0 8 0 amappl5 104 513 0 499 1 0 1 1 0 8 0 amappl4 96 2107 0 2077 2 1 1 2 0 8 0 amappl3 88 589 0 577 1 0 1 1 0 8 0 amappl2 80 16070 0 15999 3 1 2 3 0 8 0 amappl1 72 56936 0 56485 27 17 10 20 0 8 0 amappl 80 6564 0 6525 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 86 0 12 2 0 2 2 0 8 0 uaddrrnd 24 2156 0 2140 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2156 0 2140 1 0 1 1 0 8 0 vmmpekpl 168 18941 0 18901 2 0 2 2 0 8 0 vmmpepl 168 267030 0 265182 184 78 106 106 0 357 20 vmsppl 368 2155 0 2140 2 0 2 2 0 8 0 pdppl 4096 4319 0 4280 7 1 6 6 0 8 0 pvpl 32 550784 0 537614 201 67 134 166 0 265 2 pmappl 232 2155 0 2140 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 624 0 5 18 0 18 18 0 8 0