witness: userret: returning with the following locks held:
exclusive kernel_lock &kernel_lock r = 0 (0xffffffff829f8c18)
#0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline]
#0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182
#1 vmx_mprotect_ept+0x42 sys/arch/amd64/amd64/vmm.c:997
#2 vmmioctl+0x1a2 sys/arch/amd64/amd64/vmm.c:513
#3 VOP_IOCTL+0x96 sys/kern/vfs_vops.c:264
#4 vn_ioctl+0xba sys/kern/vfs_vnops.c:531
#5 sys_ioctl+0x4a2
#6 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#6 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587
#7 Xsyscall+0x128
panic: witness_warn
Stopped at db_enter+0x18: addq $0x8,%rsp
TID PID UID PRFLAGS PFLAGS CPU COMMAND
*448718 15000 0 0 0x4000000 0K syz-executor.1
db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440
panic(ffffffff824420f1) at panic+0x177 sys/kern/subr_prf.c:202
witness_warn(2,0,ffffffff824c9251) at witness_warn+0x68f witness_debugger sys/kern/subr_witness.c:2505 [inline]
witness_warn(2,0,ffffffff824c9251) at witness_warn+0x68f sys/kern/subr_witness.c:1473
userret(ffff800025f667f0) at userret+0x253 sys/kern/kern_sig.c:1952
syscall(ffff800025f6d020) at syscall+0x4a1 mi_syscall_return sys/sys/syscall_mi.h:129 [inline]
syscall(ffff800025f6d020) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:609
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x69fb1b17b90, 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:440
panic(ffffffff824420f1) at panic+0x177 sys/kern/subr_prf.c:202
witness_warn(2,0,ffffffff824c9251) at witness_warn+0x68f witness_debugger sys/kern/subr_witness.c:2505 [inline]
witness_warn(2,0,ffffffff824c9251) at witness_warn+0x68f sys/kern/subr_witness.c:1473
userret(ffff800025f667f0) at userret+0x253 sys/kern/kern_sig.c:1952
syscall(ffff800025f6d020) at syscall+0x4a1 mi_syscall_return sys/sys/syscall_mi.h:129 [inline]
syscall(ffff800025f6d020) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:609
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x69fb1b17b90, count: -6
ddb{0}> show registers
rdi 0
rsi 0x1
rbp 0xffff800025f6cd80
rbx 0xffffffff8276fbff cpu_info_full_primary+0x2bff
rdx 0x8b
rcx 0x2
rax 0x14
r8 0xffffffff81e8cde4 kprintf+0x144
r9 0x1
r10 0x7fd11bc4d6e1d487
r11 0x2562289ea329a91e
r12 0xffffffff8276fa00 cpu_info_full_primary+0x2a00
r13 0
r14 0
r15 0x1
rip 0xffffffff823b2108 db_enter+0x18
cs 0x8
rflags 0x246
rsp 0xffff800025f6cd70
ss 0x10
db_enter+0x18: addq $0x8,%rsp
ddb{0}> show proc
PROC (syz-executor.1) pid=448718 stat=onproc
flags process=0 proc=4000000<THREAD>
pri=32, usrpri=86, nice=20
forw=0xffffffffffffffff, list=0xffff800025f66a90,0xffffffff829f24e0
process=0xffff80002573f690 user=0xffff800025f68000, vmspace=0xfffffd807e8f78b8
estcpu=36, cpticks=5, pctcpu=0.0
user=0, sys=5, intr=0
ddb{0}> ps
PID TID PPID UID S FLAGS WAIT COMMAND
15000 35370 95188 0 2 0 syz-executor.1
*15000 448718 95188 0 7 0x4000000 syz-executor.1
7845 203078 1 0 3 0x100083 ttyin getty
95188 453407 10543 0 2 0x482 syz-executor.1
75805 16550 10543 0 2 0x2 syz-executor.0
33579 488705 0 0 3 0x14280 nfsidl nfsio
72212 320267 0 0 3 0x14280 nfsidl nfsio
63345 404111 0 0 3 0x14280 nfsidl nfsio
20704 185857 0 0 3 0x14280 nfsidl nfsio
53209 159945 0 0 3 0x14280 nfsidl nfsio
50873 428315 0 0 3 0x14280 nfsidl nfsio
25884 286491 0 0 3 0x14280 nfsidl nfsio
71089 421131 0 0 3 0x14280 nfsidl nfsio
6703 346663 0 0 3 0x14280 nfsidl nfsio
26461 295248 0 0 3 0x14280 nfsidl nfsio
75019 180438 0 0 3 0x14280 nfsidl nfsio
38227 466282 0 0 3 0x14280 nfsidl nfsio
92604 260969 0 0 3 0x14280 nfsidl nfsio
67346 255803 0 0 3 0x14280 nfsidl nfsio
81093 490056 0 0 3 0x14280 nfsidl nfsio
38022 21340 0 0 3 0x14280 nfsidl nfsio
26145 521925 0 0 3 0x14280 nfsidl nfsio
81692 505455 0 0 3 0x14280 nfsidl nfsio
88320 497529 0 0 3 0x14280 nfsidl nfsio
8344 208197 0 0 3 0x14280 nfsidl nfsio
3029 43943 0 0 3 0x14200 acct acct
8821 148423 0 0 3 0x14200 bored sosplice
10543 150259 57644 0 3 0x82 thrsleep syz-fuzzer
10543 40278 57644 0 2 0x4000482 syz-fuzzer
10543 331688 57644 0 3 0x4000082 thrsleep syz-fuzzer
10543 190645 57644 0 2 0x4000482 syz-fuzzer
10543 184660 57644 0 3 0x4000082 thrsleep syz-fuzzer
10543 421351 57644 0 2 0x4000482 syz-fuzzer
10543 119092 57644 0 3 0x4000082 thrsleep syz-fuzzer
10543 149852 57644 0 3 0x4000082 thrsleep syz-fuzzer
57644 506255 63505 0 3 0x10008a sigsusp ksh
63505 129343 18001 0 3 0x9a kqread sshd
18001 499618 1 0 3 0x88 kqread sshd
93266 279134 3244 74 3 0x100092 bpf pflogd
3244 416843 1 0 3 0x80 netio pflogd
45051 141011 73140 73 2 0x100090 syslogd
73140 104518 1 0 3 0x100082 netio syslogd
33599 418031 1 0 3 0x100080 kqread resolvd
8306 81851 0 0 3 0x14200 bored smr
8491 412737 0 0 2 0x14200 zerothread
1527 499321 0 0 3 0x14200 aiodoned aiodoned
94557 247710 0 0 3 0x14200 syncer update
44065 314794 0 0 3 0x14200 cleaner cleaner
68371 185136 0 0 3 0x14200 reaper reaper
32961 218150 0 0 3 0x14200 pgdaemon pagedaemon
7822 151625 0 0 3 0x14200 bored viomb
19763 497489 0 0 3 0x40014200 acpi0 acpi0
53043 353545 0 0 7 0x40014200 idle1
7451 371136 0 0 3 0x14200 bored softnet
10642 241488 0 0 3 0x14200 bored systqmp
27198 187968 0 0 3 0x14200 bored systq
56483 104560 0 0 3 0x40014200 bored softclock
81921 482978 0 0 3 0x40014200 idle0
1 201681 0 0 3 0x82 wait init
0 0 -1 0 3 0x10200 scheduler swapper
ddb{0}> show all locks
Process 15000 (syz-executor.1) thread 0xffff800025f667f0 (448718)
exclusive kernel_lock &kernel_lock r = 0 (0xffffffff829f8c18)
#0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline]
#0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182
#1 vmx_mprotect_ept+0x42 sys/arch/amd64/amd64/vmm.c:997
#2 vmmioctl+0x1a2 sys/arch/amd64/amd64/vmm.c:513
#3 VOP_IOCTL+0x96 sys/kern/vfs_vops.c:264
#4 vn_ioctl+0xba sys/kern/vfs_vnops.c:531
#5 sys_ioctl+0x4a2
#6 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#6 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587
#7 Xsyscall+0x128
Process 75805 (syz-executor.0) thread 0xffff80002125ed28 (16550)
exclusive rrwlock inode r = 0 (0xfffffd806771a5f0)
#0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline]
#0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182
#1 rw_enter+0x3e2 sys/kern/kern_rwlock.c:310
#2 rrw_enter+0x8b sys/kern/kern_rwlock.c:461
#3 VOP_LOCK+0x87 sys/kern/vfs_vops.c:534
#4 ufs_ihashins+0x42 sys/ufs/ufs/ufs_ihash.c:140
#5 ffs_vget+0x141 sys/ufs/ffs/ffs_vfsops.c:1347
#6 ffs_inode_alloc+0x1c3 sys/ufs/ffs/ffs_alloc.c:394
#7 ufs_mkdir+0xf4 sys/ufs/ufs/ufs_vnops.c:1162
#8 VOP_MKDIR+0xbf sys/kern/vfs_vops.c:404
#9 domkdirat+0x121 sys/kern/vfs_syscalls.c:3065
#10 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#10 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587
#11 Xsyscall+0x128
exclusive rrwlock inode r = 0 (0xfffffd80738074e8)
#0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline]
#0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182
#1 rw_enter+0x3e2 sys/kern/kern_rwlock.c:310
#2 rrw_enter+0x8b sys/kern/kern_rwlock.c:461
#3 VOP_LOCK+0x87 sys/kern/vfs_vops.c:534
#4 vn_lock+0x84 sys/kern/vfs_vnops.c:579
#5 vfs_lookup+0xdd sys/kern/vfs_lookup.c:413
#6 namei+0x55a sys/kern/vfs_lookup.c:245
#7 domkdirat+0x75 sys/kern/vfs_syscalls.c:3050
#8 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline]
#8 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587
#9 Xsyscall+0x128
ddb{0}> show malloc
Type InUse MemUse HighUse Limit Requests Type Lim
devbuf 10137 6455K 7434K 78643K 34667 0
pcb 13 8K 8K 78643K 1200 0
rtable 63 12K 14K 78643K 2606 0
ifaddr 48 14K 17K 78643K 900 0
sysctl 3 1K 1K 78643K 3 0
counters 44 34K 34K 78643K 334 0
ioctlops 0 0K 4K 78643K 2743 0
iov 0 0K 16K 78643K 688 0
mount 1 1K 1K 78643K 1 0
log 0 0K 0K 78643K 4 0
vnodes 1247 78K 79K 78643K 8541 0
UFS quota 1 32K 32K 78643K 1 0
UFS mount 5 36K 36K 78643K 5 0
shm 2 1K 5K 78643K 75 0
VM map 2 1K 1K 78643K 2 0
sem 12 0K 1K 78643K 1318 0
dirhash 12 2K 2K 78643K 12 0
ACPI 1697 195K 286K 78643K 12598 0
file desc 5 13K 25K 78643K 10041 0
sigio 0 0K 0K 78643K 62 0
proc 64 63K 111K 78643K 1673 0
subproc 66 4K 4K 78643K 1027 0
NFS srvsock 1 0K 0K 78643K 1 0
NFS daemon 1 16K 16K 78643K 1 0
ip_moptions 0 0K 0K 78643K 1069 0
in_multi 9 0K 2K 78643K 1622 0
ether_multi 1 0K 0K 78643K 162 0
mrt 1 0K 0K 78643K 73 0
ISOFS mount 1 32K 32K 78643K 1 0
MSDOSFS mount 1 16K 16K 78643K 1 0
ttys 115 519K 519K 78643K 115 0
exec 0 0K 2K 78643K 1799 0
pfkey data 0 0K 1K 78643K 14 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 401 825K 830K 78643K 120665 0
UVM aobj 131 8K 8K 78643K 150 0
memdesc 1 4K 4K 78643K 1 0
crypto data 1 1K 1K 78643K 1 0
ip6_options 0 0K 1K 78643K 1039 0
NDP 8 0K 0K 78643K 327 0
temp 90 4198K 8294K 78643K 131413 0
kqueue 8 14K 42K 78643K 703 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 651 0 650 1 0 1 1 0 8 0
rtentry 112 927 0 914 4 3 1 2 0 8 0
unpcb 128 3535 0 3527 5 4 1 3 0 8 0
syncache 296 74 0 74 22 22 0 1 0 8 0
tcpqe 32 108 102 108 3 3 0 1 0 8 0
tcpcb 736 3072 0 3046 22 19 3 4 0 8 0
arp 120 99 0 97 1 0 1 1 0 8 0
inpcb 304 10517 0 10500 15 12 3 3 0 8 1
rttmr 72 20 0 20 11 11 0 1 0 8 0
nd6 48 250 0 250 1 1 0 1 0 8 0
pkpcb 40 74 0 74 22 22 0 1 0 8 0
kcovpl 48 31 0 29 1 0 1 1 0 8 0
ppxss 1248 36 0 36 20 19 1 1 0 8 1
pffrag 232 56 0 55 10 9 1 1 0 482 0
pffrnode 88 56 0 55 10 9 1 1 0 8 0
pffrent 40 771 0 770 12 11 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
pfrktable 1344 11 0 9 1 0 1 1 0 8 0
pftag 88 2 0 2 1 1 0 1 0 8 0
pfstitem 24 51 0 46 1 0 1 1 0 8 0
pfstkey 112 51 0 46 1 0 1 1 0 8 0
pfstate 320 51 0 46 2 1 1 2 0 8 0
pfrule 1360 32 0 26 2 1 1 2 0 8 0
art_heap8 4096 8 0 6 7 5 2 3 0 8 0
art_heap4 256 4875 0 4856 54 52 2 18 0 8 0
art_table 32 4883 0 4862 4 3 1 3 0 8 0
art_node 16 917 0 909 1 0 1 1 0 8 0
sysvmsgpl 40 34 0 20 1 0 1 1 0 8 0
semupl 112 5 0 5 2 2 0 1 0 8 0
semapl 112 1313 0 1303 1 0 1 1 0 8 0
shmpl 112 147 0 19 4 0 4 4 0 8 0
dirhash 1024 17 0 0 3 0 3 3 0 8 0
dino2pl 256 14020 0 12596 90 0 90 90 0 8 0
ffsino 272 14020 0 12596 96 0 96 96 0 8 0
nchpl 144 27120 0 26656 61 41 20 61 0 8 0
uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0
vnodes 224 5926 0 0 349 0 349 349 0 8 0
namei 1024 87955 0 87954 15 14 1 1 0 8 0
percpumem 16 179 0 145 1 0 1 1 0 8 0
vcpupl 2048 86 0 0 11 0 11 11 0 8 0
vmpool 560 98 0 12 8 1 7 7 0 8 0
pfiaddrpl 120 3 0 2 1 0 1 1 0 8 0
scsiplug 72 10 0 10 7 6 1 1 0 8 1
scxspl 216 83033 0 83033 29 28 1 6 0 8 1
plimitpl 152 624 0 616 1 0 1 1 0 8 0
sigapl 424 10281 0 10230 14 7 7 7 0 8 0
futexpl 64 173984 0 173984 14 13 1 1 0 8 1
knotepl 112 178 0 0 3 0 3 3 0 8 0
kqueuepl 216 2420 0 2405 18 16 2 2 0 8 1
pipepl 336 1385 0 1375 10 8 2 2 0 8 1
fdescpl 496 10204 0 10189 3 0 3 3 0 8 0
filepl 152 58337 0 58207 23 16 7 9 0 8 1
lockfpl 104 2258 0 2257 1 0 1 1 0 8 0
lockfspl 48 766 0 765 1 0 1 1 0 8 0
sessionpl 144 53 0 43 1 0 1 1 0 8 0
pgrppl 48 83 0 73 1 0 1 1 0 8 0
ucredpl 96 6956 0 6945 1 0 1 1 0 8 0
zombiepl 144 10230 0 10230 4 3 1 1 0 8 1
processpl 1072 10281 0 10230 5 1 4 4 0 8 0
procpl 672 22869 0 22810 9 3 6 6 0 8 0
srpgc 96 12 0 12 5 5 0 1 0 8 0
sosppl 168 90 0 90 25 25 0 1 0 8 0
sockpl 480 14845 0 14819 45 39 6 11 0 8 2
mcl64k 65536 20 0 0 3 0 3 3 0 8 0
mcl16k 16384 8 0 0 1 0 1 1 0 8 0
mcl12k 12288 17 0 0 2 0 2 2 0 8 0
mcl9k 9216 6 0 0 1 0 1 1 0 8 0
mcl8k 8192 24 0 0 3 0 3 3 0 8 0
mcl4k 4096 17 0 0 3 1 2 3 0 8 0
mcl2k2 2112 6 0 0 1 0 1 1 0 8 0
mcl2k 2048 459 0 0 38 2 36 36 0 8 0
mtagpl 96 597 0 0 9 0 9 9 0 8 0
mbufpl 256 1521 0 0 76 2 74 74 0 8 0
bufpl 280 23468 0 17139 453 0 453 453 0 8 0
anonpl 24 2735254 0 2717352 275 160 115 129 0 186 6
amapchunkpl 152 303091 0 302423 270 231 39 41 0 158 13
amappl16 200 23879 0 23259 168 134 34 46 0 8 1
amappl15 192 528 0 522 1 0 1 1 0 8 0
amappl14 184 1344 0 1342 1 0 1 1 0 8 0
amappl13 176 1732 0 1730 1 0 1 1 0 8 0
amappl12 168 3774 0 3773 1 0 1 1 0 8 0
amappl11 160 1093 0 1082 1 0 1 1 0 8 0
amappl10 152 871 0 867 1 0 1 1 0 8 0
amappl9 144 558 0 558 2 2 0 1 0 8 0
amappl8 136 1559 0 1480 4 1 3 3 0 8 0
amappl7 128 715 0 708 1 0 1 1 0 8 0
amappl6 120 485 0 472 1 0 1 1 0 8 0
amappl5 112 7590 0 7570 1 0 1 1 0 8 0
amappl4 104 3345 0 3315 1 0 1 1 0 8 0
amappl3 96 5204 0 5188 1 0 1 1 0 8 0
amappl2 88 13844 0 13794 6 4 2 2 0 8 0
amappl1 80 169148 0 168751 15 5 10 13 0 8 0
amappl 88 119560 0 119344 6 0 6 6 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 64 149 0 19 3 0 3 3 0 8 0
uaddrrnd 24 10302 0 10201 1 0 1 1 0 8 0
uaddrbest 32 2 0 0 1 0 1 1 0 8 0
uaddr 24 10302 0 10201 1 0 1 1 0 8 0
vmmpekpl 168 52896 0 52843 3 0 3 3 0 8 0
vmmpepl 168 910035 0 908070 520 425 95 119 0 357 0
vmsppl 368 10301 0 10201 11 1 10 10 0 8 0
rwobjpl 56 204055 0 202643 57 36 21 25 0 8 0
pdppl 4096 20612 0 20488 188 61 127 127 0 8 3
pvpl 32 4728034 0 4707729 456 268 188 205 0 265 18
pmappl 224 10301 0 10201 6 0 6 6 0 8 0
extentpl 40 58 0 40 1 0 1 1 0 8 0
phpool 112 636 0 168 14 0 14 14 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:440
panic(ffffffff824420f1) at panic+0x177 sys/kern/subr_prf.c:202
witness_warn(2,0,ffffffff824c9251) at witness_warn+0x68f witness_debugger sys/kern/subr_witness.c:2505 [inline]
witness_warn(2,0,ffffffff824c9251) at witness_warn+0x68f sys/kern/subr_witness.c:1473
userret(ffff800025f667f0) at userret+0x253 sys/kern/kern_sig.c:1952
syscall(ffff800025f6d020) at syscall+0x4a1 mi_syscall_return sys/sys/syscall_mi.h:129 [inline]
syscall(ffff800025f6d020) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:609
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x69fb1b17b90, count: -6
ddb{0}> machine ddbcpu 1
Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp
x86_ipi_db(ffff800020d38ff0) 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+0x2eb sys/dev/acpi/acpicpu.c:1206
sched_idle(ffff800020d38ff0) at sched_idle+0x417 sys/kern/kern_sched.c:178
end trace frame: 0x0, count: 10
ddb{1}> trace
x86_ipi_db(ffff800020d38ff0) 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+0x2eb sys/dev/acpi/acpicpu.c:1206
sched_idle(ffff800020d38ff0) at sched_idle+0x417 sys/kern/kern_sched.c:178
end trace frame: 0x0, count: -5