panic: ffs_valloc: dup alloc Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *518962 38765 0 0 0x4000000 0K syz-executor 293976 75035 0 0x2 0 1 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff830dc629) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd806bdd1888,4000,fffffd807f7d3548,ffff800031386858) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff8000313868c0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806bf65968,ffff800031386a20,ffff800031386a50,ffff800031386950) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff8000ffff2cc8,ffffff9c,200012c0,0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3100 syscall(ffff800031386bd0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff800031386bd0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xba469ddcc00, 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:437 panic(ffffffff830dc629) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd806bdd1888,4000,fffffd807f7d3548,ffff800031386858) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff8000313868c0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806bf65968,ffff800031386a20,ffff800031386a50,ffff800031386950) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff8000ffff2cc8,ffffff9c,200012c0,0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3100 syscall(ffff800031386bd0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff800031386bd0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xba469ddcc00, count: -8 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000313865e0 rbx 0xffffffff83409d87 cpu_info_full_primary+0x2d87 rdx 0xffff800001194b40 rcx 0xffff8000ffff2cc8 rax 0xffffffff83408ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xf3f407fddf3c229b r11 0xa54035b6e7d229dc r12 0xffffffff83409b88 cpu_info_full_primary+0x2b88 r13 0 r14 0 r15 0x1 rip 0xffffffff8133b9e5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff8000313865d0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=518962 pid=38765 tcnt=2 stat=onproc flags process=0 proc=4000000 runpri=32, usrpri=50, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000ffff3bf8,0xffff8000ffff2030 process=0xffff8000ffff71f0 user=0xffff800031381000, vmspace=0xfffffd806bf58a50 estcpu=36, cpticks=2, pctcpu=0.0, user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 90891 211237 85071 0 2 0x40 syz-executor 84740 359089 13022 0 2 0 syz-executor 84740 170209 13022 0 3 0x4000080 fsleep syz-executor 38765 186143 59923 0 2 0 syz-executor *38765 518962 59923 0 7 0x4000000 syz-executor 82048 67283 56095 -1 2 0x10 syz-executor 82048 80021 56095 -1 3 0x4000090 piperd syz-executor 85071 166165 29782 0 3 0x82 ppwait syz-executor 50764 495781 75035 0 3 0x80 nanoslp syz-executor 50764 415908 75035 0 3 0x4000080 ttyopn syz-executor 50764 81050 75035 0 3 0x4000080 fsleep syz-executor 69242 215052 0 0 3 0x14200 bored sosplice 13022 146251 29782 0 3 0x82 nanoslp syz-executor 56095 228792 29782 0 2 0x2 syz-executor 59923 131108 29782 0 2 0x482 syz-executor 75035 293976 29782 0 7 0x2 syz-executor 29782 439908 33070 0 3 0x82 wait syz-executor 33070 426193 55146 0 3 0x10008a sigsusp ksh 55146 222671 41255 0 3 0x98 kqread sshd-session 41255 137263 83338 0 3 0x92 kqread sshd-session 52155 113004 1 0 3 0x100083 ttyin getty 83338 28631 1 0 3 0x88 kqread sshd 89941 209096 80790 74 3 0x1100092 bpf pflogd 80790 91304 1 0 3 0x80 sbwait pflogd 97552 366576 19088 73 3 0x1100090 kqread syslogd 19088 50097 1 0 3 0x100082 sbwait syslogd 16087 188864 1 0 3 0x100080 kqread resolvd 86361 242088 1724 77 3 0x100092 kqread dhcpleased 43307 364266 1724 77 3 0x100092 kqread dhcpleased 1724 317148 1 0 3 0x80 kqread dhcpleased 10807 132449 0 0 3 0x14200 bored smr 78536 444053 0 0 2 0x14200 zerothread 51440 487201 0 0 3 0x14200 aiodoned aiodoned 28622 190529 0 0 3 0x14200 syncer update 57367 452124 0 0 3 0x14200 cleaner cleaner 99887 111008 0 0 3 0x14200 reaper reaper 66076 193463 0 0 3 0x14200 pgdaemon pagedaemon 32091 270854 0 0 3 0x14200 bored viomb 55723 231910 0 0 3 0x40014200 acpi0 acpi0 71578 258783 0 0 3 0x40014200 idle1 31194 330689 0 0 3 0x14200 bored softnet3 11054 337488 0 0 3 0x14200 bored softnet2 26241 184269 0 0 3 0x14200 bored softnet1 75063 137590 0 0 3 0x14200 bored softnet0 28519 402641 0 0 3 0x14200 bored systqmp 41915 46820 0 0 3 0x14200 bored systq 27872 390883 0 0 3 0x14200 tmoslp softclockmp 55325 126270 0 0 3 0x40014200 tmoslp softclock 86745 97756 0 0 3 0x40014200 idle0 1 454732 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 38765 (syz-executor) thread 0xffff8000ffff2cc8 (518962) exclusive rrwlock inode r = 0 (0xfffffd806bdd11b0) #0 witness_lock+0x5b8 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5b8 sys/kern/subr_witness.c:1151 #1 rw_enter+0x41b sys/kern/kern_rwlock.c:309 #2 rrw_enter+0xbe sys/kern/kern_rwlock.c:464 #3 VOP_LOCK+0xa6 sys/kern/vfs_vops.c:524 #4 ufs_ihashins+0x4f sys/ufs/ufs/ufs_ihash.c:120 #5 ffs_vget+0x187 sys/ufs/ffs/ffs_vfsops.c:1230 #6 ffs_inode_alloc+0x283 sys/ufs/ffs/ffs_alloc.c:393 #7 ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 #8 VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 #9 domkdirat+0x179 sys/kern/vfs_syscalls.c:3100 #10 syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] #10 syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 #11 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806bdd1920) #0 witness_lock+0x5b8 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5b8 sys/kern/subr_witness.c:1151 #1 rw_enter+0x41b sys/kern/kern_rwlock.c:309 #2 rrw_enter+0xbe sys/kern/kern_rwlock.c:464 #3 VOP_LOCK+0xa6 sys/kern/vfs_vops.c:524 #4 vn_lock+0xa4 sys/kern/vfs_vnops.c:564 #5 vfs_lookup+0x109 sys/kern/vfs_lookup.c:418 #6 namei+0x7aa sys/kern/vfs_lookup.c:250 #7 domkdirat+0x8b sys/kern/vfs_syscalls.c:3085 #8 syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] #8 syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 #9 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8358ae90) #0 witness_lock+0x5b8 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5b8 sys/kern/subr_witness.c:1151 #1 syscall+0xad6 mi_syscall sys/sys/syscall_mi.h:179 [inline] #1 syscall+0xad6 sys/arch/amd64/amd64/trap.c:577 #2 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10183 10152K 10222K 166960K 11284 0 pcb 17 12K 12K 166960K 20 0 rtable 206 5K 6K 166960K 349 0 pf 32 17K 18K 166960K 49 0 ifaddr 38 6K 7K 166960K 47 0 ifgroup 51 2K 2K 166960K 59 0 counters 62 36K 36K 166960K 68 0 ioctlops 0 0K 4K 166960K 1487 0 iov 1 12K 12K 166960K 1 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1369 86K 86K 166960K 1419 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 1K 166960K 2 0 VM map 2 1K 1K 166960K 2 0 sem 3 0K 0K 166960K 3 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1697 195K 286K 166960K 12548 0 file desc 15 53K 89K 166960K 161 0 proc 69 91K 127K 166960K 529 0 subproc 104 6K 6K 166960K 117 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 87 6K 7K 166960K 99 0 ether_multi 1 0K 0K 166960K 1 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 55 254K 254K 166960K 55 0 exec 0 0K 1K 166960K 363 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 211 72K 73K 166960K 3078 0 UVM aobj 3 2K 2K 166960K 3 0 pinsyscall 40 80K 103K 166960K 1230 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 NDP 25 1K 2K 166960K 30 0 temp 34 6806K 6870K 166960K 3992 0 kqueue 13 20K 22K 166960K 23 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 24 0 0 1 0 1 1 0 8 0 rtpcb 120 36 0 33 1 0 1 1 0 8 0 rtentry 112 111 0 15 4 0 4 4 0 8 0 unpcb 144 59 0 42 1 0 1 1 0 8 0 syncache 336 3 0 3 2 1 1 1 0 8 1 tcpcb 808 20 0 15 1 0 1 1 0 8 0 arp 120 18 0 2 1 0 1 1 0 8 0 inpcb 336 88 0 80 2 0 2 2 0 8 1 nd6 136 24 0 3 1 0 1 1 0 8 0 kcovpl 48 9 0 1 1 0 1 1 0 8 0 ppxss 1168 2 0 2 1 0 1 1 0 8 1 pfosfp 40 1429 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1429 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 376 20 0 0 2 0 2 2 0 8 0 pfrule 1344 21 0 15 2 0 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 453 0 50 28 0 28 28 0 8 1 art_table 32 454 0 50 4 0 4 4 0 8 0 art_node 16 110 0 23 1 0 1 1 0 8 0 sysvmsgpl 40 1 0 0 1 0 1 1 0 8 0 semapl 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 1598 0 90 95 0 95 95 0 8 0 ffsino 272 1602 0 94 101 0 101 101 0 8 0 nchpl 144 1821 0 138 63 0 63 63 0 8 0 uvmvnodes 80 1743 0 0 36 0 36 36 0 8 0 vnodes 216 1743 0 0 97 0 97 97 0 8 0 namei 1024 5695 0 5694 2 1 1 1 0 8 0 percpumem 16 48 0 3 1 0 1 1 0 8 0 kstatmem 264 28 0 6 2 0 2 2 0 8 0 scxspl 216 5457 0 5457 5 2 3 3 1 8 3 plimitpl 152 30 0 13 1 0 1 1 0 8 0 sigapl 424 458 0 410 7 0 7 7 0 8 1 futexpl 64 468 0 466 1 0 1 1 0 8 0 knotepl 120 51 0 0 2 0 2 2 0 8 0 kqueuepl 216 28 0 19 1 0 1 1 0 8 0 pipepl 320 112 0 84 4 1 3 3 0 8 0 fdescpl 496 439 0 410 5 0 5 5 0 8 1 filepl 152 1620 0 1377 11 0 11 11 0 8 1 lockfpl 104 18 0 16 1 0 1 1 0 8 0 lockfspl 48 10 0 8 1 0 1 1 0 8 0 sessionpl 144 23 0 14 1 0 1 1 0 8 0 pgrppl 48 32 0 15 1 0 1 1 0 8 0 ucredpl 104 93 0 79 1 0 1 1 0 8 0 zombiepl 144 413 0 410 2 1 1 1 0 8 0 processpl 1160 458 0 410 5 0 5 5 0 8 1 procpl 648 506 0 453 6 0 6 6 0 8 1 sosppl 168 1 0 1 1 0 1 1 0 8 1 sockpl 664 183 0 155 5 1 4 4 0 8 1 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 229 0 0 29 0 29 29 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 231 0 0 15 0 15 15 0 8 0 bufpl 280 2386 0 98 164 0 164 164 0 8 0 anonpl 24 138726 0 135546 29 6 23 25 0 185 0 amapchunkpl 152 9814 0 9390 22 1 21 21 0 158 3 amappl16 200 3634 0 3620 6 4 2 5 0 8 0 amappl15 192 11 0 11 1 1 0 1 0 8 0 amappl14 184 116 0 104 1 0 1 1 0 8 0 amappl13 176 11 0 11 2 2 0 1 0 8 0 amappl12 168 1130 0 1102 2 0 2 2 0 8 0 amappl11 160 54 0 40 1 0 1 1 0 8 0 amappl10 152 8 0 8 1 1 0 1 0 8 0 amappl9 144 142 0 142 1 1 0 1 0 8 0 amappl8 136 25 0 23 1 0 1 1 0 8 0 amappl7 128 107 0 95 1 0 1 1 0 8 0 amappl6 120 170 0 169 2 1 1 1 0 8 0 amappl5 112 131 0 120 1 0 1 1 0 8 0 amappl4 104 309 0 291 1 0 1 1 0 8 0 amappl3 96 1853 0 1752 5 1 4 4 0 8 0 amappl2 88 617 0 556 2 0 2 2 0 8 0 amappl1 80 7821 0 7243 17 3 14 14 0 8 1 amappl 88 2711 0 2563 6 1 5 5 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 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 439 0 410 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 439 0 410 1 0 1 1 0 8 0 vmmpekpl 168 5899 0 5866 2 0 2 2 0 8 0 vmmpepl 168 36104 0 34350 90 5 85 85 0 357 8 vmsppl 440 438 0 410 6 1 5 5 0 8 1 rwobjpl 56 16372 0 13720 41 2 39 39 0 8 0 pdppl 4096 885 0 820 104 21 83 83 0 8 18 pvpl 32 9721 0 0 80 0 80 80 0 265 1 pmappl 248 438 0 410 3 0 3 3 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 389 0 25 11 0 11 11 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:437 panic(ffffffff830dc629) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd806bdd1888,4000,fffffd807f7d3548,ffff800031386858) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff8000313868c0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806bf65968,ffff800031386a20,ffff800031386a50,ffff800031386950) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff8000ffff2cc8,ffffff9c,200012c0,0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3100 syscall(ffff800031386bd0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff800031386bd0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xba469ddcc00, count: -8 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffff800029b7bff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __mp_lock(ffffffff8358ac88) at __mp_lock+0x199 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff8358ac88) at __mp_lock+0x199 sys/kern/kern_lock.c:144 syscall(ffff80002a0ba430) at syscall+0xad6 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff80002a0ba430) at syscall+0xad6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f5b71fdc2c0, count: 9 ddb{1}> trace x86_ipi_db(ffff800029b7bff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __mp_lock(ffffffff8358ac88) at __mp_lock+0x199 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff8358ac88) at __mp_lock+0x199 sys/kern/kern_lock.c:144 syscall(ffff80002a0ba430) at syscall+0xad6 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff80002a0ba430) at syscall+0xad6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f5b71fdc2c0, count: -6