panic: ffs_valloc: dup alloc Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 412351 16627 0 0 0 1 syz-executor *418313 16627 0 0 0x4000000 0K syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff830e580a) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd80617c8cc8,40c1,fffffd807f7d33a8,ffff80002d57c248) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff80002d57c2b0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd8069a340d8,ffff80002d57c410,ffff80002d57c440,ffff80002d57c340) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff8000371c67c0,ffffff9c,20000040,c1) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3100 syscall(ffff80002d57c5c0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff80002d57c5c0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf874f497e00, 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(ffffffff830e580a) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd80617c8cc8,40c1,fffffd807f7d33a8,ffff80002d57c248) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff80002d57c2b0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd8069a340d8,ffff80002d57c410,ffff80002d57c440,ffff80002d57c340) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff8000371c67c0,ffffff9c,20000040,c1) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3100 syscall(ffff80002d57c5c0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff80002d57c5c0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf874f497e00, count: -8 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002d57bfd0 rbx 0xffffffff8345ad87 cpu_info_full_primary+0x2d87 rdx 0 rcx 0xffff8000371c67c0 rax 0xffffffff83459ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x88e0012655bab693 r11 0x7e28e760846cc8cd r12 0xffffffff8345ab88 cpu_info_full_primary+0x2b88 r13 0 r14 0 r15 0x1 rip 0xffffffff818221c5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002d57bfc0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=418313 pid=16627 tcnt=2 stat=onproc flags process=0 proc=4000000 runpri=50, usrpri=86, slppri=16, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000ffffc520,0xffffffff83546038 process=0xffff8000ffff6458 user=0xffff80002d577000, vmspace=0xfffffd806be48528 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 16627 412351 33972 0 7 0 syz-executor *16627 418313 33972 0 7 0x4000000 syz-executor 44983 453929 28069 0 2 0x2 syz-executor 63468 3122 0 0 3 0x14200 bored sosplice 56345 312558 39188 0 3 0x80 nanoslp syz-executor 56345 266878 39188 0 3 0x4000080 netcon syz-executor 56345 129122 39188 0 3 0x4000080 fsleep syz-executor 33972 432573 28069 0 3 0x82 nanoslp syz-executor 39188 192763 28069 0 3 0x82 nanoslp syz-executor 8359 246020 28069 0 3 0x82 nanoslp syz-executor 84867 140219 28069 0 2 0x2 syz-executor 28069 500152 484 0 3 0x82 wait syz-executor 484 368046 75021 0 3 0x10008a sigsusp ksh 75021 332349 23248 0 3 0x98 kqread sshd-session 23248 359557 89742 0 3 0x92 kqread sshd-session 46099 370359 1 0 3 0x100083 ttyin getty 89742 21867 1 0 3 0x88 kqread sshd 90297 513041 97459 74 3 0x1100092 bpf pflogd 97459 147256 1 0 3 0x80 sbwait pflogd 61252 1378 90186 73 3 0x1100090 kqread syslogd 90186 383775 1 0 3 0x100082 sbwait syslogd 90669 298855 1 0 3 0x100080 kqread resolvd 82528 358641 47194 77 3 0x100092 kqread dhcpleased 40229 178698 47194 77 3 0x100092 kqread dhcpleased 47194 182461 1 0 3 0x80 kqread dhcpleased 52738 517379 0 0 3 0x14200 bored smr 32089 429100 0 0 2 0x14200 zerothread 10653 30228 0 0 3 0x14200 aiodoned aiodoned 17962 380061 0 0 3 0x14200 syncer update 2611 404416 0 0 3 0x14200 cleaner cleaner 46324 424491 0 0 3 0x14200 reaper reaper 61378 162720 0 0 3 0x14200 pgdaemon pagedaemon 64482 268200 0 0 3 0x14200 bored viomb 68275 23273 0 0 3 0x40014200 acpi0 acpi0 21064 360913 0 0 3 0x40014200 idle1 19877 144852 0 0 3 0x14200 bored softnet3 29124 177786 0 0 3 0x14200 bored softnet2 71570 191240 0 0 3 0x14200 bored softnet1 45206 437170 0 0 2 0x14200 softnet0 86521 48698 0 0 3 0x14200 bored systqmp 83065 394623 0 0 3 0x14200 bored systq 99376 339600 0 0 3 0x14200 tmoslp softclockmp 29130 505006 0 0 3 0x40014200 tmoslp softclock 97809 209173 0 0 3 0x40014200 idle0 1 140076 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 16627 (syz-executor) thread 0xffff8000371c67c0 (418313) exclusive rrwlock inode r = 0 (0xfffffd80617c8a30) #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 (0xfffffd80617c8d60) #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 (0xffffffff835f9448) #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 Process 84867 (syz-executor) thread 0xffff80002a056a38 (140219) exclusive rrwlock inode r = 0 (0xfffffd80617c8810) #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 vget+0x2bd sys/kern/vfs_subr.c:676 #6 ufs_ihashget+0x171 sys/ufs/ufs/ufs_ihash.c:95 #7 ffs_vget+0x8c sys/ufs/ffs/ffs_vfsops.c:1201 #8 ufs_lookup+0x19f8 sys/ufs/ufs/ufs_lookup.c:478 #9 VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 #10 vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 #11 namei+0x7aa sys/kern/vfs_lookup.c:250 #12 dounlinkat+0xc1 sys/kern/vfs_syscalls.c:1852 #13 syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] #13 syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806c8690a8) #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 dounlinkat+0xc1 sys/kern/vfs_syscalls.c:1852 #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 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10186 10091K 10295K 166960K 11356 0 pcb 17 12K 12K 166960K 37 0 rtable 197 13K 15K 166960K 370 0 pf 35 17K 20K 166960K 53 0 ifaddr 38 6K 7K 166960K 48 0 ifgroup 55 2K 2K 166960K 61 0 sysctl 2 0K 0K 166960K 2 0 counters 64 36K 36K 166960K 68 0 ioctlops 0 0K 4K 166960K 1491 0 iov 0 0K 14K 166960K 11 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1361 86K 86K 166960K 1459 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 7 0K 0K 166960K 7 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1697 195K 286K 166960K 12548 0 file desc 13 45K 93K 166960K 230 0 sigio 0 0K 0K 166960K 3 0 proc 70 91K 152K 166960K 545 0 subproc 93 5K 6K 166960K 106 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 14 0 in_multi 78 5K 7K 166960K 107 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 379 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 203 64K 73K 166960K 3753 0 UVM aobj 5 2K 2K 166960K 5 0 pinsyscall 38 76K 105K 166960K 1329 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 5 0 NDP 12 0K 1K 166960K 30 0 temp 36 6810K 6882K 166960K 7628 0 kqueue 13 20K 28K 166960K 36 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 42 0 39 1 0 1 1 0 8 0 rtentry 112 113 0 23 4 0 4 4 0 8 1 unpcb 144 107 0 89 1 0 1 1 0 8 0 syncache 336 3 0 3 2 1 1 1 0 8 1 tcpcb 808 39 0 33 1 0 1 1 0 8 0 arp 120 18 0 4 1 0 1 1 0 8 0 inpcb 336 188 0 178 4 0 4 4 0 8 2 nd6 136 24 0 6 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 0 1 1 0 8 1 kcovpl 48 8 0 1 1 0 1 1 0 8 0 ppxss 1168 1 0 1 1 0 1 1 0 8 1 pffrag 232 1 0 0 1 0 1 1 0 482 0 pffrnode 88 1 0 0 1 0 1 1 0 8 0 pffrent 40 1 0 0 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 25 0 0 1 0 1 1 0 8 0 pfstkey 128 26 0 1 1 0 1 1 0 8 0 pfstate 376 26 0 1 3 0 3 3 0 8 0 pfrule 1344 24 0 19 2 0 2 2 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 458 0 88 29 0 29 29 0 8 5 art_table 32 460 0 88 4 0 4 4 0 8 0 art_node 16 112 0 31 1 0 1 1 0 8 0 sysvmsgpl 40 2 0 0 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 5 0 0 1 0 1 1 0 8 0 shmpl 112 2 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1736 0 232 95 0 95 95 0 8 0 ffsino 272 1736 0 232 101 0 101 101 0 8 0 nchpl 144 2063 0 382 63 0 63 63 0 8 0 uvmvnodes 80 1887 0 0 39 0 39 39 0 8 0 vnodes 216 1887 0 0 105 0 105 105 0 8 0 namei 1024 6621 0 6620 2 0 2 2 0 8 1 percpumem 16 48 0 2 1 0 1 1 0 8 0 kstatmem 264 28 0 4 2 0 2 2 0 8 0 scsiplug 72 1 0 1 1 0 1 1 0 8 1 scxspl 216 5894 0 5894 4 3 1 2 1 8 1 plimitpl 152 40 0 23 1 0 1 1 0 8 0 sigapl 424 536 0 490 7 0 7 7 0 8 1 futexpl 64 1517 0 1516 1 0 1 1 0 8 0 knotepl 120 304 0 0 10 0 10 10 0 8 0 kqueuepl 216 107 0 97 5 0 5 5 0 8 4 pipepl 320 123 0 96 3 0 3 3 0 8 0 fdescpl 496 517 0 490 5 0 5 5 0 8 0 filepl 152 2248 0 2016 13 0 13 13 0 8 1 lockfpl 104 38 0 35 1 0 1 1 0 8 0 lockfspl 48 19 0 16 1 0 1 1 0 8 0 sessionpl 144 22 0 13 1 0 1 1 0 8 0 pgrppl 48 35 0 18 1 0 1 1 0 8 0 ucredpl 104 223 0 210 1 0 1 1 0 8 0 zombiepl 144 494 0 490 1 0 1 1 0 8 0 processpl 1160 536 0 490 5 0 5 5 0 8 1 procpl 648 711 0 662 6 0 6 6 0 8 1 srpgc 96 2 0 2 1 0 1 1 0 8 1 sosppl 168 1 0 0 1 0 1 1 0 8 0 sockpl 664 339 0 308 6 0 6 6 0 8 2 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 245 0 0 31 0 31 31 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 249 0 0 16 0 16 16 0 8 0 bufpl 280 2403 0 97 165 0 165 165 0 8 0 anonpl 24 172007 0 168875 27 4 23 25 0 185 1 amapchunkpl 152 12396 0 12000 23 0 23 23 0 158 3 amappl16 200 4857 0 4839 5 2 3 5 0 8 1 amappl15 192 12 0 12 2 2 0 1 0 8 0 amappl14 184 119 0 106 1 0 1 1 0 8 0 amappl13 176 9 0 9 1 1 0 1 0 8 0 amappl12 168 1184 0 1157 4 1 3 3 0 8 0 amappl11 160 152 0 138 1 0 1 1 0 8 0 amappl10 152 13 0 13 2 2 0 1 0 8 0 amappl9 144 148 0 148 1 1 0 1 0 8 0 amappl8 136 25 0 23 1 0 1 1 0 8 0 amappl7 128 110 0 98 1 0 1 1 0 8 0 amappl6 120 171 0 170 1 0 1 1 0 8 0 amappl5 112 148 0 136 1 0 1 1 0 8 0 amappl4 104 326 0 307 1 0 1 1 0 8 0 amappl3 96 2453 0 2362 4 0 4 4 0 8 0 amappl2 88 638 0 577 2 0 2 2 0 8 0 amappl1 80 8113 0 7550 14 0 14 14 0 8 1 amappl 88 3370 0 3229 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 4 0 0 1 0 1 1 0 8 0 uaddrrnd 24 517 0 490 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 517 0 490 1 0 1 1 0 8 0 vmmpekpl 168 6442 0 6397 3 0 3 3 0 8 0 vmmpepl 168 41838 0 40185 85 0 85 85 0 357 3 vmsppl 440 516 0 490 6 1 5 5 0 8 1 rwobjpl 56 18706 0 15926 40 0 40 40 0 8 0 pdppl 4096 1041 0 980 105 34 71 87 0 8 10 pvpl 32 11000 0 0 89 0 89 89 0 265 0 pmappl 248 516 0 490 3 0 3 3 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 397 0 37 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(ffffffff830e580a) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd80617c8cc8,40c1,fffffd807f7d33a8,ffff80002d57c248) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff80002d57c2b0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd8069a340d8,ffff80002d57c410,ffff80002d57c440,ffff80002d57c340) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff8000371c67c0,ffffff9c,20000040,c1) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3100 syscall(ffff80002d57c5c0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff80002d57c5c0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf874f497e00, 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 end of kernel end trace frame: 0x7c6921f183b0, count: 12 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 end of kernel end trace frame: 0x7c6921f183b0, count: -3