panic: ffs_valloc: dup alloc Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *438180 26437 0 0x2 0 0 syz-executor 26711 55761 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(fffffd806bef9ee8,41ed,fffffd807f7d3478,ffff8000371e1b48) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff8000371e1bb0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd8071256cf8,ffff8000371e1d10,ffff8000371e1d40,ffff8000371e1c40) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff80002a143488,ffffff9c,73d615961460,1ff) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3100 syscall(ffff8000371e1ec0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff8000371e1ec0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x73d6159614f0, 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(fffffd806bef9ee8,41ed,fffffd807f7d3478,ffff8000371e1b48) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff8000371e1bb0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd8071256cf8,ffff8000371e1d10,ffff8000371e1d40,ffff8000371e1c40) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff80002a143488,ffffff9c,73d615961460,1ff) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3100 syscall(ffff8000371e1ec0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff8000371e1ec0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x73d6159614f0, count: -8 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000371e18d0 rbx 0xffffffff83409d87 cpu_info_full_primary+0x2d87 rdx 0 rcx 0xffff80002a143488 rax 0xffffffff83408ff0 cpu_info_full_primary+0x1ff0 r8 0 r9 0x8080808080808080 r10 0x2368a894d725fc04 r11 0x30f51adf73378088 r12 0xffffffff83409b88 cpu_info_full_primary+0x2b88 r13 0 r14 0 r15 0x1 rip 0xffffffff8133b9e5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff8000371e18c0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=438180 pid=26437 tcnt=1 stat=onproc flags process=2 proc=0 runpri=17, usrpri=86, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a1427e0,0xffff80002a142568 process=0xffff800029fe9fc0 user=0xffff8000371dc000, vmspace=0xfffffd806cd01dd8 estcpu=36, cpticks=1, pctcpu=0.3, user=0, sys=3, intr=1 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 32855 453272 2820 0 3 0x80 nanoslp syz-executor 32855 116721 2820 0 3 0x4000080 ttyin syz-executor 32855 404878 2820 0 3 0x4000080 fsleep syz-executor 21712 85480 33100 0 3 0x80 nanoslp syz-executor 21712 405851 33100 0 3 0x4000080 fsleep syz-executor 21712 520806 33100 0 3 0x4000080 msgwait syz-executor 21712 144970 33100 0 3 0x4000080 fsleep syz-executor 31829 43674 66005 0 3 0x80 nanoslp syz-executor 31829 181986 66005 0 3 0x4000080 ttyopn syz-executor 31829 33122 66005 0 3 0x4000080 fsleep syz-executor 31829 425961 66005 0 3 0x4000080 ttyopn syz-executor *26437 438180 50755 0 7 0x2 syz-executor 55761 26711 50755 0 7 0x2 syz-executor 33100 444682 50755 0 3 0x82 nanoslp syz-executor 2820 11587 50755 0 3 0x82 nanoslp syz-executor 66005 408325 50755 0 3 0x82 nanoslp syz-executor 93277 92325 0 0 3 0x14200 bored sosplice 82486 372421 0 0 3 0x14280 nfsidl nfsio 4791 337300 0 0 3 0x14280 nfsidl nfsio 28140 94669 0 0 3 0x14280 nfsidl nfsio 11144 150434 0 0 3 0x14280 nfsidl nfsio 84847 132841 0 0 3 0x14280 nfsidl nfsio 40199 119432 0 0 3 0x14280 nfsidl nfsio 27282 291736 0 0 3 0x14280 nfsidl nfsio 83573 341098 0 0 3 0x14280 nfsidl nfsio 80901 491913 0 0 3 0x14280 nfsidl nfsio 54971 32465 0 0 3 0x14280 nfsidl nfsio 80375 351365 0 0 3 0x14280 nfsidl nfsio 33712 344750 0 0 3 0x14280 nfsidl nfsio 72160 441090 0 0 3 0x14280 nfsidl nfsio 31425 60980 0 0 3 0x14280 nfsidl nfsio 96402 13715 0 0 3 0x14280 nfsidl nfsio 2346 203368 0 0 3 0x14280 nfsidl nfsio 90810 484793 0 0 3 0x14280 nfsidl nfsio 69490 462463 0 0 3 0x14280 nfsidl nfsio 39781 265551 0 0 3 0x14280 nfsidl nfsio 54677 410625 0 0 3 0x14280 nfsidl nfsio 50755 433867 73226 0 3 0x82 wait syz-executor 73226 390477 64242 0 3 0x10008a sigsusp ksh 64242 198949 45189 0 3 0x98 kqread sshd-session 45189 21145 85042 0 3 0x92 kqread sshd-session 16852 17427 1 0 3 0x100083 ttyin getty 85042 308391 1 0 3 0x88 kqread sshd 29336 30116 37182 74 3 0x1100092 bpf pflogd 37182 203448 1 0 3 0x80 sbwait pflogd 51227 74047 2020 73 3 0x1100090 kqread syslogd 2020 504745 1 0 3 0x100082 sbwait syslogd 89530 504991 1 0 3 0x100080 kqread resolvd 12933 389597 45272 77 3 0x100092 kqread dhcpleased 43779 391187 45272 77 3 0x100092 kqread dhcpleased 45272 357316 1 0 3 0x80 kqread dhcpleased 39239 325481 0 0 3 0x14200 bored smr 82325 98674 0 0 3 0x14200 pgzero zerothread 12266 211994 0 0 3 0x14200 aiodoned aiodoned 78746 25972 0 0 3 0x14200 syncer update 29243 521642 0 0 3 0x14200 cleaner cleaner 49709 427274 0 0 3 0x14200 reaper reaper 82315 301623 0 0 3 0x14200 pgdaemon pagedaemon 79673 17772 0 0 3 0x14200 bored viomb 72371 132748 0 0 3 0x40014200 acpi0 acpi0 45949 254342 0 0 3 0x40014200 idle1 5154 460423 0 0 3 0x14200 bored softnet3 52349 306537 0 0 3 0x14200 bored softnet2 22437 317098 0 0 3 0x14200 bored softnet1 57781 38404 0 0 3 0x14200 bored softnet0 43136 480896 0 0 3 0x14200 bored systqmp 52172 266642 0 0 3 0x14200 bored systq 45017 191900 0 0 3 0x14200 tmoslp softclockmp 69868 298932 0 0 3 0x40014200 tmoslp softclock 74250 200630 0 0 3 0x40014200 idle0 1 291700 0 0 3 0x80082 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 26437 (syz-executor) thread 0xffff80002a143488 (438180) exclusive rrwlock inode r = 0 (0xfffffd80740946f8) #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 (0xfffffd806bef9f80) #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 10195 10170K 10477K 166960K 11842 0 pcb 17 13K 14K 166960K 123 0 rtable 237 6K 7K 166960K 985 0 pf 34 17K 25K 166960K 94 0 ifaddr 43 7K 8K 166960K 119 0 ifgroup 55 2K 2K 166960K 135 0 sysctl 3 0K 0K 166960K 3 0 counters 64 36K 36K 166960K 106 0 ioctlops 0 0K 4K 166960K 1523 0 iov 0 0K 12K 166960K 15 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1430 90K 90K 166960K 1903 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 6 0 VM map 2 1K 1K 166960K 2 0 sem 11 0K 0K 166960K 11 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1697 195K 286K 166960K 12548 0 file desc 14 49K 89K 166960K 636 0 sigio 0 0K 0K 166960K 8 0 proc 70 91K 128K 166960K 1002 0 subproc 104 6K 6K 166960K 312 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 37 0 in_multi 99 7K 7K 166960K 287 0 ether_multi 1 0K 0K 166960K 3 0 mrt 1 0K 0K 166960K 2 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 85 387K 387K 166960K 85 0 exec 0 0K 1K 166960K 699 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 225 72K 91K 166960K 6558 0 UVM aobj 8 2K 2K 166960K 11 0 pinsyscall 39 78K 102K 166960K 2121 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 13 0 NDP 22 1K 2K 166960K 81 0 temp 52 6814K 6896K 166960K 14924 0 kqueue 13 20K 28K 166960K 61 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 81 0 78 1 0 1 1 0 8 0 rtentry 112 361 0 250 4 0 4 4 0 8 0 unpcb 144 229 0 207 4 2 2 2 0 8 1 syncache 336 4 0 4 1 1 0 1 0 8 0 tcpqe 32 2 0 2 1 1 0 1 0 8 0 tcpcb 808 139 0 133 6 5 1 5 0 8 0 arp 120 84 0 66 1 0 1 1 0 8 0 inpcb 336 514 0 505 7 5 2 5 0 8 1 nd6 136 76 0 52 1 0 1 1 0 8 0 pkpcb 40 2 0 2 2 2 0 1 0 8 0 kcovpl 48 24 0 16 1 0 1 1 0 8 0 ppxss 1168 4 0 4 2 2 0 1 0 8 0 pffrag 232 4 0 0 1 0 1 1 0 482 0 pffrnode 88 4 0 0 1 0 1 1 0 8 0 pffrent 40 5 0 1 1 0 1 1 0 8 0 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 57 0 27 1 0 1 1 0 8 0 pfstkey 128 57 0 27 2 0 2 2 0 8 0 pfstate 376 57 0 27 4 0 4 4 0 8 0 pfrule 1344 22 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 1236 0 747 31 0 31 31 0 8 0 art_table 32 1237 0 747 4 0 4 4 0 8 0 art_node 16 360 0 259 1 0 1 1 0 8 0 sysvmsgpl 40 8 0 4 1 0 1 1 0 8 0 semapl 112 9 0 0 1 0 1 1 0 8 0 shmpl 112 8 0 3 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 2054 0 524 96 0 96 96 0 8 0 ffsino 272 2054 0 524 103 0 103 103 0 8 0 nchpl 144 2638 0 937 64 0 64 64 0 8 0 uvmvnodes 80 2607 0 0 54 0 54 54 0 8 0 vnodes 216 2607 0 0 145 0 145 145 0 8 0 namei 1024 10043 0 10042 4 3 1 2 0 8 0 percpumem 16 67 0 21 1 0 1 1 0 8 0 kstatmem 264 66 0 42 2 0 2 2 0 8 0 scxspl 216 14896 0 14896 11 5 6 8 1 8 6 plimitpl 152 139 0 122 1 0 1 1 0 8 0 sigapl 424 923 0 856 9 0 9 9 0 8 0 futexpl 64 4425 0 4421 3 2 1 1 0 8 0 knotepl 120 319 0 0 10 0 10 10 0 8 0 kqueuepl 216 158 0 149 5 4 1 5 0 8 0 pipepl 320 181 0 153 3 0 3 3 0 8 0 fdescpl 496 884 0 856 6 1 5 5 0 8 0 filepl 152 4024 0 3772 19 8 11 14 0 8 1 lockfpl 104 148 0 146 2 1 1 2 0 8 0 lockfspl 48 67 0 65 1 0 1 1 0 8 0 sessionpl 144 38 0 29 1 0 1 1 0 8 0 pgrppl 48 64 0 47 1 0 1 1 0 8 0 ucredpl 104 461 0 448 1 0 1 1 0 8 0 zombiepl 144 860 0 856 1 0 1 1 0 8 0 processpl 1160 923 0 856 6 0 6 6 0 8 0 procpl 648 1397 0 1322 10 2 8 9 0 8 0 sockpl 664 833 0 799 11 7 4 8 0 8 1 mcl64k 65536 1 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 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 261 0 0 33 0 33 33 0 8 0 mtagpl 96 4 0 0 1 0 1 1 0 8 0 mbufpl 256 283 0 0 17 0 17 17 0 8 0 bufpl 280 6078 0 100 427 0 427 427 0 8 0 anonpl 24 184668 0 181326 78 24 54 54 0 185 28 amapchunkpl 152 20923 0 20458 43 10 33 33 0 158 12 amappl16 200 4132 0 4120 26 23 3 15 0 8 2 amappl15 192 4 0 4 1 1 0 1 0 8 0 amappl14 184 171 0 159 1 0 1 1 0 8 0 amappl13 176 9 0 9 1 1 0 1 0 8 0 amappl12 168 1780 0 1752 4 2 2 3 0 8 0 amappl11 160 50 0 36 1 0 1 1 0 8 0 amappl10 152 5 0 5 1 1 0 1 0 8 0 amappl9 144 136 0 135 1 0 1 1 0 8 0 amappl8 136 24 0 22 1 0 1 1 0 8 0 amappl7 128 147 0 135 1 0 1 1 0 8 0 amappl6 120 334 0 332 1 0 1 1 0 8 0 amappl5 112 257 0 245 1 0 1 1 0 8 0 amappl4 104 361 0 340 1 0 1 1 0 8 0 amappl3 96 4078 0 3969 4 0 4 4 0 8 0 amappl2 88 843 0 779 2 0 2 2 0 8 0 amappl1 80 10202 0 9625 14 1 13 14 0 8 0 amappl 88 6065 0 5903 5 0 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 10 0 3 1 0 1 1 0 8 0 uaddrrnd 24 884 0 856 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 884 0 856 1 0 1 1 0 8 0 vmmpekpl 168 9270 0 9220 3 0 3 3 0 8 0 vmmpepl 168 62283 0 60540 104 18 86 96 0 357 1 vmsppl 440 883 0 856 6 2 4 5 0 8 0 rwobjpl 56 23744 0 20199 54 3 51 51 0 8 0 pdppl 4096 1775 0 1712 119 42 77 83 0 8 14 pvpl 32 29170 0 0 236 1 235 235 0 265 0 pmappl 248 883 0 856 3 0 3 3 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 429 0 60 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(fffffd806bef9ee8,41ed,fffffd807f7d3478,ffff8000371e1b48) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff8000371e1bb0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd8071256cf8,ffff8000371e1d10,ffff8000371e1d40,ffff8000371e1c40) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff80002a143488,ffffff9c,73d615961460,1ff) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3100 syscall(ffff8000371e1ec0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff8000371e1ec0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x73d6159614f0, count: -8 ddb{0}> machine ddbcpu 1