witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd8069a4c3c8) #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 299693 33392 32767 0x10 0 1 syz-executor.1 *466020 52809 32767 0x10 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,ffffffff822044dc) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff822044dc) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020a88290) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024f77960) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024f77960) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,661d45a81b0) at Xsyscall+0x128 end of kernel end trace frame: 0x664749eae90, 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,ffffffff822044dc) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff822044dc) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020a88290) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800024f77960) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800024f77960) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,c,0,3,661d45a81b0) at Xsyscall+0x128 end of kernel end trace frame: 0x664749eae90, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800024f776a0 rbx 0xffff800024f77750 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800022f2e000 rax 0xffff800000a6ddc0 r8 0xffffffff820a5e13 kprintf+0x173 r9 0x1 r10 0x25 r11 0x18c80cbd970c1172 r12 0x3000000008 r13 0xffff800024f776b0 r14 0x100 r15 0x1 rip 0xffffffff810a7a88 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024f77690 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=466020 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020a898c8,0xffff800020a88518 process=0xffff800020add180 user=0xffff800024f72000, vmspace=0xfffffd807f00b730 estcpu=36, cpticks=5, pctcpu=0.0 user=0, sys=5, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 33392 299693 66781 32767 7 0x10 syz-executor.1 33392 101890 66781 32767 2 0x4000010 syz-executor.1 33392 40233 66781 32767 2 0x4000010 syz-executor.1 52809 382109 18298 32767 2 0x10 syz-executor.0 52809 372331 18298 32767 2 0x4000010 syz-executor.0 52809 41068 18298 32767 2 0x4000010 syz-executor.0 *52809 466020 18298 32767 7 0x4000010 syz-executor.0 66781 17647 84271 32767 2 0x490 syz-executor.1 84271 350160 718 0 3 0x82 wait syz-executor.1 18298 468093 98668 32767 2 0x490 syz-executor.0 98668 521261 718 0 3 0x82 wait syz-executor.0 47383 508553 0 0 3 0x14200 bored sosplice 718 156164 38543 0 3 0x82 thrsleep syz-fuzzer 718 452025 38543 0 2 0x4000482 syz-fuzzer 718 249995 38543 0 3 0x4000082 thrsleep syz-fuzzer 718 417829 38543 0 3 0x4000082 thrsleep syz-fuzzer 718 465823 38543 0 3 0x4000082 thrsleep syz-fuzzer 718 203561 38543 0 3 0x4000082 thrsleep syz-fuzzer 718 463432 38543 0 3 0x4000082 thrsleep syz-fuzzer 718 127766 38543 0 2 0x4000482 syz-fuzzer 718 11261 38543 0 3 0x4000082 thrsleep syz-fuzzer 718 193871 38543 0 3 0x4000082 kqread syz-fuzzer 38543 327914 61720 0 3 0x10008a pause ksh 61720 485576 45858 0 3 0x92 select sshd 46462 337480 1 0 3 0x100083 ttyin getty 45858 52271 1 0 3 0x80 select sshd 59094 463350 99981 73 2 0x100090 syslogd 99981 290992 1 0 3 0x100082 netio syslogd 27369 136115 1 77 3 0x100090 poll dhclient 9043 197980 1 0 3 0x80 poll dhclient 78047 420268 0 0 2 0x14200 zerothread 55546 188541 0 0 3 0x14200 aiodoned aiodoned 60495 56929 0 0 3 0x14200 syncer update 44664 30591 0 0 3 0x14200 cleaner cleaner 77909 358903 0 0 3 0x14200 reaper reaper 84793 155689 0 0 3 0x14200 pgdaemon pagedaemon 15128 233143 0 0 3 0x14200 bored crynlk 84361 131811 0 0 3 0x14200 bored crypto 82169 93869 0 0 3 0x40014200 acpi0 acpi0 88357 168660 0 0 3 0x40014200 idle1 18220 331278 0 0 3 0x14200 bored softnet 28927 20559 0 0 3 0x14200 bored systqmp 26432 115293 0 0 3 0x14200 bored systq 43762 424131 0 0 2 0x40014200 softclock 68011 22360 0 0 3 0x40014200 idle0 89957 381915 0 0 3 0x14200 bored smr 1 207994 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 52809 (syz-executor.0) thread 0xffff800020a88290 (466020) exclusive rrwlock inode r = 0 (0xfffffd8069a4c3c8) #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 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9462 6321K 6321K 78643K 10839 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 105 3K 3K 78643K 2788 0 0 ifaddr 35 10K 10K 78643K 394 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 136 0 0 iov 0 0K 28K 78643K 212 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 76K 78643K 2635 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 47 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 346 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 8 25K 33K 78643K 3036 0 0 sigio 0 0K 0K 78643K 31 0 0 proc 41 38K 70K 78643K 2913 0 0 subproc 34 2K 2K 78643K 1020 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 360 0 0 in_multi 33 2K 2K 78643K 758 0 0 ether_multi 1 0K 0K 78643K 17 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 60 265K 265K 78643K 60 0 0 exec 0 0K 1K 78643K 1135 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 94 21K 30K 78643K 10800 0 0 UVM aobj 130 7K 7K 78643K 138 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 160 0 0 NDP 7 0K 0K 78643K 183 0 0 temp 121 3542K 3622K 78643K 16070 0 0 kqueue 0 0K 0K 78643K 55 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 122 0 116 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 267 0 265 1 0 1 1 0 8 0 rtentry 112 683 0 639 2 0 2 2 0 8 0 unpcb 120 1225 0 1217 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 3996 0 3996 1 1 0 1 0 8 0 tcpcb 544 630 0 626 1 0 1 1 0 8 0 inpcb 280 1595 0 1588 3 1 2 2 0 8 1 nd6 48 180 0 174 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 2818 0 2626 14 2 12 13 0 8 0 art_table 32 2819 0 2626 2 0 2 2 0 8 0 art_node 16 682 0 642 1 0 1 1 0 8 0 sysvmsgpl 40 23 0 11 1 0 1 1 0 8 0 semapl 112 344 0 334 1 0 1 1 0 8 0 shmpl 112 136 0 8 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 4412 0 2974 48 1 47 47 0 8 0 ffsino 272 4412 0 2974 97 0 97 97 0 8 0 nchpl 144 8075 0 6448 61 0 61 61 0 8 0 uvmvnodes 72 5441 0 0 99 0 99 99 0 8 0 vnodes 200 5441 0 0 287 0 287 287 0 8 0 namei 1024 32932 0 32932 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 21961 0 21961 12 11 1 7 0 8 1 plimitpl 152 553 0 544 1 0 1 1 0 8 0 sigapl 432 3033 0 3017 7 5 2 3 0 8 0 futexpl 56 27679 0 27679 1 0 1 1 0 8 1 knotepl 112 1913 0 1894 1 0 1 1 0 8 0 kqueuepl 104 704 0 702 1 0 1 1 0 8 0 pipepl 112 2054 0 2035 6 5 1 2 0 8 0 fdescpl 488 3034 0 3017 3 0 3 3 0 8 0 filepl 152 18598 0 18492 12 7 5 7 0 8 0 lockfpl 104 537 0 537 8 7 1 1 0 8 1 lockfspl 48 168 0 168 8 7 1 1 0 8 1 sessionpl 112 75 0 65 1 0 1 1 0 8 0 pgrppl 48 104 0 94 1 0 1 1 0 8 0 ucredpl 96 5128 0 5119 1 0 1 1 0 8 0 zombiepl 144 3017 0 3017 2 1 1 1 0 8 1 processpl 896 3050 0 3017 4 0 4 4 0 8 0 procpl 632 7655 0 7608 10 6 4 5 0 8 0 srpgc 64 116 0 116 12 11 1 1 0 8 1 sosppl 128 29 0 29 13 12 1 1 0 8 1 sockpl 384 3124 0 3107 7 4 3 4 0 8 1 mcl64k 65536 6 0 0 1 0 1 1 0 8 0 mcl16k 16384 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 19 0 0 2 0 2 2 0 8 0 mcl9k 9216 13 0 0 1 0 1 1 0 8 0 mcl8k 8192 10 0 0 2 0 2 2 0 8 0 mcl4k 4096 14 0 0 2 0 2 2 0 8 0 mcl2k2 2112 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 117 0 0 14 1 13 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 313 0 0 12 0 12 12 0 8 0 bufpl 256 9507 0 2493 439 0 439 439 0 8 0 anonpl 16 353043 0 346857 105 64 41 47 0 124 4 amapchunkpl 152 24273 0 24184 37 32 5 11 0 158 0 amappl16 192 14393 0 14002 126 97 29 34 0 8 8 amappl15 184 464 0 464 6 5 1 1 0 8 1 amappl14 176 727 0 720 1 0 1 1 0 8 0 amappl13 168 343 0 340 1 0 1 1 0 8 0 amappl12 160 544 0 541 1 0 1 1 0 8 0 amappl11 152 599 0 588 1 0 1 1 0 8 0 amappl10 144 494 0 492 1 0 1 1 0 8 0 amappl9 136 1462 0 1453 1 0 1 1 0 8 0 amappl8 128 905 0 870 3 1 2 2 0 8 0 amappl7 120 593 0 585 1 0 1 1 0 8 0 amappl6 112 428 0 420 1 0 1 1 0 8 0 amappl5 104 1029 0 1019 1 0 1 1 0 8 0 amappl4 96 3106 0 3075 2 1 1 2 0 8 0 amappl3 88 979 0 969 1 0 1 1 0 8 0 amappl2 80 19020 0 18943 3 1 2 3 0 8 0 amappl1 72 89209 0 88744 28 19 9 19 0 8 0 amappl 80 8816 0 8779 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 137 0 8 3 0 3 3 0 8 0 uaddrrnd 24 3034 0 3017 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3034 0 3017 1 0 1 1 0 8 0 vmmpekpl 168 28513 0 28485 2 0 2 2 0 8 0 vmmpepl 168 393157 0 391443 158 73 85 87 0 357 10 vmsppl 368 3033 0 3017 2 0 2 2 0 8 0 pdppl 4096 6075 0 6034 6 0 6 6 0 8 0 pvpl 32 951312 0 941848 225 113 112 126 0 265 20 pmappl 232 3033 0 3017 7 6 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 599 0 6 17 0 17 17 0 8 0