witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd807e2dab40) #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 * 17767 42205 32767 0x1010 0x4080000 1 syz-executor.0 66017 96015 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,ffffffff8220e320) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff8220e320) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020ace028) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024f6f6d0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024f6f6d0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,d,0,3,316d5df70e0) at Xsyscall+0x128 end of kernel end trace frame: 0x319c5a65430, 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,ffffffff8220e320) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff8220e320) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020ace028) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024f6f6d0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024f6f6d0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,d,0,3,316d5df70e0) at Xsyscall+0x128 end of kernel end trace frame: 0x319c5a65430, count: -6 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800024f6f410 rbx 0xffff800024f6f4c0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800020b3e000 rax 0xffff800000a70d40 r8 0xffffffff81128163 kprintf+0x173 r9 0x1 r10 0x25 r11 0xe30c4d4faf6dab6b r12 0x3000000008 r13 0xffff800024f6f420 r14 0x100 r15 0x1 rip 0xffffffff81dbc048 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024f6f400 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=17767 stat=onproc flags process=1010 proc=4080000 pri=32, usrpri=60, nice=20 forw=0xffffffffffffffff, list=0xffff800020acfb50,0xffff800020a5e290 process=0xffff800020a8b890 user=0xffff800024f6a000, vmspace=0xfffffd807f00c5c0 estcpu=10, cpticks=4, pctcpu=0.0 user=0, sys=4, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 42205 393659 72396 32767 3 0x3010 suspend syz-executor.0 *42205 17767 72396 32767 7 0x4081010 syz-executor.0 85800 135419 109 32767 2 0x10 syz-executor.1 85800 219474 109 32767 3 0x4000090 fifor syz-executor.1 85800 216109 109 32767 2 0x4000010 syz-executor.1 72396 221984 44 32767 3 0x90 nanosleep syz-executor.0 44 370395 38768 0 3 0x82 wait syz-executor.0 109 376925 33474 32767 3 0x90 nanosleep syz-executor.1 33474 451175 38768 0 3 0x82 wait syz-executor.1 90088 297201 0 0 3 0x14200 bored sosplice 38768 382632 48615 0 3 0x82 thrsleep syz-fuzzer 38768 206554 48615 0 3 0x4000082 thrsleep syz-fuzzer 38768 134191 48615 0 3 0x4000082 thrsleep syz-fuzzer 38768 375959 48615 0 3 0x4000082 kqread syz-fuzzer 38768 502495 48615 0 3 0x4000082 thrsleep syz-fuzzer 38768 442065 48615 0 3 0x4000082 thrsleep syz-fuzzer 38768 334750 48615 0 3 0x4000082 thrsleep syz-fuzzer 38768 418672 48615 0 3 0x4000082 thrsleep syz-fuzzer 38768 282682 48615 0 3 0x4000082 thrsleep syz-fuzzer 38768 128655 48615 0 3 0x4000082 thrsleep syz-fuzzer 48615 215428 84298 0 3 0x10008a pause ksh 84298 309386 28708 0 3 0x92 select sshd 96394 419862 1 0 3 0x100083 ttyin getty 28708 231465 1 0 3 0x80 select sshd 96015 66017 71627 73 7 0x100010 syslogd 71627 429947 1 0 3 0x100082 netio syslogd 36398 67824 1 77 3 0x100090 poll dhclient 70937 80596 1 0 3 0x80 poll dhclient 15782 121690 0 0 2 0x14200 zerothread 35148 218553 0 0 3 0x14200 aiodoned aiodoned 68232 512615 0 0 3 0x14200 syncer update 40620 419337 0 0 3 0x14200 cleaner cleaner 69502 515705 0 0 3 0x14200 reaper reaper 41164 153535 0 0 3 0x14200 pgdaemon pagedaemon 20844 66830 0 0 3 0x14200 bored crynlk 76144 12219 0 0 3 0x14200 bored crypto 56042 74362 0 0 3 0x40014200 acpi0 acpi0 42709 487871 0 0 3 0x40014200 idle1 9622 433605 0 0 3 0x14200 bored softnet 30165 101955 0 0 3 0x14200 bored systqmp 51058 497220 0 0 3 0x14200 bored systq 15765 315791 0 0 3 0x40014200 bored softclock 50071 520341 0 0 3 0x40014200 idle0 41498 418995 0 0 3 0x14200 bored smr 1 468371 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 42205 (syz-executor.0) thread 0xffff800020ace028 (17767) exclusive rrwlock inode r = 0 (0xfffffd807e2dab40) #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 96015 (syslogd) thread 0xffff800020ac0ee0 (66017) exclusive rrwlock inode r = 0 (0xfffffd806eb4b098) #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 9465 6322K 6322K 78643K 11652 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 105 3K 3K 78643K 10052 0 0 ifaddr 36 14K 15K 78643K 1383 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 529 0 0 iov 0 0K 40K 78643K 847 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1216 76K 76K 78643K 6354 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 148 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 1165 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 8 25K 33K 78643K 11271 0 0 sigio 0 0K 0K 78643K 127 0 0 proc 41 38K 70K 78643K 10405 0 0 subproc 34 2K 2K 78643K 3774 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 1348 0 0 in_multi 33 2K 2K 78643K 2782 0 0 ether_multi 1 0K 0K 78643K 63 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 3886 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 93 21K 31K 78643K 37792 0 0 UVM aobj 130 4K 4K 78643K 144 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 676 0 0 NDP 7 0K 0K 78643K 669 0 0 temp 121 3554K 3634K 78643K 52022 0 0 kqueue 0 0K 0K 78643K 143 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 449 0 443 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 909 0 907 1 0 1 1 0 8 0 rtentry 112 2468 0 2424 2 0 2 2 0 8 0 unpcb 120 4189 0 4179 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 3230 0 3230 2 2 0 2 0 8 0 tcpcb 544 2549 0 2545 1 0 1 1 0 8 0 ipq 40 17 0 17 10 10 0 1 0 8 0 ipqe 40 52 0 52 10 10 0 1 0 8 0 inpcb 280 6211 0 6204 5 4 1 2 0 8 0 nd6 48 666 0 660 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 10095 0 9903 26 13 13 13 0 8 1 art_table 32 10096 0 9903 2 0 2 2 0 8 0 art_node 16 2467 0 2427 1 0 1 1 0 8 0 sysvmsgpl 40 26 0 15 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 1163 0 1153 1 0 1 1 0 8 0 shmpl 112 142 0 14 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 12464 0 11006 48 0 48 48 0 8 0 ffsino 272 12464 0 11006 103 5 98 98 0 8 0 nchpl 144 25470 0 23835 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 110023 0 110023 3 2 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 73945 0 73945 43 42 1 6 0 8 1 plimitpl 152 1897 0 1887 1 0 1 1 0 8 0 sigapl 432 10782 0 10766 14 12 2 3 0 8 0 futexpl 56 100480 0 100480 3 2 1 1 0 8 1 knotepl 112 6717 0 6698 1 0 1 1 0 8 0 kqueuepl 104 2475 0 2473 1 0 1 1 0 8 0 pipepl 112 7126 0 7107 19 18 1 2 0 8 0 fdescpl 488 10783 0 10766 3 0 3 3 0 8 0 filepl 152 64989 0 64887 33 28 5 7 0 8 1 lockfpl 104 2111 0 2111 11 10 1 1 0 8 1 lockfspl 48 655 0 655 11 10 1 1 0 8 1 sessionpl 112 237 0 227 1 0 1 1 0 8 0 pgrppl 48 324 0 314 1 0 1 1 0 8 0 ucredpl 96 17047 0 17038 1 0 1 1 0 8 0 zombiepl 144 10767 0 10766 3 2 1 1 0 8 0 processpl 896 10799 0 10766 4 0 4 4 0 8 0 procpl 632 27940 0 27895 25 20 5 5 0 8 1 srpgc 64 440 0 440 20 19 1 1 0 8 1 sosppl 128 253 0 253 43 43 0 1 0 8 0 sockpl 384 11520 0 11501 18 15 3 4 0 8 1 mcl64k 65536 23 0 0 3 1 2 3 0 8 0 mcl16k 16384 16 0 0 2 0 2 2 0 8 0 mcl12k 12288 41 0 0 2 0 2 2 0 8 0 mcl9k 9216 46 0 0 3 1 2 2 0 8 0 mcl8k 8192 33 0 0 5 2 3 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 12 0 0 1 0 1 1 0 8 0 mcl2k 2048 305 0 0 36 14 22 36 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 697 0 0 20 2 18 20 0 8 0 bufpl 256 27256 0 20242 439 0 439 439 0 8 0 anonpl 16 1165257 0 1159061 273 227 46 47 0 124 8 amapchunkpl 152 88379 0 88289 135 128 7 18 0 158 2 amappl16 192 48368 0 47978 323 294 29 33 0 8 8 amappl15 184 1174 0 1174 21 20 1 1 0 8 1 amappl14 176 2559 0 2552 1 0 1 1 0 8 0 amappl13 168 2121 0 2116 1 0 1 1 0 8 0 amappl12 160 1261 0 1260 2 1 1 1 0 8 0 amappl11 152 1776 0 1765 1 0 1 1 0 8 0 amappl10 144 1690 0 1687 1 0 1 1 0 8 0 amappl9 136 4394 0 4388 1 0 1 1 0 8 0 amappl8 128 3184 0 3154 4 2 2 2 0 8 0 amappl7 120 2042 0 2033 1 0 1 1 0 8 0 amappl6 112 1200 0 1192 1 0 1 1 0 8 0 amappl5 104 2807 0 2797 1 0 1 1 0 8 0 amappl4 96 10885 0 10854 1 0 1 1 0 8 0 amappl3 88 2692 0 2682 1 0 1 1 0 8 0 amappl2 80 69344 0 69264 3 0 3 3 0 8 0 amappl1 72 301262 0 300795 23 13 10 19 0 8 0 amappl 80 31559 0 31521 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 143 0 14 3 0 3 3 0 8 0 uaddrrnd 24 10783 0 10766 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 10783 0 10766 1 0 1 1 0 8 0 vmmpekpl 168 94900 0 94867 2 0 2 2 0 8 0 vmmpepl 168 1385503 0 1383790 317 233 84 94 0 357 9 vmsppl 368 10782 0 10766 2 0 2 2 0 8 0 pdppl 4096 21573 0 21532 6 0 6 6 0 8 0 pvpl 32 3161260 0 3151763 559 436 123 129 0 265 26 pmappl 232 10782 0 10766 22 21 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 655 0 41 18 0 18 18 0 8 0