witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd806b8583d8) #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 *497182 58245 32767 0x1010 0x4080000 0 syz-executor.1 76993 55651 73 0x100010 0 1 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,ffffffff82208375) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff82208375) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020acf658) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024f5fe80) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024f5fe80) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,db4086a1010) at Xsyscall+0x128 end of kernel end trace frame: 0xdb66b170900, 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,ffffffff82208375) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff82208375) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020acf658) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024f5fe80) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024f5fe80) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,db4086a1010) at Xsyscall+0x128 end of kernel end trace frame: 0xdb66b170900, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800024f5fbc0 rbx 0xffff800024f5fc70 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800022d54000 rax 0xffff800000a6dd80 r8 0xffffffff81de8423 kprintf+0x173 r9 0x1 r10 0x25 r11 0x4de55dfae87db373 r12 0x3000000008 r13 0xffff800024f5fbd0 r14 0x100 r15 0x1 rip 0xffffffff81e723a8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024f5fbb0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=497182 stat=onproc flags process=1010 proc=4080000 pri=32, usrpri=81, nice=20 forw=0xffffffffffffffff, list=0xffff800020acf3e0,0xffffffff82660d00 process=0xffff800020a8aa90 user=0xffff800024f5a000, vmspace=0xfffffd807f00bb80 estcpu=36, cpticks=6, pctcpu=0.0 user=0, sys=4, intr=1 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 58245 172730 55115 32767 3 0x3010 suspend syz-executor.1 *58245 497182 55115 32767 7 0x4081010 syz-executor.1 55115 17286 62374 32767 3 0x90 nanosleep syz-executor.1 62374 206121 70448 0 3 0x82 wait syz-executor.1 570 414096 0 0 3 0x14200 bored sosplice 70448 458518 66355 0 3 0x82 thrsleep syz-fuzzer 70448 345230 66355 0 3 0x4000082 thrsleep syz-fuzzer 70448 63961 66355 0 3 0x4000082 thrsleep syz-fuzzer 70448 192841 66355 0 3 0x4000082 thrsleep syz-fuzzer 70448 348590 66355 0 3 0x4000082 thrsleep syz-fuzzer 70448 178430 66355 0 3 0x4000082 thrsleep syz-fuzzer 70448 73785 66355 0 3 0x4000082 thrsleep syz-fuzzer 70448 393856 66355 0 3 0x4000082 thrsleep syz-fuzzer 70448 125358 66355 0 3 0x4000082 kqread syz-fuzzer 70448 288376 66355 0 3 0x4000082 thrsleep syz-fuzzer 66355 150006 66650 0 3 0x10008a pause ksh 66650 380870 77037 0 3 0x92 select sshd 57869 57583 1 0 3 0x100083 ttyin getty 77037 174981 1 0 3 0x80 select sshd 55651 76993 33795 73 7 0x100010 syslogd 33795 261138 1 0 3 0x100082 netio syslogd 52484 400048 1 77 3 0x100090 poll dhclient 63103 288882 1 0 3 0x80 poll dhclient 34517 261784 0 0 3 0x14200 pgzero zerothread 50574 292121 0 0 3 0x14200 aiodoned aiodoned 36063 337770 0 0 3 0x14200 syncer update 96288 89667 0 0 3 0x14200 cleaner cleaner 4483 19578 0 0 3 0x14200 reaper reaper 90290 323371 0 0 3 0x14200 pgdaemon pagedaemon 97952 222402 0 0 3 0x14200 bored crynlk 75013 352048 0 0 3 0x14200 bored crypto 19262 686 0 0 3 0x40014200 acpi0 acpi0 83810 498466 0 0 3 0x40014200 idle1 49247 394133 0 0 3 0x14200 bored softnet 1227 474212 0 0 3 0x14200 bored systqmp 20546 397429 0 0 3 0x14200 bored systq 26467 173959 0 0 3 0x40014200 bored softclock 65511 139717 0 0 3 0x40014200 idle0 1616 294670 0 0 3 0x14200 bored smr 1 413055 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 58245 (syz-executor.1) thread 0xffff800020acf658 (497182) exclusive rrwlock inode r = 0 (0xfffffd806b8583d8) #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 55651 (syslogd) thread 0xffff800020ac0288 (76993) exclusive rrwlock inode r = 0 (0xfffffd806eb42098) #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 11360 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 83 2K 3K 78643K 7436 0 0 ifaddr 30 13K 15K 78643K 1040 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 363 0 0 iov 0 0K 40K 78643K 558 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 76K 78643K 4962 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 85 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 800 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 33K 78643K 7668 0 0 sigio 0 0K 0K 78643K 73 0 0 proc 41 38K 78K 78643K 7622 0 0 subproc 17 1K 2K 78643K 2788 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 874 0 0 in_multi 22 1K 2K 78643K 2036 0 0 ether_multi 1 0K 0K 78643K 50 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 2726 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 104 13K 32K 78643K 26253 0 0 UVM aobj 130 4K 4K 78643K 155 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 373 0 0 NDP 4 0K 0K 78643K 495 0 0 temp 97 3541K 3622K 78643K 37673 0 0 kqueue 0 0K 0K 78643K 77 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 332 0 328 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 596 0 594 1 0 1 1 0 8 0 rtentry 112 1829 0 1796 2 0 2 2 0 8 0 unpcb 120 2914 0 2906 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 4684 0 4684 1 1 0 1 0 8 0 tcpcb 544 1674 0 1670 1 0 1 1 0 8 0 ipq 40 1 0 1 1 1 0 1 0 8 0 ipqe 40 3 0 3 1 1 0 1 0 8 0 inpcb 280 4090 0 4083 7 6 1 2 0 8 0 nd6 48 492 0 489 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 7540 0 7392 21 9 12 13 0 8 1 art_table 32 7541 0 7392 2 0 2 2 0 8 0 art_node 16 1828 0 1798 1 0 1 1 0 8 0 sysvmsgpl 40 18 0 14 2 1 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 796 0 786 1 0 1 1 0 8 0 shmpl 112 153 0 25 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 8708 0 7258 48 1 47 47 0 8 0 ffsino 272 8708 0 7258 97 0 97 97 0 8 0 nchpl 144 17426 0 15795 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 76431 0 76431 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 49863 0 49863 24 23 1 7 0 8 1 plimitpl 152 1370 0 1362 1 0 1 1 0 8 0 sigapl 432 7353 0 7340 8 6 2 3 0 8 0 futexpl 56 63016 0 63016 1 0 1 1 0 8 1 knotepl 112 4865 0 4848 2 1 1 2 0 8 0 kqueuepl 104 1593 0 1591 1 0 1 1 0 8 0 pipepl 112 4754 0 4739 16 14 2 2 0 8 1 fdescpl 488 7354 0 7340 3 0 3 3 0 8 1 filepl 152 44403 0 44320 27 20 7 7 0 8 2 lockfpl 104 1383 0 1383 13 12 1 1 0 8 1 lockfspl 48 406 0 406 13 12 1 1 0 8 1 sessionpl 112 179 0 170 1 0 1 1 0 8 0 pgrppl 48 239 0 230 1 0 1 1 0 8 0 ucredpl 96 12025 0 12017 1 0 1 1 0 8 0 zombiepl 144 7341 0 7339 2 1 1 1 0 8 0 processpl 896 7370 0 7339 4 0 4 4 0 8 0 procpl 632 18780 0 18739 20 15 5 5 0 8 1 srpgc 64 326 0 326 19 18 1 1 0 8 1 sosppl 128 137 0 137 30 30 0 1 0 8 0 sockpl 384 7717 0 7700 12 8 4 4 0 8 2 mcl64k 65536 12 0 0 2 0 2 2 0 8 0 mcl16k 16384 10 0 0 2 0 2 2 0 8 0 mcl12k 12288 30 0 0 2 0 2 2 0 8 0 mcl9k 9216 26 0 0 2 0 2 2 0 8 0 mcl8k 8192 17 0 0 3 1 2 3 0 8 0 mcl4k 4096 17 0 0 3 1 2 3 0 8 0 mcl2k2 2112 8 0 0 1 0 1 1 0 8 0 mcl2k 2048 184 0 0 21 7 14 21 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 525 0 0 14 2 12 14 0 8 0 bufpl 256 15692 0 8678 439 0 439 439 0 8 0 anonpl 16 773088 0 766624 188 146 42 50 0 124 3 amapchunkpl 152 61388 0 61272 96 86 10 19 0 158 5 amappl16 192 30964 0 30582 214 189 25 32 0 8 4 amappl15 184 1257 0 1253 1 0 1 1 0 8 0 amappl14 176 2122 0 2116 1 0 1 1 0 8 0 amappl13 168 1085 0 1085 17 17 0 1 0 8 0 amappl12 160 703 0 702 2 1 1 1 0 8 0 amappl11 152 982 0 971 1 0 1 1 0 8 0 amappl10 144 1201 0 1200 1 0 1 1 0 8 0 amappl9 136 3554 0 3552 1 0 1 1 0 8 0 amappl8 128 2639 0 2603 4 2 2 2 0 8 0 amappl7 120 1496 0 1484 1 0 1 1 0 8 0 amappl6 112 581 0 569 1 0 1 1 0 8 0 amappl5 104 1908 0 1898 1 0 1 1 0 8 0 amappl4 96 7518 0 7491 1 0 1 1 0 8 0 amappl3 88 1649 0 1639 1 0 1 1 0 8 0 amappl2 80 46401 0 46333 3 0 3 3 0 8 0 amappl1 72 210481 0 210056 23 13 10 19 0 8 0 amappl 80 21545 0 21507 2 0 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 154 0 25 3 0 3 3 0 8 0 uaddrrnd 24 7354 0 7340 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 7354 0 7340 1 0 1 1 0 8 0 vmmpekpl 168 62442 0 62413 2 0 2 2 0 8 0 vmmpepl 168 949752 0 948276 235 155 80 93 0 357 8 vmsppl 368 7353 0 7340 2 0 2 2 0 8 0 pdppl 4096 14715 0 14680 6 0 6 6 0 8 1 pvpl 32 2172190 0 2162535 435 319 116 130 0 265 19 pmappl 232 7353 0 7340 13 12 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 619 0 23 18 0 18 18 0 8 0