panic: ffs_valloc: dup alloc Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *116558 81980 0 0x2 0 0K syz-executor 717 63694 0 0x2 0 1 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83436fb8) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd806f6daaa0,41c0,fffffd80097fd680,ffff80002a2f0528) at ffs_inode_alloc+0x94e ufs_mkdir(ffff80002a2f0590) at ufs_mkdir+0xfc sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806ff08618,ffff80002a2f06f0,ffff80002a2f0720,ffff80002a2f0620) at VOP_MKDIR+0x101 sys/kern/vfs_vops.c:394 domkdirat(ffff8000fffee7e0,ffffff9c,7d2acd6c1eb0,1c0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3143 syscall(ffff80002a2f08a0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a2f08a0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7d2acd6c1e70, count: 7 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: ffs_valloc: dup alloc ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83436fb8) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd806f6daaa0,41c0,fffffd80097fd680,ffff80002a2f0528) at ffs_inode_alloc+0x94e ufs_mkdir(ffff80002a2f0590) at ufs_mkdir+0xfc sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806ff08618,ffff80002a2f06f0,ffff80002a2f0720,ffff80002a2f0620) at VOP_MKDIR+0x101 sys/kern/vfs_vops.c:394 domkdirat(ffff8000fffee7e0,ffffff9c,7d2acd6c1eb0,1c0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3143 syscall(ffff80002a2f08a0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a2f08a0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7d2acd6c1e70, count: -8 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002a2f02a0 rbx 0xffffffff83941e07 cpu_info_full_primary+0x2e07 rdx 0 rcx 0xffff8000fffee7e0 rax 0xffffffff83940ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xae9a79d3da112113 r11 0x64a6e8780c34edcb r12 0xffffffff83941c08 cpu_info_full_primary+0x2c08 r13 0 r14 0 r15 0x1 rip 0xffffffff81238435 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a2f0290 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=116558 pid=81980 tcnt=1 stat=onproc flags process=2 proc=0 runpri=36, usrpri=65, slppri=36, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000fffeefa8,0xffffffff839de798 process=0xffff80002a39ce88 user=0xffff80002a2eb000, vmspace=0xfffffd8069572d78 estcpu=15, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND *81980 116558 72181 0 7 0x2 syz-executor 61897 251994 72181 0 3 0x82 piperd syz-executor 63694 717 72181 0 7 0x2 syz-executor 72181 481065 10613 0 3 0x82 wait syz-executor 10613 333835 4441 0 3 0x10008a sigsusp ksh 4441 372218 110 0 3 0x98 kqread sshd-session 110 377872 14333 0 3 0x92 kqread sshd-session 35194 253065 1 0 3 0x100083 ttyin getty 14333 388128 1 0 3 0x88 kqread sshd 6363 484433 39514 74 3 0x1100092 bpf pflogd 39514 319112 1 0 3 0x80 sbwait pflogd 61762 519764 14429 73 3 0x1100090 kqread syslogd 14429 502798 1 0 3 0x100082 sbwait syslogd 164 456851 1 0 3 0x100080 kqread resolvd 35083 443825 881 77 3 0x100092 kqread dhcpleased 14008 277005 881 77 3 0x100092 kqread dhcpleased 881 176738 1 0 3 0x80 kqread dhcpleased 67702 228017 0 0 3 0x14200 bored smr 1772 466571 0 0 3 0x14200 pgzero zerothread 27964 161557 0 0 3 0x14200 aiodoned aiodoned 14136 14905 0 0 3 0x14200 syncer update 97931 328782 0 0 3 0x14200 cleaner cleaner 39355 363562 0 0 3 0x14200 reaper reaper 83432 231105 0 0 3 0x14200 pgdaemon pagedaemon 14857 321564 0 0 3 0x14200 bored viomb 78684 128431 0 0 3 0x40014200 acpi0 acpi0 45310 379569 0 0 3 0x40014200 idle1 41864 262956 0 0 3 0x14200 bored softnet1 90902 68046 0 0 3 0x14200 bored softnet0 35782 49857 0 0 3 0x14200 smrbar systqmp 16709 235265 0 0 3 0x14200 bored systq 80547 268316 0 0 3 0x14200 tmoslp softclockmp 29668 64099 0 0 2 0x40014200 softclock 17779 464184 0 0 3 0x40014200 idle0 1 276192 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 81980 (syz-executor) thread 0xffff8000fffee7e0 (116558) exclusive rrwlock inode r = 0 (0xfffffd8069452440) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 rw_do_enter_write+0x419 sys/kern/kern_rwlock.c:320 #2 rrw_enter+0xc6 sys/kern/kern_rwlock.c:621 #3 VOP_LOCK+0xbd sys/kern/vfs_vops.c:527 #4 ufs_ihashins+0x4f ufs_ihash sys/ufs/ufs/ufs_ihash.c:-1 [inline] #4 ufs_ihashins+0x4f sys/ufs/ufs/ufs_ihash.c:159 #5 ffs_vget+0x187 sys/ufs/ffs/ffs_vfsops.c:1232 #6 ffs_inode_alloc+0x279 sys/ufs/ffs/ffs_alloc.c:393 #7 ufs_mkdir+0xfc sys/ufs/ufs/ufs_vnops.c:1112 #8 VOP_MKDIR+0x101 sys/kern/vfs_vops.c:394 #9 domkdirat+0x179 sys/kern/vfs_syscalls.c:3143 #10 syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] #10 syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 #11 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806f6dab40) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 rw_do_enter_write+0x419 sys/kern/kern_rwlock.c:320 #2 rrw_enter+0xc6 sys/kern/kern_rwlock.c:621 #3 VOP_LOCK+0xbd sys/kern/vfs_vops.c:527 #4 vn_lock+0xa4 sys/kern/vfs_vnops.c:576 #5 vfs_lookup+0x11c sys/kern/vfs_lookup.c:-1 #6 namei+0x7ca sys/kern/vfs_lookup.c:250 #7 domkdirat+0x8b sys/kern/vfs_syscalls.c:3128 #8 syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] #8 syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 #9 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff839d2f80) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 syscall+0xaf4 mi_syscall sys/sys/syscall_mi.h:175 [inline] #1 syscall+0xaf4 sys/arch/amd64/amd64/trap.c:783 #2 Xsyscall+0x128 Process 35782 (systqmp) thread 0xffff8000ffffecf8 (49857) shared rwlock systqmp r = 0 (0xffffffff839253f8) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 taskq_thread+0x12a sys/kern/kern_task.c:442 #2 proc_trampoline+0x10 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11045 12076K 12087K 166960K 12152 0 pcb 17 12K 12K 166960K 24 0 rtable 155 5K 7K 166960K 374 0 pf 26 16K 18K 166960K 45 0 ifaddr 27 4K 7K 166960K 45 0 ifgroup 39 1K 2K 166960K 55 0 sysctl 1 1K 9K 166960K 5 0 counters 62 36K 37K 166960K 70 0 ioctlops 0 0K 4K 166960K 1486 0 iov 0 0K 1K 166960K 1 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1289 81K 81K 166960K 1371 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 3 0 VM map 2 1K 1K 166960K 2 0 sem 3 0K 0K 166960K 4 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 8 22K 97K 166960K 158 0 proc 71 115K 164K 166960K 553 0 subproc 36 2K 4K 166960K 81 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 1 0 in_multi 55 4K 7K 166960K 99 0 ether_multi 1 0K 0K 166960K 2 0 mrt 0 0K 0K 166960K 6 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 49 228K 228K 166960K 49 0 exec 0 0K 1K 166960K 391 0 fusefs mount 1 32K 32K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 159 125K 178K 166960K 3268 0 UVM aobj 4 2K 2K 166960K 4 0 pinsyscall 33 66K 106K 166960K 1327 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 2 0 NDP 13 0K 2K 166960K 29 0 temp 17 9073K 9138K 166960K 5188 0 kqueue 13 20K 22K 166960K 29 0 SYN cache 2 16K 16K 166960K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 26 0 0 1 0 1 1 0 8 0 rtpcb 120 37 0 34 1 0 1 1 0 8 0 rtentry 176 112 0 46 5 0 5 5 0 8 0 unpcb 144 39 0 22 1 0 1 1 0 8 0 syncache 336 3 0 3 1 0 1 1 0 8 1 tcpcb 736 12 0 8 1 0 1 1 0 8 0 arp 136 18 0 8 1 0 1 1 0 8 0 inpcb 328 76 0 69 1 0 1 1 0 8 0 nd6 152 24 0 12 1 0 1 1 0 8 0 kcovpl 48 9 0 5 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 20 0 0 1 0 1 1 0 8 0 pfstkey 128 20 0 0 1 0 1 1 0 8 0 pfstate 448 20 0 0 3 0 3 3 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 rttmr 136 1 0 1 1 0 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 452 0 132 29 0 29 29 0 8 4 art_table 40 453 0 132 5 0 5 5 0 8 0 art_node 32 112 0 33 1 0 1 1 0 8 0 semapl 112 2 0 1 1 0 1 1 0 8 0 shmpl 112 1 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1592 0 122 93 0 93 93 0 8 0 ffsino 296 1595 0 125 114 0 114 114 0 8 0 nchpl 144 1813 0 110 64 0 64 64 0 8 0 vnodes 216 1693 0 0 95 0 95 95 0 8 0 namei 1024 5614 0 5613 2 0 2 2 0 8 1 percpumem 16 50 0 4 1 0 1 1 0 8 0 kstatmem 264 26 0 8 2 0 2 2 0 8 0 scxspl 216 6267 0 6267 4 2 2 3 1 8 2 plimitpl 152 32 0 15 1 0 1 1 0 8 0 sigapl 424 477 0 436 7 0 7 7 0 8 1 knotepl 120 303 0 0 10 0 10 10 0 8 0 kqueuepl 224 26 0 17 1 0 1 1 0 8 0 pipepl 344 132 0 105 3 0 3 3 0 8 0 fdescpl 528 461 0 439 3 0 3 3 0 8 0 filepl 160 1713 0 1554 10 0 10 10 0 8 0 lockfpl 104 12 0 10 1 0 1 1 0 8 0 lockfspl 48 7 0 5 1 0 1 1 0 8 0 sessionpl 144 24 0 15 1 0 1 1 0 8 0 pgrppl 48 34 0 17 1 0 1 1 0 8 0 ucredpl 104 89 0 76 1 0 1 1 0 8 0 zombiepl 144 442 0 436 1 0 1 1 0 8 0 processpl 1232 477 0 436 5 0 5 5 0 8 1 procpl 664 509 0 468 5 0 5 5 0 8 1 sockpl 752 152 0 125 4 0 4 4 0 8 1 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 110 0 0 14 0 14 14 0 8 0 mcl2k 2048 15 0 0 2 0 2 2 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 120 0 0 8 0 8 8 0 8 0 bufpl 280 2342 0 105 160 0 160 160 0 8 0 anonpl 32 3949 0 0 32 0 32 32 0 246 0 amapchunkpl 152 9475 0 9213 26 0 26 26 0 158 11 amappl16 200 2200 0 2191 5 0 5 5 0 8 4 amappl15 192 10 0 9 1 0 1 1 0 8 0 amappl14 184 436 0 435 1 0 1 1 0 8 0 amappl13 176 123 0 111 1 0 1 1 0 8 0 amappl12 168 715 0 695 2 0 2 2 0 8 0 amappl11 160 8 0 8 1 0 1 1 0 8 1 amappl10 152 66 0 52 1 0 1 1 0 8 0 amappl9 144 280 0 280 1 0 1 1 0 8 1 amappl8 136 124 0 122 1 0 1 1 0 8 0 amappl7 128 149 0 136 1 0 1 1 0 8 0 amappl6 120 162 0 161 1 0 1 1 0 8 0 amappl5 112 95 0 85 1 0 1 1 0 8 0 amappl4 104 290 0 271 1 0 1 1 0 8 0 amappl3 96 1582 0 1518 3 0 3 3 0 8 0 amappl2 88 539 0 478 2 0 2 2 0 8 0 amappl1 80 9497 0 8933 15 0 15 15 0 8 1 amappl 88 2529 0 2437 4 0 4 4 0 92 0 uvmvnodes 80 99 0 0 3 0 3 3 0 8 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 3 0 0 1 0 1 1 0 8 0 uaddrrnd 24 461 0 439 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 461 0 439 1 0 1 1 0 8 0 vmmpekpl 168 5658 0 5608 3 0 3 3 0 8 0 vmmpepl 168 37968 0 36531 89 0 89 89 0 357 12 vmsppl 488 460 0 439 5 0 5 5 0 8 1 rwobjpl 80 14362 0 13472 25 0 25 25 0 8 1 pdppl 4096 929 0 878 103 20 83 87 0 8 32 pvpl 32 9617 0 0 78 0 78 78 0 265 0 pmappl 256 460 0 439 3 0 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 269 0 23 8 0 8 8 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83436fb8) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd806f6daaa0,41c0,fffffd80097fd680,ffff80002a2f0528) at ffs_inode_alloc+0x94e ufs_mkdir(ffff80002a2f0590) at ufs_mkdir+0xfc sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806ff08618,ffff80002a2f06f0,ffff80002a2f0720,ffff80002a2f0620) at VOP_MKDIR+0x101 sys/kern/vfs_vops.c:394 domkdirat(ffff8000fffee7e0,ffffff9c,7d2acd6c1eb0,1c0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3143 syscall(ffff80002a2f08a0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a2f08a0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7d2acd6c1e70, count: -8 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffff8000299bdff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:394 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x2c kd_curproc sys/dev/kcov.c:584 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x2c sys/dev/kcov.c:153 __mp_lock(ffffffff839d2780) at __mp_lock+0x1a3 __mp_lock_spin sys/kern/kern_lock.c:142 [inline] __mp_lock(ffffffff839d2780) at __mp_lock+0x1a3 sys/kern/kern_lock.c:173 syscall(ffff80002a2c8df0) at syscall+0xaf4 mi_syscall sys/sys/syscall_mi.h:175 [inline] syscall(ffff80002a2c8df0) at syscall+0xaf4 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f0c15052040, count: 8 ddb{1}> trace x86_ipi_db(ffff8000299bdff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:394 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x2c kd_curproc sys/dev/kcov.c:584 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x2c sys/dev/kcov.c:153 __mp_lock(ffffffff839d2780) at __mp_lock+0x1a3 __mp_lock_spin sys/kern/kern_lock.c:142 [inline] __mp_lock(ffffffff839d2780) at __mp_lock+0x1a3 sys/kern/kern_lock.c:173 syscall(ffff80002a2c8df0) at syscall+0xaf4 mi_syscall sys/sys/syscall_mi.h:175 [inline] syscall(ffff80002a2c8df0) at syscall+0xaf4 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f0c15052040, count: -7