panic: vref used where vget required Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *405989 78248 0 0 0x4000000 1K syz-executor.1 420187 78248 0 0 0x4000000 0 syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff822454f2) at panic+0x15c sys/kern/subr_prf.c:207 vref(fffffd806506e4e8) at vref+0x7e sys/kern/vfs_subr.c:691 namei(ffff80002318af80) at namei+0x86b sys/kern/vfs_lookup.c:329 sys_chdir(ffff800020ed8768,ffff80002318b0b8,ffff80002318b100) at sys_chdir+0x76 change_dir sys/kern/vfs_syscalls.c:851 [inline] sys_chdir(ffff800020ed8768,ffff80002318b0b8,ffff80002318b100) at sys_chdir+0x76 sys/kern/vfs_syscalls.c:797 syscall(ffff80002318b180) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002318b180) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9fbb317bb60, count: 8 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic vref used where vget required ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff822454f2) at panic+0x15c sys/kern/subr_prf.c:207 vref(fffffd806506e4e8) at vref+0x7e sys/kern/vfs_subr.c:691 namei(ffff80002318af80) at namei+0x86b sys/kern/vfs_lookup.c:329 sys_chdir(ffff800020ed8768,ffff80002318b0b8,ffff80002318b100) at sys_chdir+0x76 change_dir sys/kern/vfs_syscalls.c:851 [inline] sys_chdir(ffff800020ed8768,ffff80002318b0b8,ffff80002318b100) at sys_chdir+0x76 sys/kern/vfs_syscalls.c:797 syscall(ffff80002318b180) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002318b180) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9fbb317bb60, count: -7 ddb{1}> show registers rdi 0xffffffff8198d747 db_enter+0x17 rsi 0x16b2 __ALIGN_SIZE+0x6b2 rbp 0xffff80002318add0 rbx 0xffff80002318ae80 rdx 0x16b3 __ALIGN_SIZE+0x6b3 rcx 0xffff800021f6e000 rax 0xffff800021f6e000 r8 0xffffffff81276dcf kprintf+0x16f r9 0x1 r10 0x25 r11 0xb23a4082aedd71a5 r12 0x3000000008 r13 0xffff80002318ade0 r14 0x100 r15 0x1 rip 0xffffffff8198d748 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002318adc0 ss 0 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=405989 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=75, nice=20 forw=0xffffffffffffffff, list=0xffff800020ed8018,0xffff800020ed89e8 process=0xffff800020ecf358 user=0xffff800023186000, vmspace=0xfffffd807f000000 estcpu=25, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 78248 499027 59159 0 2 0 syz-executor.1 *78248 405989 59159 0 7 0x4000000 syz-executor.1 78248 157320 59159 0 2 0x4000000 syz-executor.1 78248 356506 59159 0 3 0x4000080 netio syz-executor.1 78248 420187 59159 0 7 0x4000000 syz-executor.1 42380 18672 0 0 3 0x14200 bored sosplice 59159 192039 83740 0 3 0x82 nanosleep syz-executor.1 42065 433445 83740 0 3 0x82 piperd syz-executor.0 83740 84844 7679 0 3 0x82 thrsleep syz-fuzzer 83740 93121 7679 0 3 0x4000082 nanosleep syz-fuzzer 83740 523642 7679 0 3 0x4000082 thrsleep syz-fuzzer 83740 208766 7679 0 2 0x4000002 syz-fuzzer 83740 228888 7679 0 3 0x4000082 thrsleep syz-fuzzer 83740 161744 7679 0 3 0x4000082 thrsleep syz-fuzzer 83740 237133 7679 0 3 0x4000082 kqread syz-fuzzer 83740 11126 7679 0 3 0x4000082 thrsleep syz-fuzzer 83740 250387 7679 0 3 0x4000082 thrsleep syz-fuzzer 83740 173649 7679 0 3 0x4000082 thrsleep syz-fuzzer 7679 504961 68103 0 3 0x10008a pause ksh 68103 74965 2694 0 3 0x92 select sshd 47499 17741 1 0 3 0x100083 ttyin getty 2694 235650 1 0 3 0x80 select sshd 57407 465729 47700 74 3 0x100092 bpf pflogd 47700 16647 1 0 3 0x80 netio pflogd 67923 423741 83988 73 3 0x100090 kqread syslogd 83988 320748 1 0 3 0x100082 netio syslogd 60090 9467 1 77 3 0x100090 poll dhclient 61899 254870 1 0 3 0x80 poll dhclient 45470 293937 0 0 3 0x14200 bored smr 16976 98327 0 0 3 0x14200 pgzero zerothread 34653 88156 0 0 3 0x14200 aiodoned aiodoned 27980 514709 0 0 3 0x14200 syncer update 4267 228819 0 0 3 0x14200 cleaner cleaner 30292 381249 0 0 3 0x14200 reaper reaper 91635 456208 0 0 3 0x14200 pgdaemon pagedaemon 88197 317194 0 0 3 0x14200 bored crynlk 74690 152931 0 0 3 0x14200 bored crypto 1895 32022 0 0 3 0x40014200 acpi0 acpi0 60669 315127 0 0 3 0x40014200 idle1 3264 429417 0 0 3 0x14200 bored softnet 2594 177966 0 0 3 0x14200 bored systqmp 1912 310046 0 0 3 0x14200 bored systq 3008 452419 0 0 3 0x40014200 bored softclock 7904 220500 0 0 3 0x40014200 idle0 1 10799 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 78248 (syz-executor.1) thread 0xffff800020ed8768 (405989) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8268a7c8) #0 witness_lock+0x4c7 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4c7 sys/kern/subr_witness.c:1164 #1 __mp_acquire_count+0x51 sys/kern/kern_lock.c:227 #2 mi_switch+0x392 sys/kern/sched_bsd.c:435 #3 sleep_finish+0x113 sys/kern/kern_synch.c:418 #4 rw_enter+0x3d6 sys/kern/kern_rwlock.c:287 #5 rrw_enter+0x88 sys/kern/kern_rwlock.c:462 #6 VOP_LOCK+0x4b sys/kern/vfs_vops.c:603 #7 vn_lock+0x81 sys/kern/vfs_vnops.c:575 #8 vfs_lookup+0xe6 sys/kern/vfs_lookup.c:419 #9 namei+0x63c sys/kern/vfs_lookup.c:249 #10 sys_chdir+0x76 change_dir sys/kern/vfs_syscalls.c:851 [inline] #10 sys_chdir+0x76 sys/kern/vfs_syscalls.c:797 #11 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] #11 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 #12 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9506 6426K 6802K 78643K 10865 0 pcb 13 8K 8K 78643K 53 0 rtable 113 4K 4K 78643K 253 0 ifaddr 66 13K 13K 78643K 74 0 counters 43 33K 34K 78643K 45 0 ioctlops 0 0K 4K 78643K 1479 0 iov 0 0K 16K 78643K 25 0 mount 1 1K 1K 78643K 1 0 vnodes 1217 77K 77K 78643K 1295 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 4 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 1K 78643K 17 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1823 197K 290K 78643K 12980 0 file desc 5 13K 25K 78643K 333 0 sigio 0 0K 0K 78643K 3 0 proc 60 63K 83K 78643K 466 0 subproc 32 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 7 0 in_multi 46 2K 2K 78643K 69 0 ether_multi 1 0K 0K 78643K 7 0 mrt 0 0K 0K 78643K 2 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 1K 78643K 223 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 120 39K 40K 78643K 1989 0 UVM aobj 4 2K 2K 78643K 6 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 96 0 NDP 10 0K 0K 78643K 16 0 temp 85 3036K 3100K 78643K 9534 0 kqueue 3 4K 8K 78643K 12 0 SYN cache 2 16K 16K 78643K 2 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 7 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 35 0 33 1 0 1 1 0 8 0 rtentry 112 54 0 9 2 0 2 2 0 8 0 unpcb 120 601 0 589 1 0 1 1 0 8 0 syncache 264 6 0 6 2 2 0 1 0 8 0 tcpcb 544 177 0 173 1 0 1 1 0 8 0 ipq 40 2 0 2 1 1 0 1 0 8 0 ipqe 40 4 0 4 1 1 0 1 0 8 0 inpcb 280 380 0 373 3 2 1 2 0 8 0 nd6 48 9 0 4 1 0 1 1 0 8 0 ppxss 1128 1 0 1 1 1 0 1 0 8 0 pffrag 232 1 0 1 1 1 0 1 0 482 0 pffrnode 88 1 0 1 1 1 0 1 0 8 0 pffrent 40 4 0 4 2 2 0 1 0 8 0 pfosfp 40 846 0 423 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 32 0 16 1 0 1 1 0 8 0 pfstkey 112 32 0 16 1 0 1 1 0 8 0 pfstate 328 32 0 16 3 0 3 3 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 252 0 55 14 1 13 14 0 8 0 art_table 32 253 0 55 2 0 2 2 0 8 0 art_node 16 53 0 11 1 0 1 1 0 8 0 semupl 112 4 0 4 1 1 0 1 0 8 0 semapl 112 11 0 1 1 0 1 1 0 8 0 shmpl 112 4 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2109 0 698 89 0 89 89 0 8 0 ffsino 272 2109 0 698 95 0 95 95 0 8 0 nchpl 144 3140 0 1519 62 1 61 61 0 8 0 uvmvnodes 72 2211 0 0 41 0 41 41 0 8 0 vnodes 208 2211 0 0 117 0 117 117 0 8 0 namei 1024 8920 0 8919 1 0 1 1 0 8 0 percpumem 16 33 0 1 1 0 1 1 0 8 0 vcpupl 1984 2 0 0 1 0 1 1 0 8 0 vmpool 560 2 0 0 1 0 1 1 0 8 0 scxspl 192 8221 0 8221 8 7 1 7 0 8 1 plimitpl 152 25 0 17 1 0 1 1 0 8 0 sigapl 424 549 0 517 4 0 4 4 0 8 0 futexpl 56 4913 0 4913 1 0 1 1 0 8 1 knotepl 112 69 0 50 1 0 1 1 0 8 0 kqueuepl 144 34 0 32 1 0 1 1 0 8 0 pipelkpl 48 115 0 105 1 0 1 1 0 8 0 pipepl 120 230 0 211 2 1 1 2 0 8 0 fdescpl 496 533 0 517 3 0 3 3 0 8 0 filepl 152 3405 0 3301 9 4 5 7 0 8 1 lockfpl 104 49 0 48 1 0 1 1 0 8 0 lockfspl 48 20 0 19 1 0 1 1 0 8 0 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 18 0 7 1 0 1 1 0 8 0 ucredpl 96 171 0 162 1 0 1 1 0 8 0 zombiepl 144 517 0 517 1 0 1 1 0 8 1 processpl 984 549 0 517 5 0 5 5 0 8 0 procpl 624 1232 0 1187 4 0 4 4 0 8 0 sosppl 128 2 0 2 1 1 0 1 0 8 0 sockpl 400 1016 0 995 6 3 3 5 0 8 0 mcl64k 65536 5 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 181 0 0 22 1 21 22 0 8 0 mtagpl 80 29 0 0 1 0 1 1 0 8 0 mbufpl 256 286 0 0 18 0 18 18 0 8 0 bufpl 280 4007 0 133 277 0 277 277 0 8 0 anonpl 16 55367 0 42082 56 2 54 55 0 124 0 amapchunkpl 152 2776 0 2634 13 5 8 13 0 158 0 amappl16 192 2318 0 1607 36 0 36 36 0 8 0 amappl15 184 119 0 115 1 0 1 1 0 8 0 amappl14 176 22 0 19 1 0 1 1 0 8 0 amappl13 168 26 0 25 1 0 1 1 0 8 0 amappl12 160 117 0 112 1 0 1 1 0 8 0 amappl11 152 60 0 45 1 0 1 1 0 8 0 amappl10 144 20 0 15 1 0 1 1 0 8 0 amappl9 136 583 0 579 1 0 1 1 0 8 0 amappl8 128 534 0 505 1 0 1 1 0 8 0 amappl7 120 118 0 106 1 0 1 1 0 8 0 amappl6 112 21 0 19 2 1 1 1 0 8 0 amappl5 104 430 0 413 1 0 1 1 0 8 0 amappl4 96 483 0 457 1 0 1 1 0 8 0 amappl3 88 103 0 97 1 0 1 1 0 8 0 amappl2 80 3426 0 3354 2 0 2 2 0 8 0 amappl1 72 21127 0 20675 23 13 10 18 0 8 0 amappl 80 1475 0 1426 2 0 2 2 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 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 5 0 2 1 0 1 1 0 8 0 uaddrrnd 24 535 0 517 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 535 0 517 1 0 1 1 0 8 0 vmmpekpl 168 7857 0 7823 2 0 2 2 0 8 0 vmmpepl 168 71022 0 69144 106 23 83 101 0 357 0 vmsppl 368 534 0 517 2 0 2 2 0 8 0 pdppl 4096 1078 0 1036 6 0 6 6 0 8 0 pvpl 32 191767 0 175307 139 5 134 139 0 265 0 pmappl 232 534 0 517 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 269 0 8 8 0 8 8 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffffffff824b6ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xc6 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __sanitizer_cov_trace_cmp4(9325a,9325b) at __sanitizer_cov_trace_cmp4+0x33 trace_cmp sys/dev/kcov.c:136 [inline] __sanitizer_cov_trace_cmp4(9325a,9325b) at __sanitizer_cov_trace_cmp4+0x33 sys/dev/kcov.c:170 __mp_lock(ffffffff8268a5c0) at __mp_lock+0x139 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff8268a5c0) at __mp_lock+0x139 sys/kern/kern_lock.c:147 sys_futex(ffff800020ed8eb8,ffff800023fc5940,ffff800023fc5990) at sys_futex+0xf6 sys/kern/sys_futex.c:109 syscall(ffff800023fc5a10) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800023fc5a10) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9fae58d1500, count: 7 ddb{0}> trace x86_ipi_db(ffffffff824b6ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xc6 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __sanitizer_cov_trace_cmp4(9325a,9325b) at __sanitizer_cov_trace_cmp4+0x33 trace_cmp sys/dev/kcov.c:136 [inline] __sanitizer_cov_trace_cmp4(9325a,9325b) at __sanitizer_cov_trace_cmp4+0x33 sys/dev/kcov.c:170 __mp_lock(ffffffff8268a5c0) at __mp_lock+0x139 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff8268a5c0) at __mp_lock+0x139 sys/kern/kern_lock.c:147 sys_futex(ffff800020ed8eb8,ffff800023fc5940,ffff800023fc5990) at sys_futex+0xf6 sys/kern/sys_futex.c:109 syscall(ffff800023fc5a10) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800023fc5a10) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9fae58d1500, count: -8 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x18: addq $0x8,%rsp db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff822454f2) at panic+0x15c sys/kern/subr_prf.c:207 vref(fffffd806506e4e8) at vref+0x7e sys/kern/vfs_subr.c:691 namei(ffff80002318af80) at namei+0x86b sys/kern/vfs_lookup.c:329 sys_chdir(ffff800020ed8768,ffff80002318b0b8,ffff80002318b100) at sys_chdir+0x76 change_dir sys/kern/vfs_syscalls.c:851 [inline] sys_chdir(ffff800020ed8768,ffff80002318b0b8,ffff80002318b100) at sys_chdir+0x76 sys/kern/vfs_syscalls.c:797 syscall(ffff80002318b180) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002318b180) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9fbb317bb60, count: 8 ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff822454f2) at panic+0x15c sys/kern/subr_prf.c:207 vref(fffffd806506e4e8) at vref+0x7e sys/kern/vfs_subr.c:691 namei(ffff80002318af80) at namei+0x86b sys/kern/vfs_lookup.c:329 sys_chdir(ffff800020ed8768,ffff80002318b0b8,ffff80002318b100) at sys_chdir+0x76 change_dir sys/kern/vfs_syscalls.c:851 [inline] sys_chdir(ffff800020ed8768,ffff80002318b0b8,ffff80002318b100) at sys_chdir+0x76 sys/kern/vfs_syscalls.c:797 syscall(ffff80002318b180) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002318b180) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9fbb317bb60, count: -7