panic: ffs_valloc: dup alloc Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *222331 97229 0 0x2 0 0K syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff830e3cf3) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd807e495110,41c0,fffffd807f7d3208,ffff80002df77cb8) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff80002df77d20) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806ee19978,ffff80002df77e80,ffff80002df77eb0,ffff80002df77db0) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff80003619d468,ffffff9c,7dcfff97e000,1c0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3099 syscall(ffff80002df78030) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff80002df78030) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7dcfff97dfc0, 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(ffffffff830e3cf3) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd807e495110,41c0,fffffd807f7d3208,ffff80002df77cb8) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff80002df77d20) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806ee19978,ffff80002df77e80,ffff80002df77eb0,ffff80002df77db0) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff80003619d468,ffffff9c,7dcfff97e000,1c0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3099 syscall(ffff80002df78030) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff80002df78030) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7dcfff97dfc0, count: -8 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002df77a40 rbx 0xffffffff8348dd87 cpu_info_full_primary+0x2d87 rdx 0 rcx 0xffff80003619d468 rax 0xffffffff8348cff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x6e1a2655fd5249ce r11 0xa36a8add8c9d86a0 r12 0xffffffff8348db88 cpu_info_full_primary+0x2b88 r13 0 r14 0 r15 0x1 rip 0xffffffff82535fb5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002df77a30 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=222331 pid=97229 tcnt=1 stat=onproc flags process=2 proc=0 runpri=50, usrpri=86, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80003619c028,0xffff80003619d700 process=0xffff800034f904a8 user=0xffff80002df73000, vmspace=0xfffffd806bff4000 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 78383 272895 56774 0 2 0 syz-executor *97229 222331 30901 0 7 0x2 syz-executor 47874 31829 5125 0 2 0x480 syz-executor 47874 372486 5125 0 3 0x4000080 ttyin syz-executor 47874 164923 5125 0 3 0x4000080 fsleep syz-executor 64527 107399 69868 0 2 0x480 syz-executor 64527 187848 69868 0 3 0x4000080 sbwait syz-executor 64527 366449 69868 0 3 0x4000080 fsleep syz-executor 69868 208602 30901 0 3 0x82 nanoslp syz-executor 92374 341800 30901 0 3 0x82 piperd syz-executor 7768 18509 30901 0 3 0x82 nanoslp syz-executor 7470 194954 30901 0 3 0x82 piperd syz-executor 56774 467374 30901 0 3 0x82 nanoslp syz-executor 5125 382497 30901 0 3 0x82 nanoslp syz-executor 802 503011 30901 0 3 0x82 nanoslp syz-executor 12035 54316 1 0 3 0x100083 ttyin getty 75308 165711 0 0 3 0x14200 bored sosplice 30901 176238 2576 0 2 0x2 syz-executor 2576 493052 87201 0 3 0x10008a sigsusp ksh 87201 87284 56948 0 3 0x98 kqread sshd-session 56948 131080 59586 0 3 0x92 kqread sshd-session 59586 394575 1 0 3 0x88 kqread sshd 31009 308045 2188 74 3 0x1100092 bpf pflogd 2188 434226 1 0 3 0x80 sbwait pflogd 40220 298657 31600 73 3 0x1100090 kqread syslogd 31600 72682 1 0 3 0x100082 sbwait syslogd 88032 184388 1 0 3 0x100080 kqread resolvd 68570 27739 89232 77 3 0x100092 kqread dhcpleased 82233 388948 89232 77 3 0x100092 kqread dhcpleased 89232 56904 1 0 3 0x80 kqread dhcpleased 86241 325663 0 0 3 0x14200 bored smr 25619 501491 0 0 2 0x14200 zerothread 16747 230748 0 0 3 0x14200 aiodoned aiodoned 36267 334615 0 0 3 0x14200 syncer update 32332 242365 0 0 3 0x14200 cleaner cleaner 93271 106745 0 0 3 0x14200 reaper reaper 60689 441223 0 0 3 0x14200 pgdaemon pagedaemon 71900 215018 0 0 3 0x14200 bored viomb 20982 297743 0 0 3 0x40014200 acpi0 acpi0 22744 134772 0 0 7 0x40014200 idle1 79208 85302 0 0 3 0x14200 bored softnet3 71692 488088 0 0 3 0x14200 bored softnet2 51395 257352 0 0 3 0x14200 bored softnet1 21230 250898 0 0 3 0x14200 bored softnet0 91928 112356 0 0 3 0x14200 bored systqmp 30849 403966 0 0 3 0x14200 bored systq 72049 128147 0 0 3 0x14200 tmoslp softclockmp 52412 75848 0 0 2 0x40014200 softclock 61887 343621 0 0 3 0x40014200 idle0 1 388256 0 0 3 0x80082 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 97229 (syz-executor) thread 0xffff80003619d468 (222331) exclusive rrwlock inode r = 0 (0xfffffd8070a3c1a8) #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:149 #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:3099 #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 (0xfffffd807e4951a8) #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:3084 #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 (0xffffffff83547560) #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 10205 10102K 10488K 166960K 12660 0 pcb 17 13K 13K 166960K 214 0 rtable 191 7K 8K 166960K 1671 0 pf 37 18K 22K 166960K 193 0 ifaddr 38 7K 8K 166960K 228 0 ifgroup 55 2K 2K 166960K 261 0 sysctl 2 0K 1K 166960K 6 0 counters 64 36K 36K 166960K 172 0 ioctlops 0 0K 4K 166960K 1723 0 iov 0 0K 24K 166960K 54 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1455 91K 92K 166960K 2702 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 12 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 230 0 dirhash 12 2K 2K 166960K 30 0 ACPI 1690 195K 286K 166960K 12418 0 file desc 15 50K 89K 166960K 1658 0 sigio 0 0K 0K 166960K 25 0 proc 70 91K 128K 166960K 1730 0 subproc 91 5K 6K 166960K 611 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 180 0 in_multi 80 6K 7K 166960K 565 0 ether_multi 1 0K 0K 166960K 9 0 mrt 1 0K 0K 166960K 4 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 121 546K 546K 166960K 121 0 exec 0 0K 1K 166960K 986 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 206 64K 91K 166960K 14486 0 UVM aobj 77 3K 3K 166960K 79 0 pinsyscall 40 80K 102K 166960K 3751 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 1 0K 0K 166960K 62 0 NDP 12 0K 2K 166960K 162 0 temp 70 6823K 6901K 166960K 65617 0 kqueue 13 20K 30K 166960K 175 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 180 0 177 1 0 1 1 0 8 0 rtentry 112 591 0 507 5 2 3 4 0 8 0 unpcb 144 1111 0 1092 17 15 2 6 0 8 1 syncache 336 4 0 4 3 3 0 1 0 8 0 tcpcb 808 410 0 406 18 17 1 8 0 8 0 arp 120 105 0 88 1 0 1 1 0 8 0 inpcb 336 1634 0 1625 27 25 2 7 0 8 0 nd6 136 154 0 134 1 0 1 1 0 8 0 pkpcb 40 8 0 8 3 2 1 1 0 8 1 kcovpl 48 47 0 40 1 0 1 1 0 8 0 ppxss 1168 8 0 8 5 4 1 1 0 8 1 pfstscr 40 5 0 5 3 2 1 1 0 8 1 pffrag 232 23 0 22 2 1 1 1 0 482 0 pffrnode 88 23 0 22 2 1 1 1 0 8 0 pffrent 40 90 0 89 2 1 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 pftag 88 3 0 2 2 1 1 1 0 8 0 pfstitem 24 124 0 107 1 0 1 1 0 8 0 pfstkey 128 130 0 113 2 0 2 2 0 8 0 pfstate 376 128 0 111 5 0 5 5 0 8 1 pfrule 1344 36 0 26 2 1 1 2 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 2326 0 1964 35 6 29 29 0 8 3 art_table 32 2328 0 1964 4 0 4 4 0 8 0 art_node 16 586 0 511 1 0 1 1 0 8 0 sysvmsgpl 40 1 0 1 1 1 0 1 0 8 0 semapl 112 226 0 216 1 0 1 1 0 8 0 shmpl 112 76 0 2 3 0 3 3 0 8 0 dirhash 1024 29 0 12 3 0 3 3 0 8 0 dino2pl 256 3328 0 1750 100 0 100 100 0 8 0 ffsino 272 3329 0 1751 106 0 106 106 0 8 0 nchpl 144 4913 0 3182 65 0 65 65 0 8 0 uvmvnodes 80 4472 0 0 92 0 92 92 0 8 0 vnodes 216 4472 0 0 249 0 249 249 0 8 0 namei 1024 20876 0 20875 7 6 1 2 0 8 0 percpumem 16 100 0 54 1 0 1 1 0 8 0 kstatmem 264 132 0 108 2 0 2 2 0 8 0 scsiplug 72 1 0 1 1 1 0 1 0 8 0 scxspl 216 33985 0 33985 13 12 1 8 1 8 1 plimitpl 152 381 0 363 1 0 1 1 0 8 0 sigapl 424 1882 0 1834 9 2 7 7 0 8 0 futexpl 64 17993 0 17991 7 6 1 1 0 8 0 knotepl 120 531 0 0 15 0 15 15 0 8 0 kqueuepl 216 357 0 348 7 4 3 3 0 8 2 pipepl 320 349 0 322 3 0 3 3 0 8 0 fdescpl 496 1862 0 1833 6 1 5 5 0 8 0 filepl 152 10681 0 10442 35 23 12 19 0 8 1 lockfpl 104 537 0 534 3 2 1 2 0 8 0 lockfspl 48 194 0 191 1 0 1 1 0 8 0 sessionpl 144 63 0 54 1 0 1 1 0 8 0 pgrppl 48 125 0 108 1 0 1 1 0 8 0 ucredpl 104 1362 0 1349 1 0 1 1 0 8 0 zombiepl 144 1836 0 1834 2 1 1 1 0 8 0 processpl 1160 1882 0 1834 5 1 4 5 0 8 0 procpl 648 3384 0 3332 7 1 6 6 0 8 0 srpgc 96 6 0 6 3 3 0 1 0 8 0 sosppl 168 6 0 6 4 3 1 1 0 8 1 sockpl 664 2942 0 2911 46 40 6 17 0 8 2 mcl64k 65536 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 243 0 0 31 1 30 31 0 8 0 mtagpl 96 8 0 0 1 0 1 1 0 8 0 mbufpl 256 394 0 0 22 1 21 21 0 8 0 bufpl 280 8955 0 2179 485 0 485 485 0 8 0 anonpl 24 299416 0 296112 95 44 51 63 0 185 19 amapchunkpl 152 46742 0 46335 58 26 32 32 0 158 11 amappl16 200 5976 0 5959 51 37 14 14 0 8 11 amappl15 192 12 0 12 1 1 0 1 0 8 0 amappl14 184 195 0 183 1 0 1 1 0 8 0 amappl13 176 26 0 26 1 1 0 1 0 8 0 amappl12 168 3129 0 3102 3 1 2 2 0 8 0 amappl11 160 58 0 44 1 0 1 1 0 8 0 amappl10 152 11 0 11 1 1 0 1 0 8 0 amappl9 144 138 0 138 2 2 0 1 0 8 0 amappl8 136 19 0 17 1 0 1 1 0 8 0 amappl7 128 183 0 171 1 0 1 1 0 8 0 amappl6 120 553 0 550 1 0 1 1 0 8 0 amappl5 112 314 0 301 1 0 1 1 0 8 0 amappl4 104 443 0 423 1 0 1 1 0 8 0 amappl3 96 8337 0 8255 3 0 3 3 0 8 0 amappl2 88 2156 0 2078 2 0 2 2 0 8 0 amappl1 80 14733 0 14158 14 1 13 14 0 8 0 amappl 88 13757 0 13611 5 0 5 5 0 92 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 2 0 1 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 78 0 2 2 0 2 2 0 8 0 uaddrrnd 24 1862 0 1833 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1862 0 1833 1 0 1 1 0 8 0 vmmpekpl 168 16431 0 16374 3 0 3 3 0 8 0 vmmpepl 168 118656 0 116912 118 23 95 95 0 357 10 vmsppl 440 1861 0 1833 6 2 4 5 0 8 0 rwobjpl 56 38930 0 33480 82 1 81 81 0 8 2 pdppl 4096 3731 0 3666 163 92 71 83 0 8 6 pvpl 32 30254 0 0 244 0 244 244 0 265 0 pmappl 248 1861 0 1833 3 0 3 3 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 528 0 157 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(ffffffff830e3cf3) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd807e495110,41c0,fffffd807f7d3208,ffff80002df77cb8) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff80002df77d20) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806ee19978,ffff80002df77e80,ffff80002df77eb0,ffff80002df77db0) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff80003619d468,ffffff9c,7dcfff97e000,1c0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3099 syscall(ffff80002df78030) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff80002df78030) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7dcfff97dfc0, 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 acpicpu_idle() at acpicpu_idle+0x41e sys/dev/acpi/acpicpu.c:1219 sched_idle(ffff800029b7bff0) at sched_idle+0x558 sys/kern/kern_sched.c:182 end trace frame: 0x0, count: 10 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 acpicpu_idle() at acpicpu_idle+0x41e sys/dev/acpi/acpicpu.c:1219 sched_idle(ffff800029b7bff0) at sched_idle+0x558 sys/kern/kern_sched.c:182 end trace frame: 0x0, count: -5