witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd80645f75f8) #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_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 141037 38329 0 0 0 1 syz-executor.1 *114171 6136 0 0 0x4000000 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,ffffffff81fbb6f4) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbb6f4) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b29160) at userret+0x36a sys/kern/kern_sig.c:1911 syscall(ffff800023e59bb0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800023e59bb0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,d,0,3,41a1d8891b0) at Xsyscall+0x128 end of kernel end trace frame: 0x41c35e44960, 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,ffffffff81fbb6f4) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbb6f4) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b29160) at userret+0x36a sys/kern/kern_sig.c:1911 syscall(ffff800023e59bb0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800023e59bb0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,d,0,3,41a1d8891b0) at Xsyscall+0x128 end of kernel end trace frame: 0x41c35e44960, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800023e598f0 rbx 0xffff800023e599a0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800021004000 rax 0xffff80000097c980 r8 0xffffffff81c83d13 kprintf+0x173 r9 0x1 r10 0x25 r11 0x53750113fef3ca8f r12 0x3000000008 r13 0xffff800023e59900 r14 0x100 r15 0x1 rip 0xffffffff81a69fa8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023e598e0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=114171 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b28018,0xffff800020b28ef8 process=0xffff800020b7dc00 user=0xffff800023e54000, vmspace=0xfffffd807f00ba10 estcpu=36, cpticks=4, pctcpu=0.0 user=0, sys=4, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 38329 141037 23256 0 7 0 syz-executor.1 38329 141310 23256 0 3 0x4000000 inode syz-executor.1 38329 215157 23256 0 3 0x4000080 fsleep syz-executor.1 6136 326886 97776 0 2 0 syz-executor.0 6136 306968 97776 0 3 0x4000080 fsleep syz-executor.0 6136 122016 97776 0 2 0x4000000 syz-executor.0 * 6136 114171 97776 0 7 0x4000000 syz-executor.0 69074 330773 0 0 3 0x14200 bored sosplice 23256 421600 24503 0 3 0x82 nanosleep syz-executor.1 97776 253787 24503 0 3 0x82 nanosleep syz-executor.0 24503 280612 28662 0 3 0x82 thrsleep syz-fuzzer 24503 139339 28662 0 2 0x4000482 syz-fuzzer 24503 40817 28662 0 3 0x4000082 thrsleep syz-fuzzer 24503 342538 28662 0 3 0x4000082 thrsleep syz-fuzzer 24503 358081 28662 0 3 0x4000082 thrsleep syz-fuzzer 24503 192410 28662 0 3 0x4000082 kqread syz-fuzzer 24503 292196 28662 0 3 0x4000082 thrsleep syz-fuzzer 24503 501012 28662 0 3 0x4000082 thrsleep syz-fuzzer 24503 202434 28662 0 3 0x4000082 thrsleep syz-fuzzer 24503 89235 28662 0 3 0x4000082 thrsleep syz-fuzzer 28662 427309 85357 0 3 0x10008a pause ksh 85357 164214 27329 0 3 0x92 select sshd 82015 344455 1 0 3 0x100083 ttyin getty 27329 269115 1 0 3 0x80 select sshd 8227 428017 91308 74 3 0x100092 bpf pflogd 91308 64100 1 0 3 0x80 netio pflogd 48087 322104 20450 73 2 0x100090 syslogd 20450 398651 1 0 3 0x100082 netio syslogd 26644 382476 1 77 3 0x100090 poll dhclient 45179 431870 1 0 3 0x80 poll dhclient 68372 219573 0 0 2 0x14200 zerothread 75149 483453 0 0 3 0x14200 aiodoned aiodoned 77644 133363 0 0 3 0x14200 syncer update 80077 463667 0 0 3 0x14200 cleaner cleaner 80582 338611 0 0 3 0x14200 reaper reaper 77754 198511 0 0 3 0x14200 pgdaemon pagedaemon 29463 206563 0 0 3 0x14200 bored crynlk 355 227441 0 0 3 0x14200 bored crypto 51501 56631 0 0 3 0x40014200 acpi0 acpi0 69765 26376 0 0 3 0x40014200 idle1 31067 270800 0 0 3 0x14200 bored softnet 56069 269644 0 0 3 0x14200 bored systqmp 26142 426830 0 0 3 0x14200 bored systq 51640 234907 0 0 3 0x40014200 bored softclock 32372 60236 0 0 3 0x40014200 idle0 18422 66485 0 0 3 0x14200 bored smr 1 369794 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 6136 (syz-executor.0) thread 0xffff800020b29160 (114171) exclusive rrwlock inode r = 0 (0xfffffd80645f75f8) #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_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 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9535 6545K 7174K 78643K 13133 0 0 pcb 13 8K 8K 78643K 76 0 0 rtable 108 4K 4K 78643K 367 0 0 ifaddr 60 14K 14K 78643K 147 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1521 0 0 iov 0 0K 16K 78643K 120 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1212 76K 77K 78643K 2082 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 9 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 101 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 997 0 0 sigio 0 0K 0K 78643K 19 0 0 proc 54 51K 83K 78643K 537 0 0 subproc 32 2K 2K 78643K 34 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 98 0 0 in_multi 33 2K 2K 78643K 67 0 0 ether_multi 1 0K 0K 78643K 4 0 0 mrt 0 0K 0K 78643K 6 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 310 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 97 21K 30K 78643K 4168 0 0 UVM aobj 32 3K 3K 78643K 44 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 27 0 0 NDP 12 0K 0K 78643K 37 0 0 temp 172 2747K 2873K 78643K 6271 0 0 kqueue 0 0K 0K 78643K 6 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 6 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 47 0 45 1 0 1 1 0 8 0 rtentry 112 47 0 3 2 0 2 2 0 8 0 unpcb 120 306 0 296 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 8431 0 8431 2 2 0 2 0 8 0 tcpcb 544 132 0 128 1 0 1 1 0 8 0 inpcb 280 416 0 409 1 0 1 1 0 8 0 rttmr 72 2 0 2 2 2 0 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 6 0 6 2 2 0 1 0 8 0 ppxss 1128 21 0 21 4 3 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 27 0 18 1 0 1 1 0 8 0 pfstkey 112 27 0 18 1 0 1 1 0 8 0 pfstate 328 27 0 18 2 0 2 2 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 189 0 0 12 0 12 12 0 8 0 art_table 32 190 0 0 2 0 2 2 0 8 0 art_node 16 46 0 6 1 0 1 1 0 8 0 sysvmsgpl 40 5 0 1 1 0 1 1 0 8 0 semapl 112 99 0 89 1 0 1 1 0 8 0 shmpl 112 42 0 12 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3034 0 1614 47 0 47 47 0 8 0 ffsino 272 3034 0 1614 96 0 96 96 0 8 0 nchpl 144 4653 0 3005 62 0 62 62 0 8 0 uvmvnodes 72 3642 0 0 67 0 67 67 0 8 0 vnodes 200 3642 0 0 192 0 192 192 0 8 0 namei 1024 14067 0 14067 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 1 0 1 1 1 0 1 0 8 0 scxspl 192 12790 0 12790 10 9 1 6 0 8 1 plimitpl 152 131 0 123 1 0 1 1 0 8 0 sigapl 432 1197 0 1181 3 1 2 3 0 8 0 futexpl 56 12315 0 12313 1 0 1 1 0 8 0 knotepl 112 170 0 151 1 0 1 1 0 8 0 kqueuepl 104 186 0 184 1 0 1 1 0 8 0 pipepl 112 724 0 705 3 2 1 2 0 8 0 fdescpl 488 1198 0 1181 3 0 3 3 0 8 0 filepl 152 7113 0 7009 8 3 5 7 0 8 0 lockfpl 104 339 0 339 2 1 1 1 0 8 1 lockfspl 48 120 0 120 2 1 1 1 0 8 1 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 24 0 13 1 0 1 1 0 8 0 ucredpl 96 1405 0 1396 1 0 1 1 0 8 0 zombiepl 144 1181 0 1181 3 2 1 1 0 8 1 processpl 896 1214 0 1181 4 0 4 4 0 8 0 procpl 632 3374 0 3327 7 2 5 5 0 8 1 srpgc 64 2 0 2 2 2 0 1 0 8 0 sosppl 128 8 0 8 3 3 0 1 0 8 0 sockpl 384 785 0 766 5 2 3 4 0 8 1 mcl64k 65536 9 0 0 2 0 2 2 0 8 0 mcl16k 16384 3 0 0 1 0 1 1 0 8 0 mcl12k 12288 8 0 0 1 0 1 1 0 8 0 mcl9k 9216 7 0 0 1 0 1 1 0 8 0 mcl8k 8192 6 0 0 1 0 1 1 0 8 0 mcl4k 4096 11 0 0 2 0 2 2 0 8 0 mcl2k2 2112 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 211 0 0 25 0 25 25 0 8 0 mtagpl 80 26 0 0 1 0 1 1 0 8 0 mbufpl 256 235 0 0 14 0 14 14 0 8 0 bufpl 256 7569 0 1172 400 0 400 400 0 8 0 anonpl 16 127629 0 115675 89 28 61 65 0 125 12 amapchunkpl 152 7073 0 6958 19 9 10 10 0 158 4 amappl16 192 6110 0 5455 70 33 37 45 0 8 4 amappl15 184 8 0 7 1 0 1 1 0 8 0 amappl14 176 64 0 56 1 0 1 1 0 8 0 amappl13 168 7 0 7 1 1 0 1 0 8 0 amappl12 160 13 0 13 1 1 0 1 0 8 0 amappl11 152 57 0 42 1 0 1 1 0 8 0 amappl10 144 549 0 541 1 0 1 1 0 8 0 amappl9 136 1094 0 1089 1 0 1 1 0 8 0 amappl8 128 641 0 622 1 0 1 1 0 8 0 amappl7 120 505 0 500 1 0 1 1 0 8 0 amappl6 112 61 0 52 1 0 1 1 0 8 0 amappl5 104 138 0 124 1 0 1 1 0 8 0 amappl4 96 1460 0 1431 2 1 1 2 0 8 0 amappl3 88 206 0 195 1 0 1 1 0 8 0 amappl2 80 8671 0 8588 4 2 2 3 0 8 0 amappl1 72 34981 0 34517 24 14 10 19 0 8 0 amappl 80 3633 0 3591 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 43 0 12 1 0 1 1 0 8 0 uaddrrnd 24 1198 0 1181 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1198 0 1181 1 0 1 1 0 8 0 vmmpekpl 168 12814 0 12781 2 0 2 2 0 8 0 vmmpepl 168 150871 0 148964 140 54 86 93 0 357 3 vmsppl 368 1197 0 1181 2 0 2 2 0 8 0 pdppl 4096 2404 0 2362 6 0 6 6 0 8 0 pvpl 32 358382 0 343168 204 49 155 160 0 265 30 pmappl 232 1197 0 1181 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 572 0 4 17 0 17 17 0 8 0