witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd807d27e3c8) #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 14383 70461 32767 0x10 0x4000080 1 syz-executor.0 *180188 70461 32767 0x10 0x4000000 0 syz-executor.0 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,ffffffff81fbd0c6) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbd0c6) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b51650) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024feb620) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024feb620) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,be26c8de1b0) at Xsyscall+0x128 end of kernel end trace frame: 0xbe4c7142550, 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,ffffffff81fbd0c6) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbd0c6) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b51650) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024feb620) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024feb620) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,be26c8de1b0) at Xsyscall+0x128 end of kernel end trace frame: 0xbe4c7142550, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800024feb360 rbx 0xffff800024feb410 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff8000231d2000 rax 0xffff8000009ac880 r8 0xffffffff81247dd3 kprintf+0x173 r9 0x1 r10 0x25 r11 0xc0ddb0ba52efa12e r12 0x3000000008 r13 0xffff800024feb370 r14 0x100 r15 0x1 rip 0xffffffff8177c6f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024feb350 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=180188 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b51160,0xffffffff82398e88 process=0xffff800020b2aa90 user=0xffff800024fe6000, vmspace=0xfffffd806e8e9cf8 estcpu=36, cpticks=5, pctcpu=0.0 user=0, sys=5, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 70461 226937 85557 32767 2 0x10 syz-executor.0 70461 14383 85557 32767 7 0x4000090 syz-executor.0 70461 263320 85557 32767 2 0x4000010 syz-executor.0 *70461 180188 85557 32767 7 0x4000010 syz-executor.0 85557 157412 93416 32767 2 0x490 syz-executor.0 93416 148940 94526 0 3 0x82 wait syz-executor.0 76843 197604 0 0 3 0x14200 bored sosplice 94526 465013 88667 0 3 0x82 thrsleep syz-fuzzer 94526 477277 88667 0 2 0x4000482 syz-fuzzer 94526 190501 88667 0 3 0x4000082 thrsleep syz-fuzzer 94526 71087 88667 0 3 0x4000082 thrsleep syz-fuzzer 94526 167531 88667 0 2 0x4000082 syz-fuzzer 94526 347182 88667 0 3 0x4000082 thrsleep syz-fuzzer 94526 367912 88667 0 3 0x4000082 thrsleep syz-fuzzer 94526 63139 88667 0 2 0x4000482 syz-fuzzer 94526 489197 88667 0 3 0x4000082 thrsleep syz-fuzzer 94526 166914 88667 0 3 0x4000082 thrsleep syz-fuzzer 88667 158126 38442 0 3 0x10008a pause ksh 38442 63068 45496 0 3 0x92 select sshd 85998 440161 1 0 3 0x100083 ttyin getty 45496 183383 1 0 3 0x80 select sshd 53443 395611 38105 73 2 0x100090 syslogd 38105 76177 1 0 3 0x100082 netio syslogd 54035 191163 1 77 3 0x100090 poll dhclient 5449 272757 1 0 3 0x80 poll dhclient 96640 44463 0 0 3 0x14200 pgzero zerothread 93327 395844 0 0 3 0x14200 aiodoned aiodoned 24269 520356 0 0 3 0x14200 syncer update 23939 62896 0 0 3 0x14200 cleaner cleaner 37495 103435 0 0 3 0x14200 reaper reaper 53785 131722 0 0 3 0x14200 pgdaemon pagedaemon 51030 383240 0 0 3 0x14200 bored crynlk 52956 434041 0 0 3 0x14200 bored crypto 384 423963 0 0 3 0x40014200 acpi0 acpi0 15200 431824 0 0 3 0x40014200 idle1 334 521969 0 0 3 0x14200 bored softnet 3179 386454 0 0 3 0x14200 bored systqmp 10324 46809 0 0 3 0x14200 bored systq 45498 46313 0 0 3 0x40014200 bored softclock 89760 336061 0 0 3 0x40014200 idle0 83591 408253 0 0 3 0x14200 bored smr 1 330973 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 70461 (syz-executor.0) thread 0xffff800020b51650 (180188) exclusive rrwlock inode r = 0 (0xfffffd807d27e3c8) #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 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9459 6319K 6322K 78643K 11796 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 83 2K 3K 78643K 11461 0 0 ifaddr 30 13K 15K 78643K 1559 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 591 0 0 iov 0 0K 36K 78643K 1173 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 76K 78643K 7384 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 179 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 1569 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 33K 78643K 14507 0 0 sigio 0 0K 0K 78643K 167 0 0 proc 41 38K 70K 78643K 11807 0 0 subproc 17 1K 2K 78643K 4267 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 1736 0 0 in_multi 22 1K 2K 78643K 3217 0 0 ether_multi 1 0K 0K 78643K 99 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 4378 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 90 13K 31K 78643K 49051 0 0 UVM aobj 130 6K 6K 78643K 149 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 902 0 0 NDP 4 0K 0K 78643K 756 0 0 temp 97 2749K 2830K 78643K 62255 0 0 kqueue 0 0K 0K 78643K 204 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 515 0 511 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 1225 0 1223 1 0 1 1 0 8 0 rtentry 112 2795 0 2762 2 0 2 2 0 8 0 unpcb 120 6112 0 6104 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 3770 0 3770 1 1 0 1 0 8 0 tcpcb 544 3260 0 3256 2 1 1 2 0 8 0 ipq 40 9 0 9 9 9 0 1 0 8 0 ipqe 40 22 0 22 9 9 0 1 0 8 0 inpcb 280 7914 0 7907 7 6 1 2 0 8 0 nd6 48 753 0 750 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 11375 0 11227 31 19 12 13 0 8 1 art_table 32 11376 0 11227 2 0 2 2 0 8 0 art_node 16 2794 0 2764 1 0 1 1 0 8 0 sysvmsgpl 40 22 0 16 2 1 1 1 0 8 0 semapl 112 1567 0 1557 1 0 1 1 0 8 0 shmpl 112 147 0 19 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 16238 0 14779 49 1 48 48 0 8 0 ffsino 272 16238 0 14779 100 2 98 98 0 8 0 nchpl 144 33461 0 31836 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 140900 0 140900 4 3 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 99704 0 99704 35 34 1 6 0 8 1 plimitpl 152 2522 0 2515 1 0 1 1 0 8 0 sigapl 432 13931 0 13918 12 10 2 3 0 8 0 futexpl 56 128722 0 128722 3 2 1 1 0 8 1 knotepl 112 8005 0 7992 1 0 1 1 0 8 0 kqueuepl 104 3130 0 3128 1 0 1 1 0 8 0 pipepl 112 8830 0 8817 17 15 2 2 0 8 0 fdescpl 488 13932 0 13918 4 1 3 3 0 8 1 filepl 152 84945 0 84869 27 21 6 7 0 8 2 lockfpl 104 2676 0 2676 18 17 1 1 0 8 1 lockfspl 48 853 0 853 18 17 1 1 0 8 1 sessionpl 112 266 0 257 1 0 1 1 0 8 0 pgrppl 48 398 0 389 1 0 1 1 0 8 0 ucredpl 96 23326 0 23318 1 0 1 1 0 8 0 zombiepl 144 13918 0 13918 3 2 1 1 0 8 1 processpl 896 13948 0 13918 4 0 4 4 0 8 0 procpl 632 37820 0 37778 29 24 5 5 0 8 1 srpgc 64 500 0 500 45 44 1 1 0 8 1 sosppl 128 236 0 236 52 52 0 1 0 8 0 sockpl 384 15542 0 15525 14 10 4 4 0 8 2 mcl64k 65536 29 0 0 4 1 3 3 0 8 0 mcl16k 16384 36 0 0 5 3 2 3 0 8 0 mcl12k 12288 41 0 0 2 0 2 2 0 8 0 mcl9k 9216 41 0 0 2 0 2 2 0 8 0 mcl8k 8192 27 0 0 4 1 3 3 0 8 0 mcl4k 4096 25 0 0 3 0 3 3 0 8 0 mcl2k2 2112 18 0 0 2 0 2 2 0 8 0 mcl2k 2048 138 0 0 14 1 13 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 848 0 0 13 1 12 12 0 8 0 bufpl 256 37377 0 30353 440 0 440 440 0 8 0 anonpl 16 1406177 0 1399164 330 289 41 50 0 125 0 amapchunkpl 152 107694 0 107607 158 153 5 18 0 158 0 amappl16 192 62095 0 61723 404 373 31 33 0 8 8 amappl15 184 1626 0 1624 24 23 1 1 0 8 0 amappl14 176 3195 0 3186 1 0 1 1 0 8 0 amappl13 168 2515 0 2515 30 29 1 1 0 8 1 amappl12 160 1430 0 1424 2 1 1 1 0 8 0 amappl11 152 2933 0 2921 1 0 1 1 0 8 0 amappl10 144 1961 0 1960 1 0 1 1 0 8 0 amappl9 136 5326 0 5324 1 0 1 1 0 8 0 amappl8 128 4133 0 4102 4 2 2 2 0 8 0 amappl7 120 2417 0 2408 1 0 1 1 0 8 0 amappl6 112 2182 0 2169 1 0 1 1 0 8 0 amappl5 104 3167 0 3158 1 0 1 1 0 8 0 amappl4 96 13679 0 13646 1 0 1 1 0 8 0 amappl3 88 2956 0 2946 1 0 1 1 0 8 0 amappl2 80 93138 0 93067 3 1 2 3 0 8 0 amappl1 72 382495 0 382062 43 34 9 19 0 8 0 amappl 80 42005 0 41972 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 148 0 19 3 0 3 3 0 8 0 uaddrrnd 24 13932 0 13918 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 13932 0 13918 1 0 1 1 0 8 0 vmmpekpl 168 117155 0 117126 2 0 2 2 0 8 0 vmmpepl 168 1784463 0 1782997 401 316 85 94 0 357 10 vmsppl 368 13931 0 13918 2 0 2 2 0 8 0 pdppl 4096 27871 0 27836 7 1 6 6 0 8 1 pvpl 32 3965614 0 3955503 656 540 116 128 0 265 20 pmappl 232 13931 0 13918 32 31 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 635 0 35 18 0 18 18 0 8 0