witness: userret: returning with the following locks held: exclusive rwlock solock r = 0 (0xfffffd8075c36228) #0 witness_lock+0x44d #1 unp_solock_peer+0xa6 sys/kern/uipc_usrreq.c:163 #2 uipc_usrreq+0x7c6 sys/kern/uipc_usrreq.c:350 #3 sosend+0x61b sys/kern/uipc_socket.c:657 #4 sendit+0x65d sys/kern/uipc_syscalls.c:682 #5 sys_sendmsg+0x198 sys/kern/uipc_syscalls.c:589 #6 syscall+0x4c3 mi_syscall sys/sys/syscall_mi.h:101 [inline] #6 syscall+0x4c3 sys/arch/amd64/amd64/trap.c:585 #7 Xsyscall+0x128 panic: witness_warn Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *249885 90322 0 0 0x4000000 0 syz-executor.1 151597 45435 0 0x14000 0x200 1 reaper db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82593e80) at panic+0x177 sys/kern/subr_prf.c:202 witness_warn(2,0,ffffffff82620d13) at witness_warn+0x65e witness_debugger sys/kern/subr_witness.c:2505 [inline] witness_warn(2,0,ffffffff82620d13) at witness_warn+0x65e sys/kern/subr_witness.c:1473 userret(ffff80002b018d30) at userret+0x265 sys/kern/kern_sig.c:2012 syscall(ffff80002e44a4d0) at syscall+0x57e mi_syscall_return sys/sys/syscall_mi.h:128 [inline] syscall(ffff80002e44a4d0) at syscall+0x57e sys/arch/amd64/amd64/trap.c:607 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x546d0a408d0, 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 *cpu0: witness_warn ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82593e80) at panic+0x177 sys/kern/subr_prf.c:202 witness_warn(2,0,ffffffff82620d13) at witness_warn+0x65e witness_debugger sys/kern/subr_witness.c:2505 [inline] witness_warn(2,0,ffffffff82620d13) at witness_warn+0x65e sys/kern/subr_witness.c:1473 userret(ffff80002b018d30) at userret+0x265 sys/kern/kern_sig.c:2012 syscall(ffff80002e44a4d0) at syscall+0x57e mi_syscall_return sys/sys/syscall_mi.h:128 [inline] syscall(ffff80002e44a4d0) at syscall+0x57e sys/arch/amd64/amd64/trap.c:607 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x546d0a408d0, count: -6 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002e44a200 rbx 0xffffffff82937bb7 cpu_info_full_primary+0x2bb7 rdx 0xffff800000be8400 rcx 0 rax 0xffff80002b018d30 r8 0x101010101010101 r9 0x8080808080808080 r10 0xef205a21c1b494f3 r11 0xfc816e52dd73fdfb r12 0xffffffff829379b8 cpu_info_full_primary+0x29b8 r13 0 r14 0 r15 0x1 rip 0xffffffff81d03c18 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002e44a1f0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=249885 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000212fd510,0xffff80002b019d00 process=0xffff8000fffe4870 user=0xffff80002e445000, vmspace=0xfffffd8069f4fa28 estcpu=36, cpticks=5, pctcpu=0.0 user=0, sys=5, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 46242 423937 34 0 2 0 syz-executor.2 46242 205831 34 0 3 0x4000080 fsleep syz-executor.2 90322 18052 72441 0 2 0 syz-executor.1 *90322 249885 72441 0 7 0x4000000 syz-executor.1 66749 280100 73085 0 2 0x10 syz-executor.4 66749 446047 73085 0 3 0x4000090 fsleep syz-executor.4 32422 110927 50205 0 2 0 syz-executor.5 32422 171363 50205 0 3 0x4000080 fsleep syz-executor.5 92570 372869 82961 0 2 0 syz-executor.0 92570 219620 82961 0 3 0x4000080 msgwait syz-executor.0 39284 2010 27857 0 3 0x80 nanoslp syz-executor.6 39284 273772 27857 0 3 0x4000080 netio syz-executor.6 30858 428178 0 0 3 0x14280 nfsidl nfsio 80208 101215 0 0 3 0x14280 nfsidl nfsio 23923 215445 0 0 3 0x14280 nfsidl nfsio 17052 368917 0 0 3 0x14280 nfsidl nfsio 78801 317197 0 0 3 0x14280 nfsidl nfsio 43819 179103 0 0 3 0x14280 nfsidl nfsio 35486 434691 0 0 3 0x14280 nfsidl nfsio 34992 468603 0 0 3 0x14280 nfsidl nfsio 14245 195750 0 0 3 0x14280 nfsidl nfsio 84610 354072 0 0 3 0x14280 nfsidl nfsio 27490 520660 0 0 3 0x14280 nfsidl nfsio 20708 324229 0 0 3 0x14280 nfsidl nfsio 71195 482182 0 0 3 0x14280 nfsidl nfsio 5037 9254 0 0 3 0x14280 nfsidl nfsio 41016 493124 0 0 3 0x14280 nfsidl nfsio 23410 367519 0 0 3 0x14280 nfsidl nfsio 41761 415941 0 0 3 0x14280 nfsidl nfsio 85615 487564 0 0 3 0x14280 nfsidl nfsio 39064 352849 0 0 3 0x14280 nfsidl nfsio 66383 480785 0 0 3 0x14280 nfsidl nfsio 27857 318203 66695 0 2 0x482 syz-executor.6 14021 213162 66695 0 2 0x482 syz-executor.3 49300 333178 66695 0 2 0x482 syz-executor.7 50205 110038 66695 0 3 0x82 nanoslp syz-executor.5 73085 130329 66695 0 3 0x82 nanoslp syz-executor.4 34 449305 66695 0 2 0x482 syz-executor.2 72441 510572 66695 0 2 0x482 syz-executor.1 82961 351763 66695 0 2 0x482 syz-executor.0 66695 382313 52099 0 3 0x82 thrsleep syz-fuzzer 66695 313851 52099 0 3 0x4000082 thrsleep syz-fuzzer 66695 38279 52099 0 3 0x4000082 thrsleep syz-fuzzer 66695 269236 52099 0 3 0x4000082 thrsleep syz-fuzzer 66695 167992 52099 0 3 0x4000082 kqread syz-fuzzer 66695 521673 52099 0 3 0x4000082 thrsleep syz-fuzzer 66695 451498 52099 0 3 0x4000082 thrsleep syz-fuzzer 66695 64643 52099 0 3 0x4000082 thrsleep syz-fuzzer 66695 236419 52099 0 3 0x4000082 thrsleep syz-fuzzer 52099 207818 97329 0 3 0x10008a sigsusp ksh 97329 399555 89406 0 3 0x9a kqread sshd 60672 73276 1 0 3 0x100083 ttyin getty 89406 399136 1 0 3 0x88 kqread sshd 60294 406303 18666 74 3 0x1100092 bpf pflogd 18666 109594 1 0 3 0x80 netio pflogd 46806 269043 41889 73 2 0x1100090 syslogd 41889 235602 1 0 3 0x100082 netio syslogd 81233 348687 1 0 3 0x100080 kqread resolvd 77569 368958 25316 77 3 0x100092 kqread dhcpleased 9097 393816 25316 77 3 0x100092 kqread dhcpleased 25316 91128 1 0 3 0x80 kqread dhcpleased 48033 51036 0 0 2 0x40014200 smr 29875 16815 0 0 2 0x14200 zerothread 57643 15224 0 0 3 0x14200 aiodoned aiodoned 37906 389522 0 0 3 0x14200 syncer update 91222 353323 0 0 3 0x14200 cleaner cleaner 45435 151597 0 0 7 0x14200 reaper 2510 148359 0 0 3 0x14200 pgdaemon pagedaemon 86141 27114 0 0 3 0x14200 bored viomb 69176 355958 0 0 3 0x40014200 acpi0 acpi0 18975 448687 0 0 3 0x40014200 idle1 93231 473653 0 0 3 0x14200 bored softnet 36284 23333 0 0 3 0x14200 bored softnet 75628 490311 0 0 3 0x14200 bored softnet 87510 135239 0 0 3 0x14200 bored softnet 48408 422384 0 0 2 0x14200 systqmp 19595 299843 0 0 3 0x14200 bored systq 84960 128091 0 0 3 0x40014200 bored softclock 87645 230871 0 0 3 0x40014200 idle0 1 246085 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 90322 (syz-executor.1) thread 0xffff80002b018d30 (249885) exclusive rwlock solock r = 0 (0xfffffd8075c36228) #0 witness_lock+0x44d #1 unp_solock_peer+0xa6 sys/kern/uipc_usrreq.c:163 #2 uipc_usrreq+0x7c6 sys/kern/uipc_usrreq.c:350 #3 sosend+0x61b sys/kern/uipc_socket.c:657 #4 sendit+0x65d sys/kern/uipc_syscalls.c:682 #5 sys_sendmsg+0x198 sys/kern/uipc_syscalls.c:589 #6 syscall+0x4c3 mi_syscall sys/sys/syscall_mi.h:101 [inline] #6 syscall+0x4c3 sys/arch/amd64/amd64/trap.c:585 #7 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10186 6537K 6933K 78643K 11769 0 pcb 13 10K 11K 78643K 42 0 rtable 212 6K 6K 78643K 348 0 ifaddr 79 16K 17K 78643K 132 0 sysctl 2 0K 0K 78643K 2 0 counters 54 35K 35K 78643K 74 0 ioctlops 0 0K 4K 78643K 1570 0 iov 0 0K 2K 78643K 5 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1279 80K 80K 78643K 1521 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 11 0 VM map 2 1K 1K 78643K 2 0 sem 12 1K 1K 78643K 23 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 16 57K 85K 78643K 408 0 sigio 0 0K 0K 78643K 12 0 proc 68 91K 128K 78643K 523 0 subproc 104 6K 6K 78643K 104 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 43 0 in_multi 88 5K 6K 78643K 111 0 ether_multi 1 0K 0K 78643K 4 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 55 254K 254K 78643K 55 0 exec 0 0K 2K 78643K 677 0 tdb 3 0K 0K 78643K 3 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 228 80K 80K 78643K 4083 0 UVM aobj 45 2K 2K 78643K 48 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 6 0 NDP 11 0K 2K 78643K 37 0 temp 96 4714K 4782K 78643K 5833 0 kqueue 12 18K 20K 78643K 24 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 22 0 0 1 0 1 1 0 8 0 rtpcb 120 33 0 30 1 0 1 1 0 8 0 rtentry 112 111 0 12 4 0 4 4 0 8 0 unpcb 144 218 0 198 3 2 1 3 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 129 0 129 1 1 0 1 0 8 0 tcpcb 736 65 0 56 3 0 3 3 0 8 2 arp 120 18 0 2 1 0 1 1 0 8 0 inpcb 320 301 0 293 7 1 6 7 0 8 5 nd6 48 24 0 3 1 0 1 1 0 8 0 kcovpl 48 8 0 0 1 0 1 1 0 8 0 ppxss 1256 4 0 4 1 0 1 1 0 8 1 pffrag 232 3 0 1 1 0 1 1 0 482 0 pffrnode 88 3 0 1 1 0 1 1 0 8 0 pffrent 40 6 0 4 1 0 1 1 0 8 0 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 26 0 4 1 0 1 1 0 8 0 pfstkey 120 26 0 4 1 0 1 1 0 8 0 pfstate 336 26 0 4 3 0 3 3 0 8 0 pfrule 1360 21 0 15 2 0 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 452 0 44 29 1 28 29 0 8 0 art_table 32 453 0 44 4 0 4 4 0 8 0 art_node 16 110 0 20 1 0 1 1 0 8 0 sysvmsgpl 40 15 0 8 1 0 1 1 0 8 0 semupl 112 6 0 6 2 2 0 1 0 8 0 semapl 112 18 0 8 1 0 1 1 0 8 0 shmpl 112 45 0 3 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1961 0 521 91 0 91 91 0 8 0 ffsino 272 1961 0 521 97 0 97 97 0 8 0 nchpl 144 2628 0 940 63 0 63 63 0 8 0 uvmvnodes 80 2170 0 0 45 0 45 45 0 8 0 vnodes 224 2170 0 0 128 0 128 128 0 8 0 namei 1024 9863 0 9863 2 1 1 2 0 8 1 percpumem 16 49 0 10 1 0 1 1 0 8 0 kstatmem 264 42 0 20 2 0 2 2 0 8 0 scxspl 216 7680 0 7680 9 7 2 8 0 8 2 plimitpl 152 39 0 24 1 0 1 1 0 8 0 sigapl 424 735 0 667 10 2 8 8 0 8 0 futexpl 64 3010 0 3007 1 0 1 1 0 8 0 knotepl 120 112 0 0 4 0 4 4 0 8 0 kqueuepl 224 45 0 37 1 0 1 1 0 8 0 pipepl 336 215 0 187 9 4 5 6 0 8 2 fdescpl 496 698 0 669 5 1 4 5 0 8 0 filepl 152 3975 0 3729 17 3 14 15 0 8 4 lockfpl 104 57 0 55 1 0 1 1 0 8 0 lockfspl 48 29 0 27 1 0 1 1 0 8 0 sessionpl 144 24 0 7 1 0 1 1 0 8 0 pgrppl 48 27 0 10 1 0 1 1 0 8 0 ucredpl 104 795 0 781 1 0 1 1 0 8 0 zombiepl 144 669 0 667 1 0 1 1 0 8 0 processpl 1064 735 0 667 5 0 5 5 0 8 0 procpl 672 1327 0 1245 9 1 8 8 0 8 0 srpgc 96 4 0 4 1 0 1 1 0 8 1 sockpl 504 552 0 521 12 1 11 12 0 8 6 mcl64k 65536 17 0 0 3 0 3 3 0 8 0 mcl16k 16384 5 0 0 1 0 1 1 0 8 0 mcl12k 12288 6 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 9 0 0 2 0 2 2 0 8 0 mcl4k 4096 13 0 0 2 0 2 2 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 353 0 0 44 0 44 44 0 8 0 mtagpl 96 52 0 0 2 0 2 2 0 8 0 mbufpl 256 374 0 0 23 0 23 23 0 8 0 bufpl 288 4053 0 143 280 0 280 280 0 8 0 anonpl 24 130469 0 113596 132 3 129 129 0 186 16 amapchunkpl 152 10469 0 9797 33 4 29 30 0 158 1 amappl16 200 2165 0 1626 40 0 40 40 0 8 10 amappl15 192 83 0 78 1 0 1 1 0 8 0 amappl14 184 54 0 49 2 1 1 1 0 8 0 amappl13 176 110 0 108 1 0 1 1 0 8 0 amappl12 168 6 0 5 1 0 1 1 0 8 0 amappl11 160 173 0 149 2 0 2 2 0 8 0 amappl10 152 76 0 67 1 0 1 1 0 8 0 amappl9 144 538 0 534 1 0 1 1 0 8 0 amappl8 136 600 0 557 2 0 2 2 0 8 0 amappl7 128 144 0 134 1 0 1 1 0 8 0 amappl6 120 252 0 233 2 1 1 2 0 8 0 amappl5 112 379 0 357 1 0 1 1 0 8 0 amappl4 104 964 0 933 2 0 2 2 0 8 0 amappl3 96 1401 0 1350 2 0 2 2 0 8 0 amappl2 88 1000 0 941 3 1 2 3 0 8 0 amappl1 80 18453 0 17773 20 5 15 20 0 8 0 amappl 88 3639 0 3474 5 1 4 4 0 92 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 47 0 3 1 0 1 1 0 8 0 uaddrrnd 24 698 0 668 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 698 0 668 1 0 1 1 0 8 0 vmmpekpl 168 10236 0 10188 4 1 3 3 0 8 0 vmmpepl 168 70916 0 68297 136 8 128 128 0 357 4 vmsppl 368 697 0 668 4 0 4 4 0 8 0 rwobjpl 56 21156 0 17391 59 2 57 57 0 8 0 pdppl 4096 1403 0 1336 105 36 69 79 0 8 2 pvpl 32 357314 0 335629 259 19 240 258 0 265 48 pmappl 248 697 0 668 3 0 3 3 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 720 0 45 20 0 20 20 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82593e80) at panic+0x177 sys/kern/subr_prf.c:202 witness_warn(2,0,ffffffff82620d13) at witness_warn+0x65e witness_debugger sys/kern/subr_witness.c:2505 [inline] witness_warn(2,0,ffffffff82620d13) at witness_warn+0x65e sys/kern/subr_witness.c:1473 userret(ffff80002b018d30) at userret+0x265 sys/kern/kern_sig.c:2012 syscall(ffff80002e44a4d0) at syscall+0x57e mi_syscall_return sys/sys/syscall_mi.h:128 [inline] syscall(ffff80002e44a4d0) at syscall+0x57e sys/arch/amd64/amd64/trap.c:607 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x546d0a408d0, count: -6 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020dd8ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __mp_lock(ffffffff82a57c00) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82a57c00) at __mp_lock+0x122 sys/kern/kern_lock.c:147 reaper(ffff800021232d28) at reaper+0x160 sys/kern/kern_exit.c:442 end trace frame: 0x0, count: 10 ddb{1}> trace x86_ipi_db(ffff800020dd8ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __mp_lock(ffffffff82a57c00) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82a57c00) at __mp_lock+0x122 sys/kern/kern_lock.c:147 reaper(ffff800021232d28) at reaper+0x160 sys/kern/kern_exit.c:442 end trace frame: 0x0, count: -5