witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd8065cdde70) #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 panic: witness_warn Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *452014 62811 32767 0x10 0x4000000 0 syz-executor.0 392988 15428 73 0x100010 0 1K 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,ffffffff822095c0) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff822095c0) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020a88020) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024f6fa30) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024f6fa30) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,0,fffffffffffffee5,0,1,fd55f33e1b0) at Xsyscall+0x128 end of kernel end trace frame: 0xfd7e652c930, 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,ffffffff822095c0) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff822095c0) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020a88020) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024f6fa30) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024f6fa30) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,0,fffffffffffffee5,0,1,fd55f33e1b0) at Xsyscall+0x128 end of kernel end trace frame: 0xfd7e652c930, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800024f6f770 rbx 0xffff800024f6f820 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800023164000 rax 0xffff800000a75280 r8 0xffffffff82080113 kprintf+0x173 r9 0x1 r10 0x25 r11 0xa0d7d2e45b9c8087 r12 0x3000000008 r13 0xffff800024f6f780 r14 0x100 r15 0x1 rip 0xffffffff81ad8718 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024f6f760 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=452014 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020a88788,0xffffffff8263d3f0 process=0xffff800020a8a710 user=0xffff800024f6a000, vmspace=0xfffffd806e8bb8a8 estcpu=36, cpticks=4, pctcpu=0.0 user=0, sys=4, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 62811 460722 76975 32767 2 0x10 syz-executor.0 62811 488023 76975 32767 3 0x4000090 fsleep syz-executor.0 62811 394664 76975 32767 2 0x4000010 syz-executor.0 *62811 452014 76975 32767 7 0x4000010 syz-executor.0 76975 115621 39480 32767 2 0x490 syz-executor.0 39480 277626 22207 0 3 0x82 wait syz-executor.0 55854 464766 0 0 3 0x14200 bored sosplice 22207 39544 14759 0 3 0x82 thrsleep syz-fuzzer 22207 243189 14759 0 2 0x4000482 syz-fuzzer 22207 515338 14759 0 3 0x4000082 thrsleep syz-fuzzer 22207 419932 14759 0 3 0x4000082 thrsleep syz-fuzzer 22207 396543 14759 0 3 0x4000082 kqread syz-fuzzer 22207 170077 14759 0 3 0x4000082 thrsleep syz-fuzzer 22207 241900 14759 0 3 0x4000082 thrsleep syz-fuzzer 22207 35827 14759 0 3 0x4000082 thrsleep syz-fuzzer 22207 501132 14759 0 3 0x4000082 thrsleep syz-fuzzer 22207 307431 14759 0 3 0x4000082 thrsleep syz-fuzzer 14759 415603 20051 0 3 0x10008a pause ksh 20051 413081 53854 0 3 0x92 select sshd 76436 371327 1 0 3 0x100083 ttyin getty 53854 75286 1 0 3 0x80 select sshd 15428 392988 70094 73 7 0x100010 syslogd 70094 163795 1 0 3 0x100082 netio syslogd 29307 76020 1 77 3 0x100090 poll dhclient 65531 448876 1 0 3 0x80 poll dhclient 25087 164550 0 0 3 0x14200 pgzero zerothread 19287 458591 0 0 3 0x14200 aiodoned aiodoned 65583 451167 0 0 3 0x14200 syncer update 23116 38784 0 0 3 0x14200 cleaner cleaner 41706 175713 0 0 3 0x14200 reaper reaper 55350 252000 0 0 3 0x14200 pgdaemon pagedaemon 89127 485132 0 0 3 0x14200 bored crynlk 10621 158325 0 0 3 0x14200 bored crypto 99878 217147 0 0 3 0x40014200 acpi0 acpi0 82331 477472 0 0 3 0x40014200 idle1 37985 311452 0 0 3 0x14200 bored softnet 97050 231590 0 0 3 0x14200 bored systqmp 34958 453195 0 0 3 0x14200 bored systq 79070 437435 0 0 3 0x40014200 bored softclock 36910 269424 0 0 3 0x40014200 idle0 36164 474249 0 0 3 0x14200 bored smr 1 361503 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 62811 (syz-executor.0) thread 0xffff800020a88020 (452014) exclusive rrwlock inode r = 0 (0xfffffd8065cdde70) #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 Process 15428 (syslogd) thread 0xffff800020ac0288 (392988) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8265bca8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 __mp_acquire_count+0x51 sys/kern/kern_lock.c:227 #2 mi_switch+0x38f sys/kern/sched_bsd.c:441 #3 sleep_finish+0x113 sys/kern/kern_synch.c:373 #4 tsleep+0x198 sleep_finish_timeout sys/kern/kern_synch.c:397 [inline] #4 tsleep+0x198 sleep_finish_all sys/kern/kern_synch.c:183 [inline] #4 tsleep+0x198 sys/kern/kern_synch.c:152 #5 vwaitforio+0x9d sys/kern/vfs_subr.c:1869 #6 ffs_fsync+0x3c5 sys/ufs/ffs/ffs_vnops.c:495 #7 VOP_FSYNC+0xc7 sys/kern/vfs_vops.c:352 #8 sys_fsync+0x128 sys/kern/vfs_syscalls.c:2806 #9 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #9 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #10 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806eb6b1a8) #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 9458 6319K 6322K 78643K 12385 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 83 2K 3K 78643K 16686 0 0 ifaddr 31 17K 21K 78643K 2278 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 918 0 0 iov 0 0K 32K 78643K 1477 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 76K 78643K 10162 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 204 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 2260 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 33K 78643K 19650 0 0 sigio 0 0K 0K 78643K 214 0 0 proc 41 38K 70K 78643K 17126 0 0 subproc 17 1K 2K 78643K 6273 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 2411 0 0 in_multi 22 1K 2K 78643K 4625 0 0 ether_multi 1 0K 0K 78643K 111 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 66 291K 291K 78643K 66 0 0 exec 0 0K 1K 78643K 6220 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 113 14K 32K 78643K 64924 0 0 UVM aobj 130 4K 4K 78643K 149 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 1370 0 0 NDP 4 0K 0K 78643K 1110 0 0 temp 97 3553K 3634K 78643K 86759 0 0 kqueue 0 0K 0K 78643K 259 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 742 0 738 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 1657 0 1655 1 0 1 1 0 8 0 rtentry 112 4084 0 4051 2 0 2 2 0 8 0 unpcb 120 7669 0 7661 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 4078 0 4078 1 1 0 1 0 8 0 tcpcb 544 4427 0 4423 1 0 1 1 0 8 0 ipq 40 18 0 18 11 11 0 1 0 8 0 ipqe 40 36 0 36 11 11 0 1 0 8 0 inpcb 280 11192 0 11180 28 26 2 2 0 8 1 nd6 48 1107 0 1104 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 16782 0 16632 27 14 13 13 0 8 1 art_table 32 16783 0 16632 2 0 2 2 0 8 0 art_node 16 4083 0 4053 1 0 1 1 0 8 0 sysvmsgpl 40 52 0 37 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 2256 0 2246 1 0 1 1 0 8 0 shmpl 112 147 0 19 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 21179 0 19701 48 0 48 48 0 8 0 ffsino 272 21179 0 19701 106 7 99 100 0 8 0 nchpl 144 44062 0 42440 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 189539 0 189539 4 3 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 122998 0 122997 72 71 1 6 0 8 0 plimitpl 152 3266 0 3259 1 0 1 1 0 8 0 sigapl 432 18720 0 18707 20 17 3 3 0 8 1 futexpl 56 182004 0 182003 3 2 1 1 0 8 0 knotepl 112 11544 0 11531 2 1 1 2 0 8 0 kqueuepl 104 4339 0 4337 1 0 1 1 0 8 0 pipepl 112 12446 0 12433 24 22 2 2 0 8 1 fdescpl 488 18721 0 18707 3 0 3 3 0 8 0 filepl 152 115303 0 115224 34 29 5 7 0 8 1 lockfpl 104 3427 0 3427 21 20 1 1 0 8 1 lockfspl 48 1093 0 1093 21 20 1 1 0 8 1 sessionpl 112 384 0 375 1 0 1 1 0 8 0 pgrppl 48 619 0 610 1 0 1 1 0 8 0 ucredpl 96 31765 0 31757 1 0 1 1 0 8 0 zombiepl 144 18707 0 18707 3 2 1 1 0 8 1 processpl 896 18737 0 18707 4 0 4 4 0 8 0 procpl 632 49041 0 48999 54 49 5 5 0 8 1 srpgc 64 736 0 736 50 49 1 1 0 8 1 sosppl 128 440 0 440 78 77 1 1 0 8 1 sockpl 384 20853 0 20836 15 12 3 4 0 8 1 mcl64k 65536 41 0 0 4 1 3 3 0 8 0 mcl16k 16384 38 0 0 5 3 2 3 0 8 0 mcl12k 12288 80 0 0 3 1 2 2 0 8 0 mcl9k 9216 59 0 0 3 1 2 2 0 8 0 mcl8k 8192 33 0 0 4 1 3 3 0 8 0 mcl4k 4096 38 0 0 4 2 2 3 0 8 0 mcl2k2 2112 17 0 0 2 0 2 2 0 8 0 mcl2k 2048 194 0 0 20 6 14 20 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 1142 0 0 14 1 13 13 0 8 0 bufpl 256 37827 0 30813 439 0 439 439 0 8 0 anonpl 16 1990804 0 1984763 402 360 42 48 0 124 0 amapchunkpl 152 145956 0 145870 141 135 6 18 0 158 2 amappl16 192 86150 0 85753 551 527 24 34 0 8 0 amappl15 184 3082 0 3080 36 35 1 1 0 8 0 amappl14 176 5384 0 5374 1 0 1 1 0 8 0 amappl13 168 3259 0 3258 1 0 1 1 0 8 0 amappl12 160 1905 0 1904 2 1 1 1 0 8 0 amappl11 152 2600 0 2589 1 0 1 1 0 8 0 amappl10 144 3479 0 3478 35 34 1 1 0 8 0 amappl9 136 6997 0 6994 1 0 1 1 0 8 0 amappl8 128 5223 0 5172 4 2 2 2 0 8 0 amappl7 120 4001 0 3993 1 0 1 1 0 8 0 amappl6 112 1642 0 1633 1 0 1 1 0 8 0 amappl5 104 4566 0 4556 1 0 1 1 0 8 0 amappl4 96 18292 0 18264 1 0 1 1 0 8 0 amappl3 88 5086 0 5076 1 0 1 1 0 8 0 amappl2 80 122114 0 122046 3 1 2 3 0 8 0 amappl1 72 514450 0 514022 23 13 10 19 0 8 0 amappl 80 54827 0 54793 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 148 0 19 3 0 3 3 0 8 0 uaddrrnd 24 18721 0 18707 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 18721 0 18707 1 0 1 1 0 8 0 vmmpekpl 168 154127 0 154095 2 0 2 2 0 8 0 vmmpepl 168 2410562 0 2409071 452 367 85 97 0 357 8 vmsppl 368 18720 0 18707 2 0 2 2 0 8 0 pdppl 4096 37449 0 37414 7 1 6 6 0 8 1 pvpl 32 5402817 0 5393663 896 790 106 128 0 265 6 pmappl 232 18720 0 18707 37 35 2 2 0 8 1 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 643 0 41 18 0 18 18 0 8 0