panic: kernel diagnostic assertion "pg->wire_count == 1" failed: file "/syzkaller/managers/main/kernel/sys/kern/vfs_biomem.c", line 329 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *313792 99297 0 0x2 0x4000000 0 syz-fuzzer db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 __assert(ffffffff821e484e,ffffffff821fa367,149,ffffffff821c37ce) at __assert+0x2b sys/kern/subr_prf.c:154 buf_free_pages(fffffd8039239a00) at buf_free_pages+0x1ee sys/kern/vfs_biomem.c:318 buf_dealloc_mem(fffffd8039239a00) at buf_dealloc_mem+0xe1 sys/kern/vfs_biomem.c:194 buf_put(fffffd8039239a00) at buf_put+0x16b sys/kern/vfs_bio.c:131 brelse(fffffd8039239a00) at brelse+0x257 sys/kern/vfs_bio.c:922 vinvalbuf(fffffd803e706020,2,fffffd803f7c6a80,ffff8000ffff58c0,0,ffffffffffffffff) at vinvalbuf+0x3b1 sys/kern/vfs_subr.c:1977 ffs_truncate(fffffd80360e4878,0,4,fffffd803f7c6a80) at ffs_truncate+0xeb1 sys/ufs/ffs/ffs_inode.c:326 ufs_rmdir(ffff8000148feb18) at ufs_rmdir+0x3af sys/ufs/ufs/ufs_vnops.c:1357 VOP_RMDIR(fffffd803a435900,fffffd803e706020,ffff8000148fec18) at VOP_RMDIR+0xf8 sys/kern/vfs_vops.c:474 dounlinkat(ffff8000ffff58c0,9,c0035704c0,8) at dounlinkat+0x14c sys/kern/vfs_syscalls.c:1818 syscall(ffff8000148fed90) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,145,c00002a000,145,100,26) at Xsyscall+0x128 end of kernel end trace frame: 0xc000f07978, count: 1 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic kernel diagnostic assertion "pg->wire_count == 1" failed: file "/syzkaller/managers/main/kernel/sys/kern/vfs_biomem.c", line 329 ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 __assert(ffffffff821e484e,ffffffff821fa367,149,ffffffff821c37ce) at __assert+0x2b sys/kern/subr_prf.c:154 buf_free_pages(fffffd8039239a00) at buf_free_pages+0x1ee sys/kern/vfs_biomem.c:318 buf_dealloc_mem(fffffd8039239a00) at buf_dealloc_mem+0xe1 sys/kern/vfs_biomem.c:194 buf_put(fffffd8039239a00) at buf_put+0x16b sys/kern/vfs_bio.c:131 brelse(fffffd8039239a00) at brelse+0x257 sys/kern/vfs_bio.c:922 vinvalbuf(fffffd803e706020,2,fffffd803f7c6a80,ffff8000ffff58c0,0,ffffffffffffffff) at vinvalbuf+0x3b1 sys/kern/vfs_subr.c:1977 ffs_truncate(fffffd80360e4878,0,4,fffffd803f7c6a80) at ffs_truncate+0xeb1 sys/ufs/ffs/ffs_inode.c:326 ufs_rmdir(ffff8000148feb18) at ufs_rmdir+0x3af sys/ufs/ufs/ufs_vnops.c:1357 VOP_RMDIR(fffffd803a435900,fffffd803e706020,ffff8000148fec18) at VOP_RMDIR+0xf8 sys/kern/vfs_vops.c:474 dounlinkat(ffff8000ffff58c0,9,c0035704c0,8) at dounlinkat+0x14c sys/kern/vfs_syscalls.c:1818 syscall(ffff8000148fed90) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,145,c00002a000,145,100,26) at Xsyscall+0x128 end of kernel end trace frame: 0xc000f07978, count: -14 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000148fe5f0 rbx 0xffff8000148fe6a0 rdx 0x2 rcx 0 rax 0 r8 0xffff8000148fe5b0 r9 0x1 r10 0 r11 0x65e2b26339086703 r12 0x3000000008 r13 0xffff8000148fe600 r14 0x100 r15 0x1 rip 0xffffffff817d7238 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000148fe5e0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-fuzzer) pid=313792 stat=onproc flags process=2 proc=4000000 pri=17, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff4ee0,0xffff8000ffff5b48 process=0xffff8000148a2a38 user=0xffff8000148f9000, vmspace=0xfffffd803f013660 estcpu=0, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 83893 158710 0 0 3 0x14200 acct acct 81051 149239 1 0 3 0x100083 ttyin getty 6155 462365 0 0 3 0x14200 bored sosplice 99297 390358 56110 0 3 0x82 thrsleep syz-fuzzer 99297 353384 56110 0 3 0x4000082 nanosleep syz-fuzzer 99297 520883 56110 0 3 0x4000082 thrsleep syz-fuzzer *99297 313792 56110 0 7 0x4000002 syz-fuzzer 99297 289716 56110 0 3 0x4000002 inode syz-fuzzer 99297 87831 56110 0 3 0x4000082 thrsleep syz-fuzzer 99297 285748 56110 0 3 0x4000082 thrsleep syz-fuzzer 99297 190122 56110 0 3 0x4000082 thrsleep syz-fuzzer 56110 202571 80434 0 3 0x10008a pause ksh 80434 308757 13677 0 3 0x92 select sshd 13677 384108 1 0 3 0x80 select sshd 49568 492799 95133 73 3 0x100010 biowait syslogd 95133 468140 1 0 3 0x100082 netio syslogd 99670 247288 0 0 3 0x14200 pgzero zerothread 50993 410687 0 0 3 0x14200 aiodoned aiodoned 56038 52406 0 0 3 0x14200 syncer update 99141 456455 0 0 3 0x14200 cleaner cleaner 64669 405843 0 0 3 0x14200 reaper reaper 9328 521253 0 0 3 0x14200 pgdaemon pagedaemon 60360 376599 0 0 3 0x14200 bored crynlk 31506 84191 0 0 3 0x14200 bored crypto 11741 331872 0 0 3 0x40014200 acpi0 acpi0 34409 497286 0 0 3 0x14200 bored softnet 30521 422455 0 0 3 0x14200 bored systqmp 17600 145765 0 0 3 0x14200 bored systq 50153 359882 0 0 3 0x40014200 bored softclock 53265 240899 0 0 3 0x40014200 idle0 55618 485155 0 0 3 0x14200 bored smr 1 63704 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9558 6956K 7846K 78643K 20132 0 0 pcb 13 11K 12K 78643K 921 0 0 rtable 79 7K 8K 78643K 1532 0 0 ifaddr 72 17K 20K 78643K 731 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 304 0 0 iov 0 0K 32K 78643K 1072 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1218 76K 78K 78643K 5045 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 5K 78643K 53 0 0 VM map 44 11K 11K 78643K 69 0 0 sem 11 1K 1K 78643K 11 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12645 0 0 file desc 2 1K 25K 78643K 4266 0 0 sigio 0 0K 0K 78643K 120 0 0 proc 45 30K 63K 78643K 1823 0 0 subproc 0 0K 2K 78643K 537 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 0K 78643K 429 0 0 in_multi 11 0K 2K 78643K 577 0 0 ether_multi 1 0K 0K 78643K 55 0 0 mrt 0 0K 0K 78643K 37 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 90 397K 397K 78643K 90 0 0 exec 0 0K 1K 78643K 1007 0 0 pagedep 1 8K 8K 78643K 1 0 0 inodedep 1 32K 32K 78643K 1 0 0 newblk 1 0K 0K 78643K 1 0 0 VM swap 7 26K 26K 78643K 7 0 0 UVM amap 151 348K 367K 78643K 12408 0 0 UVM aobj 130 8K 8K 78643K 141 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 0K 78643K 950 0 0 NDP 18 0K 1K 78643K 242 0 0 temp 178 3538K 4180K 78643K 114187 0 0 kqueue 0 0K 0K 78643K 25 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 111 0 109 1 0 1 1 0 8 0 rtpcb 80 450 0 450 8 8 0 1 0 8 0 rtentry 112 512 0 487 2 0 2 2 0 8 0 unpcb 120 2323 0 2313 6 5 1 2 0 8 0 syncache 264 34 0 34 15 15 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 55 0 55 7 7 0 1 0 8 0 tcpcb 544 2118 0 2114 36 35 1 15 0 8 0 ipq 40 54 0 54 19 19 0 1 0 8 0 ipqe 40 1070 0 1070 19 19 0 1 0 8 0 inpcb 280 5801 0 5797 33 32 1 9 0 8 0 rttmr 72 12 0 11 6 5 1 1 0 8 0 ip6q 72 3 0 3 2 2 0 1 0 8 0 ip6af 40 9 0 9 2 2 0 1 0 8 0 nd6 48 71 0 71 6 5 1 1 0 8 1 pkpcb 40 22 0 22 10 10 0 1 0 8 0 ppxss 1128 83 0 83 16 16 0 1 0 8 0 art_heap8 4096 6 0 5 4 3 1 3 0 8 0 art_heap4 256 2112 0 1965 36 20 16 16 0 8 3 art_table 32 2118 0 1970 2 0 2 2 0 8 0 art_node 16 510 0 487 1 0 1 1 0 8 0 sysvmsgpl 40 72 0 61 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 9 0 0 1 0 1 1 0 8 0 shmpl 112 139 0 11 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 7829 0 6426 46 0 46 46 0 8 0 ffsino 240 7829 0 6426 84 0 84 84 0 8 0 nchpl 144 13967 0 13515 61 41 20 61 0 8 0 uvmvnodes 72 7825 0 0 143 0 143 143 0 8 0 vnodes 208 7825 0 0 412 0 412 412 0 8 0 namei 1024 54361 0 54360 6 5 1 1 0 8 0 vcpupl 1984 42 0 0 6 0 6 6 0 8 0 vmpool 520 67 0 25 3 0 3 3 0 8 0 scsiplug 64 6 0 6 3 3 0 1 0 8 0 scxspl 192 57764 0 57763 47 46 1 7 0 8 0 plimitpl 152 401 0 397 1 0 1 1 0 8 0 sigapl 432 4353 0 4345 2 0 2 2 0 8 0 futexpl 56 128777 0 128777 6 6 0 1 0 8 0 knotepl 112 1241 0 1222 1 0 1 1 0 8 0 kqueuepl 104 1337 0 1335 7 6 1 4 0 8 0 pipepl 112 2742 0 2731 9 8 1 2 0 8 0 fdescpl 424 4354 0 4345 2 0 2 2 0 8 0 filepl 120 38498 0 38454 29 26 3 10 0 8 0 lockfpl 104 3350 0 3350 6 6 0 1 0 8 0 lockfspl 48 1022 0 1022 6 6 0 1 0 8 0 sessionpl 112 49 0 43 1 0 1 1 0 8 0 pgrppl 48 81 0 75 1 0 1 1 0 8 0 ucredpl 96 4495 0 4489 1 0 1 1 0 8 0 zombiepl 144 4348 0 4348 1 0 1 1 0 8 1 processpl 864 4373 0 4348 4 0 4 4 0 8 0 procpl 632 10159 0 10127 6 2 4 5 0 8 0 sosppl 128 64 0 64 18 18 0 1 0 8 0 sockpl 384 8689 0 8675 51 48 3 13 0 8 0 mcl64k 65536 573 0 573 39 39 0 29 0 8 0 mcl16k 16384 75 0 75 24 24 0 1 0 8 0 mcl12k 12288 139 0 139 14 14 0 1 0 8 0 mcl9k 9216 74 0 74 15 15 0 1 0 8 0 mcl8k 8192 262 0 262 6 6 0 1 0 8 0 mcl4k 4096 581 0 581 7 7 0 1 0 8 0 mcl2k2 2112 39 0 39 17 17 0 1 0 8 0 mcl2k 2048 72687 0 72646 20 14 6 13 0 8 0 mtagpl 80 172 0 172 8 7 1 1 0 8 1 mbufpl 256 148885 0 148823 173 165 8 32 0 8 0 bufpl 256 26457 0 18636 490 1 489 490 0 8 0 anonpl 16 568639 0 549138 212 114 98 98 0 62 14 amapchunkpl 152 28108 0 27965 105 88 17 20 0 158 10 amappl16 192 24749 0 23634 211 154 57 68 0 8 0 amappl15 184 359 0 359 4 4 0 1 0 8 0 amappl14 176 1821 0 1818 1 0 1 1 0 8 0 amappl13 168 357 0 356 1 0 1 1 0 8 0 amappl12 160 595 0 594 2 1 1 1 0 8 0 amappl11 152 445 0 441 1 0 1 1 0 8 0 amappl10 144 307 0 307 3 3 0 1 0 8 0 amappl9 136 1429 0 1425 1 0 1 1 0 8 0 amappl8 128 943 0 904 2 0 2 2 0 8 0 amappl7 120 432 0 425 1 0 1 1 0 8 0 amappl6 112 400 0 385 1 0 1 1 0 8 0 amappl5 104 988 0 980 1 0 1 1 0 8 0 amappl4 96 3976 0 3949 1 0 1 1 0 8 0 amappl3 88 2137 0 2132 1 0 1 1 0 8 0 amappl2 80 32602 0 32536 3 1 2 3 0 8 0 amappl1 72 93024 0 92678 27 18 9 20 0 8 0 amappl 80 10915 0 10864 4 2 2 2 0 84 0 dma4096 4096 1 0 1 1 1 0 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 17 0 17 1 1 0 1 0 8 0 aobjpl 64 140 0 11 3 0 3 3 0 8 0 uaddrrnd 24 4421 0 4345 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 4421 0 4345 1 0 1 1 0 8 0 vmmpekpl 168 32118 0 32085 2 0 2 2 0 8 0 vmmpepl 168 541238 0 539197 422 302 120 149 0 357 16 vmsppl 272 4353 0 4345 2 1 1 2 0 8 0 pdppl 4096 8848 0 8782 14 4 10 10 0 8 0 pvpl 32 1596037 0 1575583 584 283 301 315 0 265 117 pmappl 200 4420 0 4370 4 1 3 3 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 946 0 326 20 1 19 19 0 8 0