witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd8069c412c0) #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:556 [inline] #4 vn_write+0x169 sys/kern/vfs_vnops.c:398 #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 500362 4966 32767 0x10 0 0 syz-executor.0 *155903 52814 32767 0x10 0x4000000 1 syz-executor.1 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,ffffffff81fbbbf4) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbbbf4) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b28018) at userret+0x36a sys/kern/kern_sig.c:1911 syscall(ffff800021a39910) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800021a39910) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,a060e85a010) at Xsyscall+0x128 end of kernel end trace frame: 0xa0847b14520, 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,ffffffff81fbbbf4) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbbbf4) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b28018) at userret+0x36a sys/kern/kern_sig.c:1911 syscall(ffff800021a39910) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800021a39910) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,a060e85a010) at Xsyscall+0x128 end of kernel end trace frame: 0xa0847b14520, count: -6 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800021a39650 rbx 0xffff800021a39700 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800022e42000 rax 0xffff8000009fcdc0 r8 0xffffffff81e3c793 kprintf+0x173 r9 0x1 r10 0x25 r11 0x50088afb4b0aa314 r12 0x3000000008 r13 0xffff800021a39660 r14 0x100 r15 0x1 rip 0xffffffff812d9bb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021a39640 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=155903 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=80, nice=20 forw=0xffffffffffffffff, list=0xffff800020b28c70,0xffff800020b28a08 process=0xffff800020b7ca80 user=0xffff800021a34000, vmspace=0xfffffd807f00c8a0 estcpu=30, cpticks=5, pctcpu=0.7 user=0, sys=5, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 4966 500362 175 32767 7 0x10 syz-executor.0 4966 197373 175 32767 2 0x4000010 syz-executor.0 52814 36244 23903 32767 2 0x10 syz-executor.1 *52814 155903 23903 32767 7 0x4000010 syz-executor.1 52814 335275 23903 32767 2 0x4000010 syz-executor.1 52814 403324 23903 32767 2 0x4000010 syz-executor.1 52814 259779 23903 32767 2 0x4000010 syz-executor.1 52814 138078 23903 32767 3 0x4000090 fsleep syz-executor.1 175 146174 54378 32767 3 0x90 nanosleep syz-executor.0 54378 14785 99438 0 3 0x82 wait syz-executor.0 23903 278092 38738 32767 3 0x90 nanosleep syz-executor.1 38738 26676 99438 0 3 0x82 wait syz-executor.1 83238 114895 0 0 3 0x14200 bored sosplice 99438 93357 32623 0 3 0x82 thrsleep syz-fuzzer 99438 239599 32623 0 2 0x4000082 syz-fuzzer 99438 497716 32623 0 3 0x4000082 kqread syz-fuzzer 99438 210448 32623 0 3 0x4000082 thrsleep syz-fuzzer 99438 5044 32623 0 3 0x4000082 thrsleep syz-fuzzer 99438 367686 32623 0 3 0x4000082 thrsleep syz-fuzzer 99438 437560 32623 0 3 0x4000082 thrsleep syz-fuzzer 99438 518613 32623 0 3 0x4000082 thrsleep syz-fuzzer 99438 239522 32623 0 2 0x4000082 syz-fuzzer 99438 114621 32623 0 3 0x4000082 thrsleep syz-fuzzer 32623 435385 56159 0 3 0x10008a pause ksh 56159 286820 93314 0 2 0x92 sshd 37584 422183 1 0 3 0x100083 ttyin getty 93314 67984 1 0 3 0x80 select sshd 37693 38676 79537 73 2 0x100010 syslogd 79537 26249 1 0 3 0x100082 netio syslogd 15485 270829 1 77 3 0x100090 poll dhclient 35622 236780 1 0 3 0x80 poll dhclient 52727 461607 0 0 2 0x14200 zerothread 62974 39900 0 0 3 0x14200 aiodoned aiodoned 51612 377557 0 0 3 0x14200 syncer update 29775 488492 0 0 3 0x14200 cleaner cleaner 65146 265654 0 0 3 0x14200 reaper reaper 2988 444350 0 0 3 0x14200 pgdaemon pagedaemon 13277 190706 0 0 3 0x14200 bored crynlk 15340 187401 0 0 3 0x14200 bored crypto 68015 432805 0 0 3 0x40014200 acpi0 acpi0 80539 487430 0 0 3 0x40014200 idle1 88117 159371 0 0 3 0x14200 bored softnet 80827 77314 0 0 3 0x14200 bored systqmp 88637 498320 0 0 3 0x14200 bored systq 63945 499709 0 0 3 0x40014200 bored softclock 91758 191923 0 0 3 0x40014200 idle0 39979 279532 0 0 3 0x14200 bored smr 1 79828 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 52814 (syz-executor.1) thread 0xffff800020b28018 (155903) exclusive rrwlock inode r = 0 (0xfffffd8069c412c0) #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:556 [inline] #4 vn_write+0x169 sys/kern/vfs_vnops.c:398 #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 Process 37693 (syslogd) thread 0xffff800020b60778 (38676) exclusive rrwlock inode r = 0 (0xfffffd806ebcf1a8) #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:556 #5 sys_fsync+0x114 sys/kern/vfs_syscalls.c:2789 #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 9465 6322K 6322K 78643K 12007 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 105 3K 3K 78643K 13270 0 0 ifaddr 36 18K 21K 78643K 1819 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 743 0 0 iov 0 0K 32K 78643K 1310 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 76K 78643K 8220 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 181 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 1627 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 8 25K 33K 78643K 15683 0 0 sigio 0 0K 0K 78643K 182 0 0 proc 41 38K 70K 78643K 13554 0 0 subproc 34 2K 2K 78643K 4981 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 1822 0 0 in_multi 33 2K 2K 78643K 3625 0 0 ether_multi 1 0K 0K 78643K 68 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 78 344K 344K 78643K 78 0 0 exec 0 0K 1K 78643K 5038 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 118 22K 32K 78643K 53350 0 0 UVM aobj 130 4K 4K 78643K 145 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 878 0 0 NDP 5 0K 0K 78643K 882 0 0 temp 121 2746K 2818K 78643K 69472 0 0 kqueue 0 0K 0K 78643K 184 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 596 0 590 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 1336 0 1334 1 0 1 1 0 8 0 rtentry 112 3254 0 3210 2 0 2 2 0 8 0 unpcb 120 5586 0 5578 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 4107 0 4107 2 2 0 2 0 8 0 tcpcb 544 3483 0 3479 1 0 1 1 0 8 0 inpcb 280 8623 0 8612 24 23 1 2 0 8 0 nd6 48 879 0 873 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 13309 0 13115 27 14 13 13 0 8 0 art_table 32 13310 0 13115 2 0 2 2 0 8 0 art_node 16 3253 0 3213 1 0 1 1 0 8 0 sysvmsgpl 40 18 0 15 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 1623 0 1613 1 0 1 1 0 8 0 shmpl 112 143 0 15 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 16972 0 15513 52 4 48 48 0 8 0 ffsino 272 16972 0 15513 99 1 98 98 0 8 0 nchpl 144 35071 0 33441 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 144201 0 144201 3 2 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 103575 0 103575 68 65 3 6 0 8 3 plimitpl 152 2529 0 2520 1 0 1 1 0 8 0 sigapl 432 14981 0 14965 14 12 2 3 0 8 0 futexpl 56 131017 0 131016 2 1 1 1 0 8 0 knotepl 112 9114 0 9095 1 0 1 1 0 8 0 kqueuepl 104 3387 0 3385 1 0 1 1 0 8 0 pipepl 112 9878 0 9859 18 17 1 2 0 8 0 fdescpl 488 14982 0 14965 4 1 3 3 0 8 0 filepl 152 89060 0 88952 35 30 5 7 0 8 0 lockfpl 104 2735 0 2735 33 32 1 1 0 8 1 lockfspl 48 881 0 881 33 32 1 1 0 8 1 sessionpl 112 308 0 298 1 0 1 1 0 8 0 pgrppl 48 488 0 478 1 0 1 1 0 8 0 ucredpl 96 24322 0 24313 1 0 1 1 0 8 0 zombiepl 144 14965 0 14965 3 2 1 1 0 8 1 processpl 896 14998 0 14965 4 0 4 4 0 8 0 procpl 632 40429 0 40381 46 41 5 5 0 8 1 srpgc 64 582 0 582 51 50 1 1 0 8 1 sosppl 128 269 0 269 58 58 0 1 0 8 0 sockpl 384 15822 0 15805 18 15 3 4 0 8 1 mcl64k 65536 29 0 0 4 2 2 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 102 0 0 3 1 2 2 0 8 0 mcl9k 9216 31 0 0 2 0 2 2 0 8 0 mcl8k 8192 40 0 0 5 3 2 3 0 8 0 mcl4k 4096 23 0 0 3 1 2 3 0 8 0 mcl2k2 2112 14 0 0 1 0 1 1 0 8 0 mcl2k 2048 223 0 0 23 10 13 23 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 1032 0 0 14 3 11 14 0 8 0 bufpl 256 35162 0 28138 440 0 440 440 0 8 0 anonpl 16 1687246 0 1680761 309 263 46 59 0 125 6 amapchunkpl 152 123331 0 123238 191 185 6 18 0 158 2 amappl16 192 71010 0 70634 346 315 31 39 0 8 7 amappl15 184 2291 0 2290 1 0 1 1 0 8 0 amappl14 176 4504 0 4493 1 0 1 1 0 8 0 amappl13 168 2064 0 2064 31 31 0 1 0 8 0 amappl12 160 1782 0 1774 2 1 1 1 0 8 0 amappl11 152 2612 0 2598 1 0 1 1 0 8 0 amappl10 144 1995 0 1991 1 0 1 1 0 8 0 amappl9 136 5852 0 5847 1 0 1 1 0 8 0 amappl8 128 4671 0 4618 2 0 2 2 0 8 0 amappl7 120 2607 0 2599 1 0 1 1 0 8 0 amappl6 112 1827 0 1811 1 0 1 1 0 8 0 amappl5 104 3730 0 3720 1 0 1 1 0 8 0 amappl4 96 14421 0 14386 1 0 1 1 0 8 0 amappl3 88 4248 0 4238 1 0 1 1 0 8 0 amappl2 80 97977 0 97897 3 1 2 3 0 8 0 amappl1 72 415562 0 415098 23 13 10 19 0 8 0 amappl 80 45218 0 45179 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 144 0 15 3 0 3 3 0 8 0 uaddrrnd 24 14982 0 14965 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 14982 0 14965 1 0 1 1 0 8 0 vmmpekpl 168 128707 0 128677 2 0 2 2 0 8 0 vmmpepl 168 1934549 0 1932803 436 349 87 96 0 357 7 vmsppl 368 14981 0 14965 2 0 2 2 0 8 0 pdppl 4096 29971 0 29930 7 1 6 6 0 8 0 pvpl 32 4454044 0 4443210 749 628 121 153 0 265 18 pmappl 232 14981 0 14965 34 33 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 637 0 39 18 0 18 18 0 8 0