witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd80667f1818) #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 499854 2417 0 0 0 1 syz-executor.1 *226156 45478 0 0x1000 0x4080000 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,ffffffff81fbe700) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbe700) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b5e018) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800021bfafe0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800021bfafe0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,7d67ce49010) at Xsyscall+0x128 end of kernel end trace frame: 0x7d91c3786c0, 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,ffffffff81fbe700) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbe700) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b5e018) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800021bfafe0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800021bfafe0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,7d67ce49010) at Xsyscall+0x128 end of kernel end trace frame: 0x7d91c3786c0, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800021bfad20 rbx 0xffff800021bfadd0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800021dfc000 rax 0xffff80000097c340 r8 0xffffffff816589c3 kprintf+0x173 r9 0x1 r10 0x25 r11 0x8fcb7ce1b6a37564 r12 0x3000000008 r13 0xffff800021bfad30 r14 0x100 r15 0x1 rip 0xffffffff8156e8c8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021bfad10 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=226156 stat=onproc flags process=1000 proc=4080000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b5e9f8,0xffff800020b5f3e8 process=0xffff800020b7c380 user=0xffff800021bf6000, vmspace=0xfffffd807f00ccf0 estcpu=36, cpticks=6, pctcpu=0.0 user=0, sys=6, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 2417 499854 85038 0 7 0 syz-executor.1 2417 305734 85038 0 2 0x4000080 syz-executor.1 2417 392524 85038 0 3 0x4000080 fsleep syz-executor.1 45478 325640 3741 0 3 0x3000 suspend syz-executor.0 *45478 226156 3741 0 7 0x4081000 syz-executor.0 3741 239302 66123 0 2 0x482 syz-executor.0 11783 114289 1 0 3 0x100083 ttyin getty 87918 479510 0 0 3 0x14200 bored sosplice 85038 414617 66123 0 2 0x482 syz-executor.1 66123 37067 99948 0 3 0x82 thrsleep syz-fuzzer 66123 203950 99948 0 3 0x4000082 thrsleep syz-fuzzer 66123 523805 99948 0 3 0x4000082 thrsleep syz-fuzzer 66123 139235 99948 0 3 0x4000082 thrsleep syz-fuzzer 66123 123919 99948 0 3 0x4000082 thrsleep syz-fuzzer 66123 322216 99948 0 3 0x4000082 thrsleep syz-fuzzer 66123 314621 99948 0 3 0x4000082 thrsleep syz-fuzzer 66123 144983 99948 0 3 0x4000082 thrsleep syz-fuzzer 66123 385948 99948 0 3 0x4000082 kqread syz-fuzzer 66123 299365 99948 0 3 0x4000082 thrsleep syz-fuzzer 99948 193151 18134 0 3 0x10008a pause ksh 18134 126817 89491 0 3 0x92 select sshd 89491 456725 1 0 3 0x80 select sshd 62259 99356 41037 74 3 0x100092 bpf pflogd 41037 178355 1 0 3 0x80 netio pflogd 45314 14557 58108 73 3 0x100010 biowait syslogd 58108 155595 1 0 3 0x100082 netio syslogd 6562 59765 1 77 3 0x100090 poll dhclient 428 323813 1 0 3 0x80 poll dhclient 83266 220912 0 0 3 0x14200 pgzero zerothread 76583 484157 0 0 3 0x14200 aiodoned aiodoned 25041 98038 0 0 3 0x14200 syncer update 86001 395233 0 0 3 0x14200 cleaner cleaner 3841 282899 0 0 3 0x14200 reaper reaper 1235 473992 0 0 3 0x14200 pgdaemon pagedaemon 53080 5948 0 0 3 0x14200 bored crynlk 14649 255999 0 0 3 0x14200 bored crypto 7258 183593 0 0 3 0x40014200 acpi0 acpi0 18507 473821 0 0 3 0x40014200 idle1 6750 343877 0 0 3 0x14200 bored softnet 65779 165835 0 0 3 0x14200 bored systqmp 58350 135325 0 0 3 0x14200 bored systq 67241 138895 0 0 3 0x40014200 bored softclock 91529 280401 0 0 3 0x40014200 idle0 87301 398168 0 0 3 0x14200 bored smr 1 361210 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 45478 (syz-executor.0) thread 0xffff800020b5e018 (226156) exclusive rrwlock inode r = 0 (0xfffffd80667f1818) #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 Process 45314 (syslogd) thread 0xffff800020b61158 (14557) exclusive rrwlock inode r = 0 (0xfffffd806ebb1e68) #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 9606 6462K 7131K 78643K 27529 0 0 pcb 13 8K 8K 78643K 520 0 0 rtable 115 4K 5K 78643K 1691 0 0 ifaddr 88 20K 21K 78643K 714 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1810 0 0 iov 0 0K 24K 78643K 824 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1202 76K 77K 78643K 7446 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 116 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 765 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 6806 0 0 sigio 0 0K 0K 78643K 104 0 0 proc 54 51K 71K 78643K 1313 0 0 subproc 32 2K 2K 78643K 153 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 637 0 0 in_multi 33 2K 2K 78643K 304 0 0 ether_multi 1 0K 0K 78643K 36 0 0 mrt 0 0K 0K 78643K 44 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 114 503K 503K 78643K 114 0 0 exec 0 0K 1K 78643K 991 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 119 22K 31K 78643K 23319 0 0 UVM aobj 130 4K 4K 78643K 146 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 393 0 0 NDP 21 0K 0K 78643K 208 0 0 temp 236 2753K 3392K 78643K 24927 0 0 kqueue 0 0K 0K 78643K 81 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 21 0 14 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 279 0 277 1 0 1 1 0 8 0 rtentry 112 132 0 87 2 0 2 2 0 8 0 unpcb 120 2360 0 2350 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 6664 0 6664 3 3 0 2 0 8 0 tcpcb 544 1035 0 1031 1 0 1 1 0 8 0 inpcb 280 3060 0 3048 4 2 2 2 0 8 1 rttmr 72 6 0 6 6 5 1 1 0 8 1 nd6 48 27 0 21 1 0 1 1 0 8 0 pkpcb 40 36 0 36 12 12 0 1 0 8 0 swfcl 56 3 0 0 1 0 1 1 0 8 0 ppxss 1128 139 0 138 14 13 1 1 0 8 0 pffrag 232 7 0 7 5 4 1 1 0 482 1 pffrnode 88 7 0 7 5 4 1 1 0 8 1 pffrent 40 20 0 20 5 4 1 1 0 8 1 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 128 0 115 1 0 1 1 0 8 0 pfstkey 112 128 0 115 1 0 1 1 0 8 0 pfstate 328 128 0 115 4 2 2 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 519 0 326 17 4 13 13 0 8 0 art_table 32 520 0 326 2 0 2 2 0 8 0 art_node 16 128 0 87 1 0 1 1 0 8 0 sysvmsgpl 40 11 0 7 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 763 0 753 1 0 1 1 0 8 0 shmpl 112 144 0 16 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 12386 0 10975 47 0 47 47 0 8 0 ffsino 272 12386 0 10975 96 0 96 96 0 8 0 nchpl 144 22204 0 20569 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 71130 0 71130 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 19 0 19 9 9 0 1 0 8 0 scxspl 192 67824 0 67823 32 29 3 6 0 8 2 plimitpl 152 649 0 641 1 0 1 1 0 8 0 sigapl 432 6988 0 6972 3 1 2 3 0 8 0 futexpl 56 86122 0 86121 2 1 1 1 0 8 0 knotepl 112 1277 0 1258 2 1 1 2 0 8 0 kqueuepl 104 1565 0 1563 1 0 1 1 0 8 0 pipepl 112 3960 0 3941 10 9 1 2 0 8 0 fdescpl 488 6989 0 6972 3 0 3 3 0 8 0 filepl 152 42255 0 42149 16 11 5 7 0 8 0 lockfpl 104 2205 0 2205 8 7 1 1 0 8 1 lockfspl 48 745 0 745 8 7 1 1 0 8 1 sessionpl 112 28 0 17 1 0 1 1 0 8 0 pgrppl 48 115 0 104 1 0 1 1 0 8 0 ucredpl 96 8450 0 8441 1 0 1 1 0 8 0 zombiepl 144 6973 0 6972 2 1 1 1 0 8 0 processpl 896 7005 0 6972 4 0 4 4 0 8 0 procpl 632 21963 0 21918 18 14 4 5 0 8 0 srpgc 64 20 0 20 10 9 1 1 0 8 1 sosppl 128 98 0 98 20 20 0 1 0 8 0 sockpl 384 5806 0 5787 10 7 3 4 0 8 1 mcl64k 65536 18 0 0 3 1 2 3 0 8 0 mcl16k 16384 14 0 0 2 0 2 2 0 8 0 mcl12k 12288 33 0 0 2 0 2 2 0 8 0 mcl9k 9216 30 0 0 2 0 2 2 0 8 0 mcl8k 8192 25 0 0 4 1 3 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 9 0 0 1 0 1 1 0 8 0 mcl2k 2048 216 0 0 24 6 18 24 0 8 0 mtagpl 80 71 0 0 2 0 2 2 0 8 0 mbufpl 256 461 0 0 14 0 14 14 0 8 0 bufpl 256 24622 0 17593 440 0 440 440 0 8 0 anonpl 16 635294 0 623364 211 146 65 66 0 125 13 amapchunkpl 152 41091 0 40962 47 41 6 13 0 158 0 amappl16 192 36868 0 36215 205 160 45 46 0 8 11 amappl15 184 302 0 300 1 0 1 1 0 8 0 amappl14 176 990 0 984 1 0 1 1 0 8 0 amappl13 168 3587 0 3585 2 1 1 1 0 8 0 amappl12 160 25 0 23 2 1 1 1 0 8 0 amappl11 152 82 0 67 1 0 1 1 0 8 0 amappl10 144 1988 0 1982 1 0 1 1 0 8 0 amappl9 136 695 0 692 1 0 1 1 0 8 0 amappl8 128 251 0 222 2 1 1 2 0 8 0 amappl7 120 1974 0 1966 1 0 1 1 0 8 0 amappl6 112 63 0 55 1 0 1 1 0 8 0 amappl5 104 216 0 200 1 0 1 1 0 8 0 amappl4 96 7314 0 7284 2 1 1 2 0 8 0 amappl3 88 1336 0 1325 1 0 1 1 0 8 0 amappl2 80 55029 0 54948 3 0 3 3 0 8 0 amappl1 72 161379 0 160911 25 15 10 20 0 8 0 amappl 80 22388 0 22342 3 1 2 2 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 145 0 16 3 0 3 3 0 8 0 uaddrrnd 24 6989 0 6972 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 6989 0 6972 1 0 1 1 0 8 0 vmmpekpl 168 57469 0 57439 2 0 2 2 0 8 0 vmmpepl 168 849435 0 847518 288 194 94 110 0 357 9 vmsppl 368 6988 0 6972 2 0 2 2 0 8 0 pdppl 4096 13985 0 13944 7 1 6 6 0 8 0 pvpl 32 1722365 0 1707103 439 276 163 165 0 265 36 pmappl 232 6988 0 6972 4 3 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 623 0 17 18 0 18 18 0 8 0