panic: ffs_valloc: dup alloc Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 94754 45154 0 0 0 1 syz-executor *426561 50689 0 0x2 0 0K syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff830e5590) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd8079186660,41c0,fffffd807f7d3000,ffff800032d88538) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff800032d885a0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806eacbcd8,ffff800032d88700,ffff800032d88730,ffff800032d88630) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff8000ffff6f50,ffffff9c,7d998155d710,1c0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3099 syscall(ffff800032d888b0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff800032d888b0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7d998155d6d0, 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(ffffffff830e5590) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd8079186660,41c0,fffffd807f7d3000,ffff800032d88538) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff800032d885a0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806eacbcd8,ffff800032d88700,ffff800032d88730,ffff800032d88630) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff8000ffff6f50,ffffff9c,7d998155d710,1c0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3099 syscall(ffff800032d888b0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff800032d888b0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7d998155d6d0, count: -8 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff800032d882c0 rbx 0xffffffff83473d87 cpu_info_full_primary+0x2d87 rdx 0 rcx 0xffff8000ffff6f50 rax 0xffffffff83472ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x6c9b8460a3425983 r11 0x73d8a769a54814a8 r12 0xffffffff83473b88 cpu_info_full_primary+0x2b88 r13 0 r14 0 r15 0x1 rip 0xffffffff826b1a55 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff800032d882b0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=426561 pid=50689 tcnt=1 stat=onproc flags process=2 proc=0 runpri=50, usrpri=50, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000ffff5c00,0xffff8000ffff6a50 process=0xffff8000ffff1fd0 user=0xffff800032d83000, vmspace=0xfffffd80695f7898 estcpu=36, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 45154 94754 50212 0 7 0 syz-executor 45154 366574 50212 0 2 0x4000000 syz-executor 34511 459399 16219 0 2 0 syz-executor *50689 426561 46357 0 7 0x2 syz-executor 63912 48172 69973 0 3 0x80 nanoslp syz-executor 63912 455704 69973 0 3 0x4000080 tunread syz-executor 34825 194445 20168 0 2 0x480 syz-executor 34825 200992 20168 0 3 0x4000080 kqsel syz-executor 34825 212347 20168 0 3 0x4000080 fsleep syz-executor 52434 76972 1 0 3 0x100083 ttyopn getty 60997 516957 0 0 3 0x14200 bored sosplice 15162 243892 46357 0 3 0x82 wait syz-executor 69973 343221 46357 0 2 0x482 syz-executor 50212 17541 46357 0 3 0x82 nanoslp syz-executor 16219 162606 46357 0 3 0x82 nanoslp syz-executor 20168 375795 46357 0 2 0x482 syz-executor 46357 349268 86077 0 2 0x2 syz-executor 86077 455883 31430 0 3 0x10008a sigsusp ksh 31430 152025 95418 0 3 0x98 kqread sshd-session 95418 396835 1218 0 3 0x92 kqread sshd-session 1218 513101 1 0 3 0x88 kqread sshd 14011 259804 82199 74 3 0x1100092 bpf pflogd 82199 519033 1 0 3 0x80 sbwait pflogd 31462 49138 25964 73 3 0x1100090 kqread syslogd 25964 295777 1 0 3 0x100082 sbwait syslogd 4188 119687 1 0 3 0x100080 kqread resolvd 32250 299919 92362 77 3 0x100092 kqread dhcpleased 31760 494900 92362 77 3 0x100092 kqread dhcpleased 92362 485892 1 0 3 0x80 kqread dhcpleased 72844 322602 0 0 3 0x14200 bored smr 31024 76871 0 0 3 0x14200 pgzero zerothread 83666 269849 0 0 3 0x14200 aiodoned aiodoned 52819 389366 0 0 3 0x14200 syncer update 354 309590 0 0 3 0x14200 cleaner cleaner 15165 145106 0 0 3 0x14200 reaper reaper 93233 199204 0 0 3 0x14200 pgdaemon pagedaemon 13587 217155 0 0 3 0x14200 bored viomb 91018 134550 0 0 3 0x40014200 acpi0 acpi0 50140 280176 0 0 3 0x40014200 idle1 8836 513789 0 0 3 0x14200 bored softnet3 15763 271504 0 0 3 0x14200 bored softnet2 35907 155743 0 0 3 0x14200 bored softnet1 17298 442875 0 0 2 0x14200 softnet0 74566 281275 0 0 3 0x14200 bored systqmp 49566 293991 0 0 3 0x14200 bored systq 43158 472174 0 0 3 0x14200 tmoslp softclockmp 86753 133039 0 0 3 0x40014200 tmoslp softclock 45174 197599 0 0 3 0x40014200 idle0 1 101693 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 45154 (syz-executor) thread 0xffff8000ffff6020 (94754) shared rwlock vmmaplk r = 0 (0xfffffd80695f7460) #0 witness_lock+0x5b8 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5b8 sys/kern/subr_witness.c:1151 #1 uvmfault_lookup+0x122 sys/uvm/uvm_fault.c:1785 #2 uvm_fault_check+0x47 sys/uvm/uvm_fault.c:672 #3 uvm_fault+0x112 sys/uvm/uvm_fault.c:600 #4 upageflttrap+0xa9 sys/arch/amd64/amd64/trap.c:188 #5 usertrap+0x2d8 sys/arch/amd64/amd64/trap.c:436 #6 recall_trap+0x8 Process 50689 (syz-executor) thread 0xffff8000ffff6f50 (426561) exclusive rrwlock inode r = 0 (0xfffffd80638d20a8) #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:169 #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 (0xfffffd80791866f8) #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 (0xffffffff835a3c08) #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 10194 14185K 14576K 166960K 11547 0 pcb 17 12K 12K 166960K 45 0 rtable 206 5K 6K 166960K 381 0 pf 35 17K 18K 166960K 48 0 ifaddr 39 6K 7K 166960K 48 0 ifgroup 56 2K 2K 166960K 60 0 counters 64 36K 36K 166960K 66 0 ioctlops 0 0K 4K 166960K 1491 0 iov 0 0K 12K 166960K 7 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1368 86K 86K 166960K 1477 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 3 5K 9K 166960K 6 0 VM map 2 1K 1K 166960K 2 0 sem 9 0K 0K 166960K 10 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1690 195K 286K 166960K 12418 0 file desc 15 50K 97K 166960K 268 0 sigio 0 0K 0K 166960K 4 0 proc 72 91K 140K 166960K 557 0 subproc 91 5K 6K 166960K 104 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 10 0 in_multi 84 6K 7K 166960K 109 0 ether_multi 1 0K 0K 166960K 2 0 mrt 0 0K 0K 166960K 1 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 61 281K 281K 166960K 61 0 exec 0 0K 1K 166960K 381 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 209 64K 77K 166960K 4087 0 UVM aobj 3 2K 2K 166960K 3 0 pinsyscall 40 80K 106K 166960K 1353 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 6 0 NDP 12 0K 2K 166960K 31 0 temp 34 6810K 6876K 166960K 6832 0 kqueue 13 20K 26K 166960K 48 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 44 0 41 1 0 1 1 0 8 0 rtentry 112 126 0 30 4 0 4 4 0 8 0 unpcb 144 125 0 108 1 0 1 1 0 8 0 syncache 336 6 0 6 1 0 1 1 0 8 1 tcpqe 32 1 0 1 1 0 1 1 0 8 1 tcpcb 808 58 0 53 2 0 2 2 0 8 0 arp 120 21 0 5 1 0 1 1 0 8 0 inpcb 336 194 0 186 2 0 2 2 0 8 0 nd6 136 27 0 8 1 0 1 1 0 8 0 kcovpl 48 8 0 1 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 35 0 0 1 0 1 1 0 8 0 pfstkey 128 35 0 0 2 0 2 2 0 8 0 pfstate 376 35 0 0 4 0 4 4 0 8 0 pfrule 1344 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 508 0 111 29 0 29 29 0 8 1 art_table 32 509 0 111 4 0 4 4 0 8 0 art_node 16 125 0 37 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 8 0 1 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1791 0 283 95 0 95 95 0 8 0 ffsino 272 1793 0 285 102 0 102 102 0 8 0 nchpl 144 2172 0 484 63 0 63 63 0 8 0 uvmvnodes 80 1955 0 0 40 0 40 40 0 8 0 vnodes 216 1955 0 0 109 0 109 109 0 8 0 namei 1024 6596 0 6595 2 0 2 2 0 8 1 percpumem 16 47 0 1 1 0 1 1 0 8 0 kstatmem 264 26 0 2 2 0 2 2 0 8 0 scxspl 216 6734 0 6734 9 1 8 8 1 8 8 plimitpl 152 42 0 25 1 0 1 1 0 8 0 sigapl 424 570 0 522 8 1 7 7 0 8 1 futexpl 64 2201 0 2200 1 0 1 1 0 8 0 knotepl 120 300 0 0 10 0 10 10 0 8 0 kqueuepl 216 60 0 50 1 0 1 1 0 8 0 pipepl 320 119 0 92 3 0 3 3 0 8 0 fdescpl 496 551 0 522 6 0 6 6 0 8 1 filepl 152 2214 0 1987 11 0 11 11 0 8 0 lockfpl 104 54 0 52 1 0 1 1 0 8 0 lockfspl 48 27 0 25 1 0 1 1 0 8 0 sessionpl 144 25 0 16 1 0 1 1 0 8 0 pgrppl 48 37 0 20 1 0 1 1 0 8 0 ucredpl 104 200 0 187 1 0 1 1 0 8 0 zombiepl 144 525 0 522 1 0 1 1 0 8 0 processpl 1160 570 0 522 5 0 5 5 0 8 1 procpl 648 827 0 775 7 1 6 6 0 8 0 sosppl 168 3 0 3 1 0 1 1 0 8 1 sockpl 664 365 0 337 4 0 4 4 0 8 1 mcl64k 65536 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 6 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 210 0 0 27 0 27 27 0 8 0 mtagpl 96 4 0 0 1 0 1 1 0 8 0 mbufpl 256 217 0 0 14 0 14 14 0 8 0 bufpl 280 3509 0 98 244 0 244 244 0 8 0 anonpl 24 165201 0 162019 46 0 46 46 0 185 21 amapchunkpl 152 13342 0 12927 25 0 25 25 0 158 5 amappl16 200 4384 0 4370 14 5 9 14 0 8 7 amappl15 192 81 0 81 1 1 0 1 0 8 0 amappl14 184 118 0 106 1 0 1 1 0 8 0 amappl13 176 10 0 10 1 1 0 1 0 8 0 amappl12 168 1200 0 1170 4 1 3 3 0 8 1 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 156 0 156 2 1 1 1 0 8 1 amappl8 136 28 0 26 1 0 1 1 0 8 0 amappl7 128 111 0 99 1 0 1 1 0 8 0 amappl6 120 189 0 188 1 0 1 1 0 8 0 amappl5 112 158 0 147 1 0 1 1 0 8 0 amappl4 104 310 0 292 1 0 1 1 0 8 0 amappl3 96 2569 0 2473 4 0 4 4 0 8 0 amappl2 88 679 0 613 2 0 2 2 0 8 0 amappl1 80 8417 0 7856 14 0 14 14 0 8 0 amappl 88 3689 0 3542 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 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 551 0 522 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 551 0 522 1 0 1 1 0 8 0 vmmpekpl 168 6095 0 6046 3 0 3 3 0 8 0 vmmpepl 168 43340 0 41635 93 0 93 93 0 357 7 vmsppl 440 550 0 522 6 1 5 5 0 8 1 rwobjpl 56 18642 0 15808 41 0 41 41 0 8 0 pdppl 4096 1109 0 1044 103 30 73 87 0 8 8 pvpl 32 13833 0 0 112 0 112 112 0 265 0 pmappl 248 550 0 522 3 0 3 3 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 387 0 32 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(ffffffff830e5590) at panic+0x1e5 sys/kern/subr_prf.c:198 ffs_inode_alloc(fffffd8079186660,41c0,fffffd807f7d3000,ffff800032d88538) at ffs_inode_alloc+0x96c sys/ufs/ffs/ffs_alloc.c:404 ufs_mkdir(ffff800032d885a0) at ufs_mkdir+0x113 sys/ufs/ufs/ufs_vnops.c:1112 VOP_MKDIR(fffffd806eacbcd8,ffff800032d88700,ffff800032d88730,ffff800032d88630) at VOP_MKDIR+0x102 sys/kern/vfs_vops.c:394 domkdirat(ffff8000ffff6f50,ffffff9c,7d998155d710,1c0) at domkdirat+0x179 sys/kern/vfs_syscalls.c:3099 syscall(ffff800032d888b0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff800032d888b0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7d998155d6d0, 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(ffffffff835a3a00) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff835a3a00) at __mp_lock+0x192 sys/kern/kern_lock.c:144 uvm_fault(fffffd80695f7370,7d0e2c8d000,0,2) at uvm_fault+0x1ed sys/uvm/uvm_fault.c:622 upageflttrap(ffff8000371d0180,7d0e2c8d000) at upageflttrap+0xa9 sys/arch/amd64/amd64/trap.c:188 usertrap(ffff8000371d0180) at usertrap+0x2d8 sys/arch/amd64/amd64/trap.c:436 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7df9ce474df0, count: 7 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(ffffffff835a3a00) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff835a3a00) at __mp_lock+0x192 sys/kern/kern_lock.c:144 uvm_fault(fffffd80695f7370,7d0e2c8d000,0,2) at uvm_fault+0x1ed sys/uvm/uvm_fault.c:622 upageflttrap(ffff8000371d0180,7d0e2c8d000) at upageflttrap+0xa9 sys/arch/amd64/amd64/trap.c:188 usertrap(ffff8000371d0180) at usertrap+0x2d8 sys/arch/amd64/amd64/trap.c:436 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7df9ce474df0, count: -8