witness: userret: returning with the following locks held: exclusive rwlock solock r = 0 (0xfffffd8079308028) #0 witness_lock+0x44d #1 unp_solock_peer+0x64 sys/kern/uipc_usrreq.c:168 #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 *507158 25908 0 0 0x4000000 0 syz-executor.2 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(ffff800021305cf0) at userret+0x265 sys/kern/kern_sig.c:2012 syscall(ffff800024774640) at syscall+0x57e mi_syscall_return sys/sys/syscall_mi.h:128 [inline] syscall(ffff800024774640) at syscall+0x57e sys/arch/amd64/amd64/trap.c:607 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa143e02b2b0, 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(ffff800021305cf0) at userret+0x265 sys/kern/kern_sig.c:2012 syscall(ffff800024774640) at syscall+0x57e mi_syscall_return sys/sys/syscall_mi.h:128 [inline] syscall(ffff800024774640) at syscall+0x57e sys/arch/amd64/amd64/trap.c:607 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa143e02b2b0, count: -6 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff800024774370 rbx 0xffffffff82937bb7 cpu_info_full_primary+0x2bb7 rdx 0xffff800000ccec00 rcx 0 rax 0xffff800021305cf0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x9b1cdab6832143f r11 0xef8ae6b7fe3893a2 r12 0xffffffff829379b8 cpu_info_full_primary+0x29b8 r13 0 r14 0 r15 0x1 rip 0xffffffff81d03c18 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024774360 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.2) pid=507158 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000213042b0,0xffffffff82a6ea48 process=0xffff8000fffec440 user=0xffff80002476f000, vmspace=0xfffffd80791242e8 estcpu=36, cpticks=4, pctcpu=0.0 user=0, sys=4, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 25908 318116 72808 0 2 0 syz-executor.2 *25908 507158 72808 0 7 0x4000000 syz-executor.2 68475 4799 15415 0 2 0x480 syz-executor.3 68475 110229 15415 0 3 0x4000080 fsleep syz-executor.3 68475 177728 15415 0 3 0x4000080 fsleep syz-executor.3 15415 337713 28037 0 2 0x482 syz-executor.3 83893 100805 28037 0 3 0x82 piperd syz-executor.1 18983 242008 28037 0 3 0x82 piperd syz-executor.4 34860 312350 28037 0 2 0x482 syz-executor.0 72808 64258 28037 0 2 0x482 syz-executor.2 87914 520346 28037 0 2 0x482 syz-executor.6 98176 289827 28037 0 3 0x82 piperd syz-executor.5 47068 353207 28037 0 3 0x82 piperd syz-executor.7 44265 178984 0 0 3 0x14200 acct acct 30241 26405 0 0 3 0x14280 nfsidl nfsio 3015 319840 0 0 3 0x14280 nfsidl nfsio 17293 241603 0 0 3 0x14280 nfsidl nfsio 88652 196737 0 0 3 0x14280 nfsidl nfsio 93541 459472 0 0 3 0x14280 nfsidl nfsio 87467 232987 0 0 3 0x14280 nfsidl nfsio 66103 205848 0 0 3 0x14280 nfsidl nfsio 56704 86502 0 0 3 0x14280 nfsidl nfsio 57481 324481 0 0 3 0x14280 nfsidl nfsio 29459 485880 0 0 3 0x14280 nfsidl nfsio 23953 431739 0 0 3 0x14280 nfsidl nfsio 9207 216986 0 0 3 0x14280 nfsidl nfsio 83854 3557 0 0 3 0x14280 nfsidl nfsio 62266 370935 0 0 3 0x14280 nfsidl nfsio 25401 211841 0 0 3 0x14280 nfsidl nfsio 3449 368203 0 0 3 0x14280 nfsidl nfsio 18819 362051 0 0 3 0x14280 nfsidl nfsio 82899 492940 0 0 3 0x14280 nfsidl nfsio 43776 43030 0 0 3 0x14280 nfsidl nfsio 99713 209864 0 0 3 0x14280 nfsidl nfsio 6959 174427 1 0 3 0x100083 ttyopn getty 34510 346360 0 0 3 0x14200 bored sosplice 28037 353951 62849 0 3 0x82 kqread syz-fuzzer 28037 187708 62849 0 3 0x4000082 thrsleep syz-fuzzer 28037 164911 62849 0 3 0x4000082 thrsleep syz-fuzzer 28037 477755 62849 0 3 0x4000082 thrsleep syz-fuzzer 28037 90830 62849 0 3 0x4000082 thrsleep syz-fuzzer 28037 513742 62849 0 3 0x4000082 thrsleep syz-fuzzer 28037 333103 62849 0 3 0x4000082 thrsleep syz-fuzzer 28037 372488 62849 0 3 0x4000082 thrsleep syz-fuzzer 28037 406011 62849 0 3 0x4000082 thrsleep syz-fuzzer 62849 146279 13716 0 3 0x10008a sigsusp ksh 13716 411185 81492 0 3 0x9a kqread sshd 81492 43625 1 0 3 0x88 kqread sshd 82259 166161 92790 74 3 0x1100092 bpf pflogd 92790 520883 1 0 3 0x80 netio pflogd 53403 218762 43582 73 2 0x1100090 syslogd 43582 204427 1 0 3 0x100082 netio syslogd 81373 41033 1 0 3 0x100080 kqread resolvd 31549 239511 67316 77 3 0x100092 kqread dhcpleased 17443 399754 67316 77 3 0x100092 kqread dhcpleased 67316 472703 1 0 3 0x80 kqread dhcpleased 98712 122596 0 0 3 0x14200 bored smr 99132 62833 0 0 2 0x14200 zerothread 878 64053 0 0 3 0x14200 aiodoned aiodoned 30813 100752 0 0 3 0x14200 syncer update 11060 421612 0 0 3 0x14200 cleaner cleaner 5001 177355 0 0 3 0x14200 reaper reaper 50693 506385 0 0 3 0x14200 pgdaemon pagedaemon 20609 254920 0 0 3 0x14200 bored viomb 62949 309596 0 0 3 0x40014200 acpi0 acpi0 70750 287746 0 0 7 0x40014200 idle1 44423 403729 0 0 3 0x14200 bored softnet 18672 83986 0 0 3 0x14200 bored softnet 930 127471 0 0 3 0x14200 bored softnet 37530 388029 0 0 3 0x14200 bored softnet 72323 295240 0 0 2 0x14200 systqmp 3198 294282 0 0 3 0x14200 bored systq 1982 459094 0 0 3 0x40014200 bored softclock 65698 490030 0 0 3 0x40014200 idle0 1 470402 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 25908 (syz-executor.2) thread 0xffff800021305cf0 (507158) exclusive rwlock solock r = 0 (0xfffffd8079308028) #0 witness_lock+0x44d #1 unp_solock_peer+0x64 sys/kern/uipc_usrreq.c:168 #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 10219 6499K 8064K 78643K 39682 0 pcb 13 18K 23K 78643K 1927 0 rtable 182 8K 16K 78643K 4391 0 ifaddr 83 20K 23K 78643K 1618 0 sysctl 2 0K 0K 78643K 2 0 counters 52 35K 35K 78643K 384 0 ioctlops 0 0K 8K 78643K 4913 0 iov 0 0K 32K 78643K 2001 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1557 97K 98K 78643K 10589 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 116 0 VM map 2 1K 1K 78643K 2 0 sem 10 1K 1K 78643K 10 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 12 41K 93K 78643K 13546 0 sigio 0 0K 0K 78643K 240 0 proc 72 91K 128K 78643K 3065 0 subproc 104 6K 6K 78643K 914 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 1 0K 0K 78643K 1824 0 in_multi 76 5K 6K 78643K 1030 0 ether_multi 1 0K 0K 78643K 54 0 mrt 1 0K 0K 78643K 52 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 259 1155K 1155K 78643K 259 0 exec 0 0K 2K 78643K 3891 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 551 1278K 1293K 78643K 77482 0 UVM aobj 131 4K 4K 78643K 137 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 547 0 NDP 12 0K 2K 78643K 336 0 temp 286 5034K 6058K 78643K 322992 0 kqueue 12 18K 26K 78643K 1318 0 SYN cache 2 2352K 2360K 78643K 3 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 1003 0 1000 15 14 1 5 0 8 0 rtentry 112 941 0 866 5 2 3 4 0 8 0 unpcb 144 9525 0 9508 102 101 1 8 0 8 0 syncache 296 66 0 66 17 17 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 148 41 148 11 11 0 1 0 8 0 tcpcb 736 14733 0 14714 271 261 10 23 0 8 7 arp 120 151 0 139 1 0 1 1 0 8 0 inpcb 320 21098 0 21087 182 173 9 21 0 8 8 nd6 48 237 0 221 1 0 1 1 0 8 0 pkpcb 40 17 0 17 7 7 0 1 0 8 0 kcovpl 48 70 0 62 1 0 1 1 0 8 0 ppxss 1256 64 0 64 15 15 0 1 0 8 0 pfstscr 40 33 0 33 6 6 0 1 0 8 0 pffrag 232 61 0 61 7 7 0 1 0 482 0 pffrnode 88 61 0 61 7 7 0 1 0 8 0 pffrent 40 201 0 201 7 7 0 1 0 8 0 pfosfp 40 1432 0 1007 5 0 5 5 0 8 0 pfosfpen 112 1432 0 716 21 0 21 21 0 8 0 pfrktable 1344 669 0 666 3 2 1 2 0 8 0 pftag 88 19 0 14 1 0 1 1 0 8 0 pfqueue 264 11 0 11 3 3 0 1 0 8 0 pfstitem 24 39 0 37 1 0 1 1 0 8 0 pfstkey 120 95 0 93 1 0 1 1 0 8 0 pfstate 336 66 0 64 2 1 1 2 0 8 0 pfrule 1360 516 0 501 9 7 2 6 0 8 0 rttmr 136 18 0 18 6 6 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 4193 0 3813 49 22 27 29 0 8 0 art_table 32 4194 0 3813 5 1 4 4 0 8 0 art_node 16 933 0 868 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 0 1 0 1 1 0 8 0 semapl 112 8 0 0 1 0 1 1 0 8 0 shmpl 112 134 0 6 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 19357 0 17870 94 0 94 94 0 8 0 ffsino 272 19357 0 17870 100 0 100 100 0 8 0 nchpl 144 38221 0 36589 63 0 63 63 0 8 0 uvmvnodes 80 5926 0 0 121 0 121 121 0 8 0 vnodes 224 5926 0 0 349 0 349 349 0 8 0 namei 1024 139619 0 139619 9 8 1 2 0 8 1 percpumem 16 204 0 166 1 0 1 1 0 8 0 vcpupl 2048 90 0 0 12 0 12 12 0 8 0 vmpool 568 181 0 91 8 1 7 7 0 8 0 pfiaddrpl 120 207 0 204 3 2 1 1 0 8 0 kstatmem 264 356 0 332 5 2 3 3 0 8 0 scsiplug 72 18 0 18 4 4 0 1 0 8 0 scxspl 216 132534 0 132534 42 41 1 8 0 8 1 plimitpl 152 1902 0 1887 1 0 1 1 0 8 0 sigapl 424 13770 0 13704 11 3 8 9 0 8 0 futexpl 64 130545 0 130543 4 3 1 1 0 8 0 knotepl 120 835 0 0 11 0 11 11 0 8 0 kqueuepl 224 3313 0 3303 53 50 3 5 0 8 2 pipepl 336 3241 0 3212 89 86 3 9 0 8 0 fdescpl 496 13711 0 13686 7 3 4 5 0 8 0 filepl 152 101699 0 101452 169 151 18 24 0 8 8 lockfpl 104 4572 0 4570 10 9 1 2 0 8 0 lockfspl 48 1153 0 1151 1 0 1 1 0 8 0 sessionpl 144 88 0 71 1 0 1 1 0 8 0 pgrppl 48 241 0 224 1 0 1 1 0 8 0 ucredpl 104 12505 0 12493 1 0 1 1 0 8 0 zombiepl 144 13706 0 13704 3 2 1 1 0 8 0 processpl 1064 13770 0 13704 5 0 5 5 0 8 0 procpl 672 35573 0 35496 28 19 9 9 0 8 1 srpgc 96 110 0 110 20 20 0 1 0 8 0 sosppl 168 63 0 63 7 6 1 1 0 8 1 sockpl 504 31660 0 31626 519 505 14 35 0 8 8 mcl64k 65536 14 0 0 2 0 2 2 0 8 0 mcl16k 16384 9 0 0 2 0 2 2 0 8 0 mcl12k 12288 18 0 0 2 0 2 2 0 8 0 mcl9k 9216 14 0 0 1 0 1 1 0 8 0 mcl8k 8192 22 0 0 3 1 2 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 266 0 0 20 1 19 20 0 8 0 mtagpl 96 1038 0 0 23 0 23 23 0 8 0 mbufpl 256 3277 0 0 187 0 187 187 0 8 0 bufpl 288 42804 0 36475 453 0 453 453 0 8 0 anonpl 24 2642127 0 2625801 230 103 127 154 0 186 1 amapchunkpl 152 224321 0 223686 98 65 33 41 0 158 0 amappl16 200 38227 0 37491 119 67 52 52 0 8 9 amappl15 192 3479 0 3477 1 0 1 1 0 8 0 amappl14 184 2230 0 2224 1 0 1 1 0 8 0 amappl13 176 1942 0 1940 1 0 1 1 0 8 0 amappl12 168 898 0 888 1 0 1 1 0 8 0 amappl11 160 1344 0 1323 2 0 2 2 0 8 0 amappl10 152 2313 0 2306 1 0 1 1 0 8 0 amappl9 144 2803 0 2797 1 0 1 1 0 8 0 amappl8 136 2993 0 2865 5 0 5 5 0 8 0 amappl7 128 1445 0 1434 1 0 1 1 0 8 0 amappl6 120 2956 0 2926 2 1 1 2 0 8 0 amappl5 112 11066 0 11050 1 0 1 1 0 8 0 amappl4 104 6111 0 6076 2 0 2 2 0 8 0 amappl3 96 40754 0 40692 7 4 3 3 0 8 1 amappl2 88 16388 0 16329 3 1 2 3 0 8 0 amappl1 80 322466 0 321886 24 9 15 20 0 8 0 amappl 88 75220 0 74974 7 0 7 7 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 136 0 6 3 0 3 3 0 8 0 uaddrrnd 24 13892 0 13777 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 13892 0 13777 1 0 1 1 0 8 0 vmmpekpl 168 102426 0 102357 5 1 4 4 0 8 0 vmmpepl 168 1346998 0 1344308 312 162 150 170 0 357 3 vmsppl 368 13891 0 13777 15 4 11 12 0 8 0 rwobjpl 56 325829 0 317888 130 13 117 117 0 8 2 pdppl 4096 27791 0 27644 833 674 159 161 0 8 12 pvpl 32 5378934 0 5359942 424 224 200 252 0 265 3 pmappl 248 13891 0 13777 9 1 8 8 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 2694 0 1587 34 1 33 33 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(ffff800021305cf0) at userret+0x265 sys/kern/kern_sig.c:2012 syscall(ffff800024774640) at syscall+0x57e mi_syscall_return sys/sys/syscall_mi.h:128 [inline] syscall(ffff800024774640) at syscall+0x57e sys/arch/amd64/amd64/trap.c:607 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa143e02b2b0, 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 acpicpu_idle() at acpicpu_idle+0x312 sys/dev/acpi/acpicpu.c:1206 sched_idle(ffff800020dd8ff0) at sched_idle+0x417 sys/kern/kern_sched.c:178 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 acpicpu_idle() at acpicpu_idle+0x312 sys/dev/acpi/acpicpu.c:1206 sched_idle(ffff800020dd8ff0) at sched_idle+0x417 sys/kern/kern_sched.c:178 end trace frame: 0x0, count: -5