panic: vref used where vget required Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 455171 23364 0 0 0 0 syz-executor.1 *420692 23364 0 0 0x4000000 1K syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82244adb) at panic+0x15c sys/kern/subr_prf.c:207 vref(fffffd8067e75c48) at vref+0x7e sys/kern/vfs_subr.c:691 namei(ffff8000241bd898) at namei+0x86b sys/kern/vfs_lookup.c:329 sys_chroot(ffff800020ed7ae8,ffff8000241bd9c8,ffff8000241bda10) at sys_chroot+0x87 change_dir sys/kern/vfs_syscalls.c:851 [inline] sys_chroot(ffff800020ed7ae8,ffff8000241bd9c8,ffff8000241bda10) at sys_chroot+0x87 sys/kern/vfs_syscalls.c:824 syscall(ffff8000241bda90) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000241bda90) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa78a5223640, 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(ffffffff82244adb) at panic+0x15c sys/kern/subr_prf.c:207 vref(fffffd8067e75c48) at vref+0x7e sys/kern/vfs_subr.c:691 namei(ffff8000241bd898) at namei+0x86b sys/kern/vfs_lookup.c:329 sys_chroot(ffff800020ed7ae8,ffff8000241bd9c8,ffff8000241bda10) at sys_chroot+0x87 change_dir sys/kern/vfs_syscalls.c:851 [inline] sys_chroot(ffff800020ed7ae8,ffff8000241bd9c8,ffff8000241bda10) at sys_chroot+0x87 sys/kern/vfs_syscalls.c:824 syscall(ffff8000241bda90) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000241bda90) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa78a5223640, count: -7 ddb{1}> show registers rdi 0xffffffff81752b27 db_enter+0x17 rsi 0x1334 __ALIGN_SIZE+0x334 rbp 0xffff8000241bd6f0 rbx 0xffff8000241bd7a0 rdx 0x1335 __ALIGN_SIZE+0x335 rcx 0xffff800023990000 rax 0xffff800023990000 r8 0xffffffff821c8b5f kprintf+0x16f r9 0x1 r10 0x25 r11 0x157030980411be7b r12 0x3000000008 r13 0xffff8000241bd700 r14 0x100 r15 0x1 rip 0xffffffff81752b28 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000241bd6e0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=420692 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=60, nice=20 forw=0xffffffffffffffff, list=0xffff800020ed6288,0xffffffff82664cb8 process=0xffff800020e92ba8 user=0xffff8000241b8000, vmspace=0xfffffd807efffb80 estcpu=10, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 23364 455171 39461 0 7 0 syz-executor.1 23364 523785 39461 0 2 0x4000000 syz-executor.1 23364 298461 39461 0 3 0x4000080 netio syz-executor.1 23364 39866 39461 0 3 0x4000080 fsleep syz-executor.1 23364 304635 39461 0 3 0x4000080 fsleep syz-executor.1 *23364 420692 39461 0 7 0x4000000 syz-executor.1 22451 70028 0 0 3 0x14200 bored sosplice 39461 214006 52635 0 3 0x82 nanosleep syz-executor.1 49206 259518 52635 0 3 0x82 piperd syz-executor.0 52635 42218 8646 0 3 0x82 thrsleep syz-fuzzer 52635 384845 8646 0 3 0x4000082 thrsleep syz-fuzzer 52635 441155 8646 0 3 0x4000082 thrsleep syz-fuzzer 52635 185936 8646 0 3 0x4000082 kqread syz-fuzzer 52635 38175 8646 0 3 0x4000082 thrsleep syz-fuzzer 52635 416867 8646 0 3 0x4000082 thrsleep syz-fuzzer 52635 444577 8646 0 3 0x4000082 thrsleep syz-fuzzer 52635 305224 8646 0 3 0x4000082 thrsleep syz-fuzzer 52635 5222 8646 0 3 0x4000082 thrsleep syz-fuzzer 52635 66339 8646 0 3 0x4000082 thrsleep syz-fuzzer 8646 520497 68343 0 3 0x10008a pause ksh 68343 464748 84492 0 3 0x92 select sshd 94413 155855 1 0 3 0x100083 ttyopn getty 84492 445743 1 0 3 0x80 select sshd 61946 329061 10961 74 3 0x100092 bpf pflogd 10961 522830 1 0 3 0x80 netio pflogd 37468 217727 6311 73 3 0x100090 kqread syslogd 6311 482640 1 0 3 0x100082 netio syslogd 789 466884 1 77 3 0x100090 poll dhclient 24867 23224 1 0 3 0x80 poll dhclient 58251 269722 0 0 3 0x14200 bored smr 39246 348691 0 0 3 0x14200 pgzero zerothread 14634 246130 0 0 3 0x14200 aiodoned aiodoned 28098 288455 0 0 3 0x14200 syncer update 72752 146230 0 0 3 0x14200 cleaner cleaner 95842 350254 0 0 3 0x14200 reaper reaper 91784 19698 0 0 3 0x14200 pgdaemon pagedaemon 97990 202125 0 0 3 0x14200 bored crynlk 83533 317106 0 0 3 0x14200 bored crypto 57221 388639 0 0 3 0x40014200 acpi0 acpi0 71658 20729 0 0 3 0x40014200 idle1 42602 400538 0 0 3 0x14200 bored softnet 41275 505614 0 0 3 0x14200 bored systqmp 44818 280431 0 0 3 0x14200 bored systq 78870 176396 0 0 3 0x40014200 bored softclock 31630 427283 0 0 3 0x40014200 idle0 1 246790 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 23364 (syz-executor.1) thread 0xffff800020ed7ae8 (420692) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8266bb40) #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_chroot+0x87 change_dir sys/kern/vfs_syscalls.c:851 [inline] #10 sys_chroot+0x87 sys/kern/vfs_syscalls.c:824 #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 9475 6406K 6987K 78643K 10733 0 pcb 13 8K 8K 78643K 27 0 rtable 106 3K 3K 78643K 215 0 ifaddr 46 11K 11K 78643K 58 0 counters 43 33K 34K 78643K 47 0 ioctlops 0 0K 4K 78643K 1473 0 iov 0 0K 12K 78643K 13 0 mount 1 1K 1K 78643K 1 0 vnodes 1220 77K 77K 78643K 1275 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 1K 78643K 2 0 VM map 2 1K 1K 78643K 2 0 sem 8 0K 0K 78643K 20 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 196K 290K 78643K 12766 0 file desc 5 13K 25K 78643K 91 0 sigio 0 0K 0K 78643K 2 0 proc 60 63K 95K 78643K 442 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 2 0 in_multi 40 2K 2K 78643K 40 0 ether_multi 1 0K 0K 78643K 1 0 mrt 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 43 201K 201K 78643K 43 0 exec 0 0K 1K 78643K 214 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 122 39K 39K 78643K 1209 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 6 0 NDP 6 0K 0K 78643K 12 0 temp 67 3035K 3100K 78643K 2186 0 kqueue 3 4K 12K 78643K 7 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 6 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 28 0 26 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 47 0 35 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 377 0 377 1 1 0 1 0 8 0 tcpcb 544 55 0 51 1 0 1 1 0 8 0 inpcb 280 131 0 124 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 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 14 0 0 1 0 1 1 0 8 0 pfstkey 112 14 0 0 1 0 1 1 0 8 0 pfstate 328 14 0 0 2 0 2 2 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 189 0 0 12 0 12 12 0 8 0 art_table 32 190 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 semupl 112 3 0 3 1 0 1 1 0 8 1 semapl 112 8 0 2 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 1517 0 110 89 0 89 89 0 8 0 ffsino 272 1517 0 110 94 0 94 94 0 8 0 nchpl 144 1829 0 219 60 0 60 60 0 8 0 uvmvnodes 72 1603 0 0 30 0 30 30 0 8 0 vnodes 208 1603 0 0 85 0 85 85 0 8 0 namei 1024 4804 0 4803 1 0 1 1 0 8 0 percpumem 16 34 0 2 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 scsiplug 64 1 0 1 1 0 1 1 0 8 1 scxspl 192 4685 0 4685 2 1 1 2 0 8 1 plimitpl 152 17 0 9 1 0 1 1 0 8 0 sigapl 424 307 0 275 4 0 4 4 0 8 0 futexpl 56 1024 0 1022 1 0 1 1 0 8 0 knotepl 112 65 0 46 1 0 1 1 0 8 0 kqueuepl 144 14 0 12 1 0 1 1 0 8 0 pipelkpl 48 89 0 79 1 0 1 1 0 8 0 pipepl 120 178 0 159 1 0 1 1 0 8 0 fdescpl 496 291 0 275 3 0 3 3 0 8 0 filepl 152 1542 0 1438 5 0 5 5 0 8 1 lockfpl 104 29 0 27 1 0 1 1 0 8 0 lockfspl 48 12 0 10 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 80 0 71 1 0 1 1 0 8 0 zombiepl 144 275 0 275 1 0 1 1 0 8 1 processpl 984 307 0 275 5 0 5 5 0 8 0 procpl 624 451 0 405 4 0 4 4 0 8 0 sosppl 128 4 0 4 1 0 1 1 0 8 1 sockpl 400 207 0 186 3 0 3 3 0 8 0 mcl64k 65536 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 158 0 0 19 0 19 19 0 8 0 mtagpl 80 8 0 0 1 0 1 1 0 8 0 mbufpl 256 198 0 0 12 0 12 12 0 8 0 bufpl 280 3427 0 133 236 0 236 236 0 8 0 anonpl 16 39682 0 26933 53 1 52 52 0 124 0 amapchunkpl 152 1235 0 1093 7 0 7 7 0 158 1 amappl16 192 1057 0 382 34 0 34 34 0 8 0 amappl15 184 35 0 33 1 0 1 1 0 8 0 amappl14 176 23 0 19 1 0 1 1 0 8 0 amappl13 168 26 0 25 1 0 1 1 0 8 0 amappl12 160 51 0 44 1 0 1 1 0 8 0 amappl11 152 54 0 38 1 0 1 1 0 8 0 amappl10 144 16 0 12 1 0 1 1 0 8 0 amappl9 136 379 0 378 1 0 1 1 0 8 0 amappl8 128 339 0 306 2 0 2 2 0 8 0 amappl7 120 125 0 113 1 0 1 1 0 8 0 amappl6 112 27 0 21 1 0 1 1 0 8 0 amappl5 104 197 0 181 1 0 1 1 0 8 0 amappl4 96 494 0 461 1 0 1 1 0 8 0 amappl3 88 102 0 95 1 0 1 1 0 8 0 amappl2 80 1411 0 1339 2 0 2 2 0 8 0 amappl1 72 16409 0 15951 24 10 14 18 0 8 4 amappl 80 696 0 647 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 293 0 275 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 293 0 275 1 0 1 1 0 8 0 vmmpekpl 168 6276 0 6239 2 0 2 2 0 8 0 vmmpepl 168 41924 0 40062 106 5 101 101 0 357 15 vmsppl 368 292 0 275 2 0 2 2 0 8 0 pdppl 4096 594 0 552 6 0 6 6 0 8 0 pvpl 32 143812 0 127913 133 0 133 133 0 265 4 pmappl 232 292 0 275 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 254 0 3 8 0 8 8 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffffffff82484ff0) 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 end of kernel end trace frame: 0x7f7ffffc48f0, count: 12 ddb{0}> trace x86_ipi_db(ffffffff82484ff0) 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 end of kernel end trace frame: 0x7f7ffffc48f0, count: -3 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(ffffffff82244adb) at panic+0x15c sys/kern/subr_prf.c:207 vref(fffffd8067e75c48) at vref+0x7e sys/kern/vfs_subr.c:691 namei(ffff8000241bd898) at namei+0x86b sys/kern/vfs_lookup.c:329 sys_chroot(ffff800020ed7ae8,ffff8000241bd9c8,ffff8000241bda10) at sys_chroot+0x87 change_dir sys/kern/vfs_syscalls.c:851 [inline] sys_chroot(ffff800020ed7ae8,ffff8000241bd9c8,ffff8000241bda10) at sys_chroot+0x87 sys/kern/vfs_syscalls.c:824 syscall(ffff8000241bda90) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000241bda90) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa78a5223640, count: 8 ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82244adb) at panic+0x15c sys/kern/subr_prf.c:207 vref(fffffd8067e75c48) at vref+0x7e sys/kern/vfs_subr.c:691 namei(ffff8000241bd898) at namei+0x86b sys/kern/vfs_lookup.c:329 sys_chroot(ffff800020ed7ae8,ffff8000241bd9c8,ffff8000241bda10) at sys_chroot+0x87 change_dir sys/kern/vfs_syscalls.c:851 [inline] sys_chroot(ffff800020ed7ae8,ffff8000241bd9c8,ffff8000241bda10) at sys_chroot+0x87 sys/kern/vfs_syscalls.c:824 syscall(ffff8000241bda90) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000241bda90) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa78a5223640, count: -7