witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd807b1c61b8) #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 55054 3002 32767 0x10 0 1 syz-executor.0 *196876 40589 32767 0x1010 0x4080000 0 syz-executor.1 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,ffffffff822072f8) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff822072f8) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020ab0a00) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800020a87df0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800020a87df0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,d,0,3,6aec9ff4010) at Xsyscall+0x128 end of kernel end trace frame: 0x6b10f362290, 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,ffffffff822072f8) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff822072f8) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020ab0a00) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff800020a87df0) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff800020a87df0) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,5,d,0,3,6aec9ff4010) at Xsyscall+0x128 end of kernel end trace frame: 0x6b10f362290, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020a87b30 rbx 0xffff800020a87be0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800020b60000 rax 0xffff800000a70600 r8 0xffffffff81b89d03 kprintf+0x173 r9 0x1 r10 0x25 r11 0x3cd7a9f39e765b58 r12 0x3000000008 r13 0xffff800020a87b40 r14 0x100 r15 0x1 rip 0xffffffff817ece58 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020a87b20 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=196876 stat=onproc flags process=1010 proc=4080000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ac0c68,0xffff800020ab1b58 process=0xffff800020adc000 user=0xffff800020a82000, vmspace=0xfffffd806e8b7e68 estcpu=36, cpticks=5, pctcpu=0.0 user=0, sys=5, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 3002 55054 90963 32767 7 0x10 syz-executor.0 3002 185635 90963 32767 3 0x4000090 poll syz-executor.0 3002 229526 90963 32767 2 0x4000090 syz-executor.0 40589 271732 78499 32767 3 0x3010 suspend syz-executor.1 *40589 196876 78499 32767 7 0x4081010 syz-executor.1 78499 473155 23064 32767 3 0x90 nanosleep syz-executor.1 23064 357236 82409 0 3 0x82 wait syz-executor.1 90963 124107 9051 32767 3 0x90 nanosleep syz-executor.0 9051 427473 82409 0 3 0x82 wait syz-executor.0 92716 429542 0 0 3 0x14200 bored sosplice 82409 366285 81108 0 3 0x82 thrsleep syz-fuzzer 82409 239506 81108 0 3 0x4000082 thrsleep syz-fuzzer 82409 413015 81108 0 3 0x4000082 thrsleep syz-fuzzer 82409 115284 81108 0 3 0x4000082 thrsleep syz-fuzzer 82409 426691 81108 0 3 0x4000082 thrsleep syz-fuzzer 82409 396058 81108 0 3 0x4000082 thrsleep syz-fuzzer 82409 40973 81108 0 3 0x4000082 thrsleep syz-fuzzer 82409 223463 81108 0 3 0x4000082 thrsleep syz-fuzzer 82409 356751 81108 0 3 0x4000082 thrsleep syz-fuzzer 82409 142814 81108 0 3 0x4000082 kqread syz-fuzzer 81108 294324 99391 0 3 0x10008a pause ksh 99391 455738 68728 0 3 0x92 select sshd 23337 333772 1 0 3 0x100083 ttyin getty 68728 243303 1 0 3 0x80 select sshd 40390 233952 93161 73 2 0x100090 syslogd 93161 270125 1 0 3 0x100082 netio syslogd 89455 387982 1 77 3 0x100090 poll dhclient 67856 406268 1 0 3 0x80 poll dhclient 98855 115495 0 0 3 0x14200 pgzero zerothread 37624 363733 0 0 3 0x14200 aiodoned aiodoned 7045 42583 0 0 3 0x14200 syncer update 80230 478471 0 0 3 0x14200 cleaner cleaner 19940 457772 0 0 3 0x14200 reaper reaper 55608 25055 0 0 3 0x14200 pgdaemon pagedaemon 64894 42455 0 0 3 0x14200 bored crynlk 60961 276569 0 0 3 0x14200 bored crypto 58903 29419 0 0 3 0x40014200 acpi0 acpi0 46960 328926 0 0 3 0x40014200 idle1 52912 231822 0 0 3 0x14200 bored softnet 80285 464421 0 0 3 0x14200 bored systqmp 9845 308014 0 0 3 0x14200 bored systq 96918 523276 0 0 3 0x40014200 bored softclock 93301 172306 0 0 3 0x40014200 idle0 49517 305206 0 0 3 0x14200 bored smr 1 118814 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 40589 (syz-executor.1) thread 0xffff800020ab0a00 (196876) exclusive rrwlock inode r = 0 (0xfffffd807b1c61b8) #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 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9464 6322K 6322K 78643K 11491 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 105 3K 3K 78643K 8651 0 0 ifaddr 37 14K 15K 78643K 1184 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 461 0 0 iov 0 0K 28K 78643K 769 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1216 76K 76K 78643K 5960 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 141 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 1126 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 8 25K 33K 78643K 10972 0 0 sigio 0 0K 0K 78643K 136 0 0 proc 41 38K 70K 78643K 9120 0 0 subproc 34 2K 2K 78643K 3230 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 1360 0 0 in_multi 33 2K 2K 78643K 2438 0 0 ether_multi 1 0K 0K 78643K 73 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 72 318K 318K 78643K 72 0 0 exec 0 0K 1K 78643K 3420 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 89 20K 30K 78643K 36375 0 0 UVM aobj 130 4K 4K 78643K 141 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 646 0 0 NDP 5 0K 0K 78643K 573 0 0 temp 121 3554K 3650K 78643K 47996 0 0 kqueue 0 0K 0K 78643K 162 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 385 0 379 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 927 0 925 1 0 1 1 0 8 0 rtentry 112 2116 0 2072 2 0 2 2 0 8 0 unpcb 120 4561 0 4551 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 4764 0 4764 1 1 0 1 0 8 0 tcpcb 544 2449 0 2445 1 0 1 1 0 8 0 ipq 40 17 0 17 11 11 0 1 0 8 0 ipqe 40 50 0 50 11 11 0 1 0 8 0 inpcb 280 5933 0 5922 11 10 1 2 0 8 0 nd6 48 570 0 564 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 8645 0 8452 23 10 13 13 0 8 0 art_table 32 8646 0 8452 2 0 2 2 0 8 0 art_node 16 2115 0 2075 1 0 1 1 0 8 0 sysvmsgpl 40 2 0 2 1 1 0 1 0 8 0 semapl 112 1122 0 1112 1 0 1 1 0 8 0 shmpl 112 139 0 11 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 12661 0 11195 49 1 48 48 0 8 0 ffsino 272 12661 0 11195 103 5 98 98 0 8 0 nchpl 144 25768 0 24137 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 107090 0 107090 4 3 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 71474 0 71474 48 47 1 6 0 8 1 plimitpl 152 1893 0 1884 1 0 1 1 0 8 0 sigapl 432 10579 0 10563 9 7 2 3 0 8 0 futexpl 56 104697 0 104697 3 2 1 1 0 8 1 knotepl 112 6315 0 6296 1 0 1 1 0 8 0 kqueuepl 104 2692 0 2689 1 0 1 1 0 8 0 pipepl 112 6920 0 6897 18 17 1 2 0 8 0 fdescpl 488 10580 0 10563 3 0 3 3 0 8 0 filepl 152 64988 0 64870 26 21 5 7 0 8 0 lockfpl 104 1991 0 1991 15 15 0 1 0 8 0 lockfspl 48 613 0 613 15 15 0 1 0 8 0 sessionpl 112 205 0 195 1 0 1 1 0 8 0 pgrppl 48 325 0 315 1 0 1 1 0 8 0 ucredpl 96 17875 0 17866 1 0 1 1 0 8 0 zombiepl 144 10564 0 10563 2 1 1 1 0 8 0 processpl 896 10596 0 10563 4 0 4 4 0 8 0 procpl 632 27665 0 27620 40 35 5 5 0 8 1 srpgc 64 376 0 376 35 34 1 1 0 8 1 sosppl 128 192 0 192 41 41 0 1 0 8 0 sockpl 384 11630 0 11611 15 12 3 4 0 8 1 mcl64k 65536 22 0 0 3 1 2 3 0 8 0 mcl16k 16384 21 0 0 3 1 2 3 0 8 0 mcl12k 12288 35 0 0 2 0 2 2 0 8 0 mcl9k 9216 33 0 0 2 0 2 2 0 8 0 mcl8k 8192 25 0 0 4 1 3 3 0 8 0 mcl4k 4096 25 0 0 4 1 3 3 0 8 0 mcl2k2 2112 7 0 0 1 0 1 1 0 8 0 mcl2k 2048 153 0 0 16 3 13 16 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 684 0 0 13 2 11 13 0 8 0 bufpl 256 22901 0 15887 439 0 439 439 0 8 0 anonpl 16 1168365 0 1161813 252 209 43 47 0 124 2 amapchunkpl 152 83191 0 83095 136 128 8 14 0 158 0 amappl16 192 49225 0 48824 338 306 32 33 0 8 8 amappl15 184 1728 0 1725 22 21 1 1 0 8 0 amappl14 176 2572 0 2568 1 0 1 1 0 8 0 amappl13 168 1332 0 1332 20 20 0 1 0 8 0 amappl12 160 1024 0 1018 1 0 1 1 0 8 0 amappl11 152 1420 0 1409 1 0 1 1 0 8 0 amappl10 144 1748 0 1744 1 0 1 1 0 8 0 amappl9 136 4220 0 4217 1 0 1 1 0 8 0 amappl8 128 3055 0 3036 1 0 1 1 0 8 0 amappl7 120 2134 0 2124 1 0 1 1 0 8 0 amappl6 112 1188 0 1179 1 0 1 1 0 8 0 amappl5 104 2407 0 2397 1 0 1 1 0 8 0 amappl4 96 10972 0 10943 1 0 1 1 0 8 0 amappl3 88 2369 0 2358 1 0 1 1 0 8 0 amappl2 80 69998 0 69923 3 1 2 3 0 8 0 amappl1 72 290258 0 289800 23 13 10 19 0 8 0 amappl 80 30946 0 30905 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 140 0 11 3 0 3 3 0 8 0 uaddrrnd 24 10580 0 10563 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 10580 0 10563 1 0 1 1 0 8 0 vmmpekpl 168 89558 0 89525 2 0 2 2 0 8 0 vmmpepl 168 1352818 0 1351118 346 256 90 94 0 357 15 vmsppl 368 10579 0 10563 2 0 2 2 0 8 0 pdppl 4096 21167 0 21126 6 0 6 6 0 8 0 pvpl 32 3110214 0 3100346 554 437 117 127 0 265 12 pmappl 232 10579 0 10563 20 18 2 2 0 8 1 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 627 0 29 18 0 18 18 0 8 0