witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd806f73f6f8) #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 500005 28394 0 0 0x4000080 1 syz-executor.0 *122974 28394 0 0 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,ffffffff8220a794) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff8220a794) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020acf668) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800021b9f090) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800021b9f090) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,7bfcdcb61b0) at Xsyscall+0x128 end of kernel end trace frame: 0x7c2ac6ac1f0, 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,ffffffff8220a794) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff8220a794) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020acf668) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800021b9f090) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800021b9f090) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,7bfcdcb61b0) at Xsyscall+0x128 end of kernel end trace frame: 0x7c2ac6ac1f0, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800021b9edd0 rbx 0xffff800021b9ee80 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff8000223b0000 rax 0xffff800000b57180 r8 0xffffffff81765703 kprintf+0x173 r9 0x1 r10 0x25 r11 0xd65946c7ea033e67 r12 0x3000000008 r13 0xffff800021b9ede0 r14 0x100 r15 0x1 rip 0xffffffff810d9878 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021b9edc0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=122974 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ace030,0xffffffff8265c758 process=0xffff800020adce00 user=0xffff800021b9a000, 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 28394 132212 789 0 2 0 syz-executor.0 28394 90739 789 0 2 0x4000000 syz-executor.0 28394 500005 789 0 7 0x4000080 syz-executor.0 *28394 122974 789 0 7 0x4000000 syz-executor.0 35694 224814 93364 0 3 0x82 piperd syz-executor.1 789 358598 93364 0 3 0x82 nanosleep syz-executor.0 54650 90935 1 0 3 0x100083 ttyin getty 14369 126262 0 0 3 0x14200 bored sosplice 93364 102549 41793 0 2 0x82 syz-fuzzer 93364 285089 41793 0 2 0x4000482 syz-fuzzer 93364 160612 41793 0 3 0x4000082 thrsleep syz-fuzzer 93364 275687 41793 0 3 0x4000082 thrsleep syz-fuzzer 93364 220844 41793 0 3 0x4000082 thrsleep syz-fuzzer 93364 298161 41793 0 3 0x4000082 thrsleep syz-fuzzer 93364 363321 41793 0 3 0x4000082 thrsleep syz-fuzzer 93364 196255 41793 0 3 0x4000082 thrsleep syz-fuzzer 93364 154538 41793 0 3 0x4000082 thrsleep syz-fuzzer 93364 401933 41793 0 3 0x4000082 thrsleep syz-fuzzer 41793 473749 7371 0 3 0x10008a pause ksh 7371 285670 34236 0 3 0x92 select sshd 34236 99411 1 0 3 0x80 select sshd 36571 440400 29623 74 3 0x100092 bpf pflogd 29623 279581 1 0 3 0x80 netio pflogd 10046 370098 37961 73 2 0x100090 syslogd 37961 469989 1 0 3 0x100082 netio syslogd 92713 445851 0 0 3 0x14200 pgzero zerothread 22938 316673 0 0 3 0x14200 aiodoned aiodoned 45046 342218 0 0 3 0x14200 syncer update 52319 479125 0 0 3 0x14200 cleaner cleaner 74539 133488 0 0 3 0x14200 reaper reaper 2348 252352 0 0 3 0x14200 pgdaemon pagedaemon 60658 518041 0 0 3 0x14200 bored crynlk 85035 479406 0 0 3 0x14200 bored crypto 42146 198504 0 0 3 0x40014200 acpi0 acpi0 24382 509487 0 0 3 0x40014200 idle1 71667 297479 0 0 3 0x14200 bored softnet 25049 307047 0 0 3 0x14200 bored systqmp 55021 407024 0 0 3 0x14200 bored systq 68626 309064 0 0 3 0x40014200 bored softclock 47760 282558 0 0 3 0x40014200 idle0 64083 288484 0 0 2 0x40014200 smr 1 419404 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 28394 (syz-executor.0) thread 0xffff800020acf668 (122974) exclusive rrwlock inode r = 0 (0xfffffd806f73f6f8) #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 9631 6546K 15001K 78643K 55677 0 0 pcb 13 8K 8K 78643K 1795 0 0 rtable 117 12K 13K 78643K 5884 0 0 ifaddr 90 28K 36K 78643K 2198 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 2312 0 0 iov 0 0K 32K 78643K 1750 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1195 75K 77K 78643K 17884 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 9K 78643K 227 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 2032 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 17819 0 0 sigio 0 0K 0K 78643K 248 0 0 proc 55 51K 83K 78643K 4458 0 0 subproc 32 2K 2K 78643K 999 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 1526 0 0 in_multi 33 2K 2K 78643K 1154 0 0 ether_multi 1 0K 0K 78643K 71 0 0 mrt 0 0K 0K 78643K 41 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 138 609K 609K 78643K 138 0 0 exec 0 0K 1K 78643K 2307 0 0 pfkey data 0 0K 4K 78643K 6 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 99 21K 31K 78643K 58063 0 0 UVM aobj 130 6K 6K 78643K 148 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 1K 78643K 1805 0 0 NDP 22 0K 0K 78643K 672 0 0 temp 242 3557K 4197K 78643K 275484 0 0 kqueue 0 0K 0K 78643K 136 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 129 0 123 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 773 0 773 2 1 1 1 0 8 1 rtentry 112 700 0 656 3 1 2 2 0 8 0 unpcb 120 5897 0 5889 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 9703 0 9703 1 1 0 1 0 8 0 tcpcb 544 3349 0 3345 1 0 1 1 0 8 0 inpcb 280 9559 0 9551 29 27 2 2 0 8 1 rttmr 72 7 0 7 5 5 0 1 0 8 0 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 48 2 0 2 1 1 0 1 0 8 0 nd6 48 174 0 168 1 0 1 1 0 8 0 pkpcb 40 99 0 99 33 33 0 1 0 8 0 swfcl 56 10 0 0 1 0 1 1 0 8 0 ppxss 1128 375 0 375 35 35 0 1 0 8 0 pffrag 232 29 0 29 18 18 0 1 0 482 0 pffrnode 88 29 0 29 18 18 0 1 0 8 0 pffrent 40 72 0 72 20 20 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 504 0 481 1 0 1 1 0 8 0 pfstkey 112 504 0 481 3 1 2 2 0 8 0 pfstate 328 504 0 481 8 4 4 5 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 2877 0 2680 22 9 13 14 0 8 0 art_table 32 2878 0 2680 2 0 2 2 0 8 0 art_node 16 678 0 638 1 0 1 1 0 8 0 sysvmsgpl 40 14 0 12 2 1 1 1 0 8 0 semapl 112 2030 0 2020 1 0 1 1 0 8 0 shmpl 112 146 0 18 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 28970 0 27499 48 0 48 48 0 8 0 ffsino 272 28970 0 27499 99 0 99 99 0 8 0 nchpl 144 53701 0 52064 62 0 62 62 0 8 0 uvmvnodes 72 7250 0 0 132 0 132 132 0 8 0 vnodes 200 7250 0 0 382 0 382 382 0 8 0 namei 1024 178047 0 178047 5 4 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 29 0 29 19 19 0 1 0 8 0 scxspl 192 157037 0 157037 67 66 1 7 0 8 1 plimitpl 152 1756 0 1749 1 0 1 1 0 8 0 sigapl 432 17856 0 17843 3 1 2 3 0 8 0 futexpl 56 226681 0 226681 4 3 1 1 0 8 1 knotepl 112 3895 0 3876 1 0 1 1 0 8 0 kqueuepl 104 3804 0 3802 1 0 1 1 0 8 0 pipepl 112 10010 0 9991 21 20 1 2 0 8 0 fdescpl 488 17857 0 17843 3 0 3 3 0 8 0 filepl 152 106803 0 106707 32 28 4 7 0 8 0 lockfpl 104 5384 0 5384 9 8 1 1 0 8 1 lockfspl 48 1811 0 1811 9 8 1 1 0 8 1 sessionpl 112 79 0 70 1 0 1 1 0 8 0 pgrppl 48 319 0 310 1 0 1 1 0 8 0 ucredpl 96 21046 0 21038 1 0 1 1 0 8 0 zombiepl 144 17846 0 17846 3 2 1 1 0 8 1 processpl 896 17876 0 17846 4 0 4 4 0 8 0 procpl 632 54384 0 54342 7 2 5 5 0 8 0 srpgc 64 119 0 119 45 45 0 1 0 8 0 sosppl 128 198 0 198 45 44 1 1 0 8 1 sockpl 384 16515 0 16503 25 22 3 4 0 8 1 mcl64k 65536 264 0 0 33 13 20 33 0 8 1 mcl16k 16384 28 0 0 4 2 2 3 0 8 0 mcl12k 12288 73 0 0 2 0 2 2 0 8 0 mcl9k 9216 38 0 0 2 0 2 2 0 8 0 mcl8k 8192 25 0 0 3 0 3 3 0 8 0 mcl4k 4096 33 0 0 3 0 3 3 0 8 0 mcl2k2 2112 13 0 0 1 0 1 1 0 8 0 mcl2k 2048 215 0 0 21 9 12 21 0 8 0 mtagpl 80 152 0 0 2 0 2 2 0 8 0 mbufpl 256 1123 0 0 31 3 28 29 0 8 0 bufpl 256 46490 0 39239 454 0 454 454 0 8 0 anonpl 16 1620784 0 1608389 335 268 67 85 0 124 6 amapchunkpl 152 108077 0 107973 118 113 5 19 0 158 0 amappl16 192 86615 0 85891 414 369 45 61 0 8 8 amappl15 184 2344 0 2344 10 10 0 1 0 8 0 amappl14 176 4178 0 4171 1 0 1 1 0 8 0 amappl13 168 3019 0 3019 7 7 0 1 0 8 0 amappl12 160 2293 0 2288 1 0 1 1 0 8 0 amappl11 152 2724 0 2716 1 0 1 1 0 8 0 amappl10 144 3330 0 3324 1 0 1 1 0 8 0 amappl9 136 3649 0 3646 1 0 1 1 0 8 0 amappl8 128 3067 0 3041 2 1 1 2 0 8 0 amappl7 120 3338 0 3328 1 0 1 1 0 8 0 amappl6 112 2562 0 2552 1 0 1 1 0 8 0 amappl5 104 2848 0 2837 1 0 1 1 0 8 0 amappl4 96 18350 0 18317 2 1 1 2 0 8 0 amappl3 88 4784 0 4772 1 0 1 1 0 8 0 amappl2 80 140446 0 140377 3 0 3 3 0 8 0 amappl1 72 387836 0 387423 26 16 10 20 0 8 0 amappl 80 55676 0 55641 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 147 0 18 3 0 3 3 0 8 0 uaddrrnd 24 17857 0 17843 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 17857 0 17843 1 0 1 1 0 8 0 vmmpekpl 168 144635 0 144605 3 1 2 3 0 8 0 vmmpepl 168 2169547 0 2167748 632 538 94 111 0 357 8 vmsppl 368 17856 0 17843 2 0 2 2 0 8 0 pdppl 4096 35721 0 35686 7 1 6 6 0 8 0 pvpl 32 4335868 0 4320310 740 581 159 201 0 265 21 pmappl 232 17856 0 17843 3 2 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 693 0 44 19 0 19 19 0 8 0