witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd806b9431b8) #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_writev+0xa7 sys/kern/sys_generic.c:311 #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 *166747 52464 32767 0x10 0x4000000 1 syz-executor.0 1363 84707 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,ffffffff81fbc8ca) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbc8ca) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b293d8) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800022c0bbd0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800022c0bbd0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,d,0,3,8b653bd21b0) at Xsyscall+0x128 end of kernel end trace frame: 0x8b8d76f70d0, 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,ffffffff81fbc8ca) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbc8ca) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b293d8) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800022c0bbd0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800022c0bbd0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,d,0,3,8b653bd21b0) at Xsyscall+0x128 end of kernel end trace frame: 0x8b8d76f70d0, count: -6 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800022c0b910 rbx 0xffff800022c0b9c0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800020dce000 rax 0xffff8000009b1600 r8 0xffffffff81c4d0a3 kprintf+0x173 r9 0x1 r10 0x25 r11 0xefc5a8af904832da r12 0x3000000008 r13 0xffff800022c0b920 r14 0x100 r15 0x1 rip 0xffffffff81e02eb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022c0b900 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=166747 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b289f8,0xffffffff8236a818 process=0xffff800020b7ca80 user=0xffff800022c06000, vmspace=0xfffffd807effe2e0 estcpu=36, cpticks=4, pctcpu=0.0 user=0, sys=4, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 85464 469168 50717 32767 2 0x10 syz-executor.1 85464 365890 50717 32767 3 0x4000090 fsleep syz-executor.1 52464 170484 99209 32767 2 0x10 syz-executor.0 52464 21111 99209 32767 3 0x4000090 fsleep syz-executor.0 52464 228647 99209 32767 3 0x4000090 fsleep syz-executor.0 *52464 166747 99209 32767 7 0x4000010 syz-executor.0 50717 401817 42272 32767 2 0x490 syz-executor.1 42272 273262 63184 0 3 0x82 wait syz-executor.1 99209 385370 68929 32767 2 0x490 syz-executor.0 68929 414087 63184 0 3 0x82 wait syz-executor.0 48977 264624 0 0 3 0x14200 bored sosplice 63184 35274 81825 0 3 0x82 thrsleep syz-fuzzer 63184 363543 81825 0 3 0x4000082 thrsleep syz-fuzzer 63184 147638 81825 0 3 0x4000082 thrsleep syz-fuzzer 63184 394981 81825 0 3 0x4000082 thrsleep syz-fuzzer 63184 336648 81825 0 3 0x4000082 thrsleep syz-fuzzer 63184 295088 81825 0 3 0x4000082 thrsleep syz-fuzzer 63184 311601 81825 0 3 0x4000082 thrsleep syz-fuzzer 63184 126764 81825 0 3 0x4000082 thrsleep syz-fuzzer 63184 102041 81825 0 3 0x4000082 kqread syz-fuzzer 63184 449000 81825 0 3 0x4000082 thrsleep syz-fuzzer 81825 355167 13089 0 3 0x10008a pause ksh 13089 389594 81341 0 3 0x92 select sshd 26352 41554 1 0 3 0x100083 ttyin getty 81341 133584 1 0 3 0x80 select sshd 84707 1363 13077 73 7 0x100010 syslogd 13077 520208 1 0 3 0x100082 netio syslogd 59371 15083 1 77 3 0x100090 poll dhclient 64305 29922 1 0 3 0x80 poll dhclient 59868 207277 0 0 2 0x14200 zerothread 19946 15653 0 0 3 0x14200 aiodoned aiodoned 94706 442632 0 0 3 0x14200 syncer update 19543 228929 0 0 3 0x14200 cleaner cleaner 18189 505488 0 0 3 0x14200 reaper reaper 33659 396710 0 0 3 0x14200 pgdaemon pagedaemon 93106 62155 0 0 3 0x14200 bored crynlk 1399 188679 0 0 3 0x14200 bored crypto 23147 515605 0 0 3 0x40014200 acpi0 acpi0 89750 216891 0 0 3 0x40014200 idle1 1529 22007 0 0 3 0x14200 bored softnet 22800 313364 0 0 3 0x14200 bored systqmp 87985 88016 0 0 3 0x14200 bored systq 29440 406532 0 0 3 0x40014200 bored softclock 92205 141210 0 0 3 0x40014200 idle0 75168 448355 0 0 3 0x14200 bored smr 1 139914 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 52464 (syz-executor.0) thread 0xffff800020b293d8 (166747) exclusive rrwlock inode r = 0 (0xfffffd806b9431b8) #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_writev+0xa7 sys/kern/sys_generic.c:311 #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 84707 (syslogd) thread 0xffff800020b60778 (1363) exclusive rrwlock inode r = 0 (0xfffffd806ebaa098) #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 9461 6321K 6321K 78643K 10958 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 105 3K 3K 78643K 3871 0 0 ifaddr 35 11K 12K 78643K 537 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 207 0 0 iov 0 0K 24K 78643K 317 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 76K 78643K 3254 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 46 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 490 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 8 25K 33K 78643K 4327 0 0 sigio 0 0K 0K 78643K 41 0 0 proc 41 38K 70K 78643K 4105 0 0 subproc 34 2K 2K 78643K 1428 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 564 0 0 in_multi 33 2K 2K 78643K 1069 0 0 ether_multi 1 0K 0K 78643K 19 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 54 238K 238K 78643K 54 0 0 exec 0 0K 1K 78643K 1498 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 102 21K 30K 78643K 15278 0 0 UVM aobj 130 4K 4K 78643K 151 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 243 0 0 NDP 5 0K 0K 78643K 255 0 0 temp 121 2750K 2830K 78643K 21511 0 0 kqueue 0 0K 0K 78643K 51 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 171 0 165 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 356 0 354 1 0 1 1 0 8 0 rtentry 112 948 0 904 2 0 2 2 0 8 0 unpcb 120 1502 0 1494 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 3820 0 3820 1 1 0 1 0 8 0 tcpcb 544 987 0 983 1 0 1 1 0 8 0 inpcb 280 2380 0 2372 2 1 1 2 0 8 0 nd6 48 252 0 246 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 3851 0 3659 15 3 12 13 0 8 0 art_table 32 3852 0 3659 2 0 2 2 0 8 0 art_node 16 947 0 907 1 0 1 1 0 8 0 sysvmsgpl 40 39 0 23 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 486 0 476 1 0 1 1 0 8 0 shmpl 112 149 0 21 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 5797 0 4362 47 0 47 47 0 8 0 ffsino 272 5797 0 4362 96 0 96 96 0 8 0 nchpl 144 10981 0 9353 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 45414 0 45414 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 31692 0 31692 14 13 1 6 0 8 1 plimitpl 152 735 0 726 1 0 1 1 0 8 0 sigapl 432 4252 0 4236 5 3 2 3 0 8 0 futexpl 56 37936 0 37933 1 0 1 1 0 8 0 knotepl 112 2557 0 2538 1 0 1 1 0 8 0 kqueuepl 104 884 0 882 1 0 1 1 0 8 0 pipepl 112 2844 0 2823 12 11 1 2 0 8 0 fdescpl 488 4253 0 4236 3 0 3 3 0 8 0 filepl 152 25999 0 25895 18 13 5 7 0 8 0 lockfpl 104 801 0 801 6 5 1 1 0 8 1 lockfspl 48 260 0 260 6 5 1 1 0 8 1 sessionpl 112 99 0 89 1 0 1 1 0 8 0 pgrppl 48 143 0 133 1 0 1 1 0 8 0 ucredpl 96 7351 0 7342 1 0 1 1 0 8 0 zombiepl 144 4236 0 4236 3 2 1 1 0 8 1 processpl 896 4269 0 4236 4 0 4 4 0 8 0 procpl 632 11123 0 11077 14 9 5 5 0 8 1 srpgc 64 164 0 164 10 9 1 1 0 8 1 sosppl 128 58 0 58 12 12 0 1 0 8 0 sockpl 384 4320 0 4302 8 5 3 4 0 8 1 mcl64k 65536 15 0 0 2 0 2 2 0 8 0 mcl16k 16384 11 0 0 2 0 2 2 0 8 0 mcl12k 12288 25 0 0 2 0 2 2 0 8 0 mcl9k 9216 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 13 0 0 2 0 2 2 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 127 0 0 15 0 15 15 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 381 0 0 13 0 13 13 0 8 0 bufpl 256 15881 0 8857 440 0 440 440 0 8 0 anonpl 16 429674 0 423459 140 105 35 48 0 125 3 amapchunkpl 152 34056 0 33966 57 52 5 18 0 158 0 amappl16 192 17634 0 17234 115 93 22 33 0 8 1 amappl15 184 367 0 367 11 10 1 1 0 8 1 amappl14 176 1068 0 1058 1 0 1 1 0 8 0 amappl13 168 610 0 610 8 8 0 1 0 8 0 amappl12 160 194 0 194 10 9 1 1 0 8 1 amappl11 152 797 0 785 1 0 1 1 0 8 0 amappl10 144 808 0 802 2 1 1 1 0 8 0 amappl9 136 1860 0 1856 1 0 1 1 0 8 0 amappl8 128 1083 0 1054 2 0 2 2 0 8 0 amappl7 120 935 0 926 1 0 1 1 0 8 0 amappl6 112 599 0 588 1 0 1 1 0 8 0 amappl5 104 857 0 847 1 0 1 1 0 8 0 amappl4 96 4552 0 4527 1 0 1 1 0 8 0 amappl3 88 844 0 833 1 0 1 1 0 8 0 amappl2 80 27104 0 27027 4 2 2 3 0 8 0 amappl1 72 124130 0 123671 23 13 10 19 0 8 0 amappl 80 12658 0 12620 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 150 0 21 3 0 3 3 0 8 0 uaddrrnd 24 4253 0 4236 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 4253 0 4236 1 0 1 1 0 8 0 vmmpekpl 168 38356 0 38330 2 0 2 2 0 8 0 vmmpepl 168 547885 0 546176 154 75 79 86 0 357 4 vmsppl 368 4252 0 4236 2 0 2 2 0 8 0 pdppl 4096 8514 0 8472 6 0 6 6 0 8 0 pvpl 32 1244916 0 1235393 315 207 108 130 0 265 18 pmappl 232 4252 0 4236 7 6 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 605 0 6 18 0 18 18 0 8 0