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
*354215  83641      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(ffffffff821e0400,ffffffff821f3c47,149,ffffffff821bd0e0) at __assert+0x2e sys/kern/subr_prf.c:154
buf_free_pages(fffffd802735ea00) at buf_free_pages+0x1ee sys/kern/vfs_biomem.c:318
buf_dealloc_mem(fffffd802735ea00) at buf_dealloc_mem+0xe1 sys/kern/vfs_biomem.c:194
buf_put(fffffd802735ea00) at buf_put+0x172 sys/kern/vfs_bio.c:131
brelse(fffffd802735ea00) at brelse+0x257 sys/kern/vfs_bio.c:922
vinvalbuf(fffffd802f545348,2,fffffd803f7c6ba0,ffff8000ffff49f0,0,ffffffffffffffff) at vinvalbuf+0x3de sys/kern/vfs_subr.c:1974
ffs_truncate(fffffd8036a55008,0,4,fffffd803f7c6ba0) at ffs_truncate+0xeb5 sys/ufs/ffs/ffs_inode.c:326
ufs_rmdir(ffff8000148e5e88) at ufs_rmdir+0x3af sys/ufs/ufs/ufs_vnops.c:1357
VOP_RMDIR(fffffd802f5451b8,fffffd802f545348,ffff8000148e5f88) at VOP_RMDIR+0xf8 sys/kern/vfs_vops.c:473
dounlinkat(ffff8000ffff49f0,b,c0024ef920,8) at dounlinkat+0x14c sys/kern/vfs_syscalls.c:1818
syscall(ffff8000148e6100) at syscall+0x508
Xsyscall(6,145,c00002a000,145,100,c9) at Xsyscall+0x128
end of kernel
end trace frame: 0xc001e6f808, 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(ffffffff821e0400,ffffffff821f3c47,149,ffffffff821bd0e0) at __assert+0x2e sys/kern/subr_prf.c:154
buf_free_pages(fffffd802735ea00) at buf_free_pages+0x1ee sys/kern/vfs_biomem.c:318
buf_dealloc_mem(fffffd802735ea00) at buf_dealloc_mem+0xe1 sys/kern/vfs_biomem.c:194
buf_put(fffffd802735ea00) at buf_put+0x172 sys/kern/vfs_bio.c:131
brelse(fffffd802735ea00) at brelse+0x257 sys/kern/vfs_bio.c:922
vinvalbuf(fffffd802f545348,2,fffffd803f7c6ba0,ffff8000ffff49f0,0,ffffffffffffffff) at vinvalbuf+0x3de sys/kern/vfs_subr.c:1974
ffs_truncate(fffffd8036a55008,0,4,fffffd803f7c6ba0) at ffs_truncate+0xeb5 sys/ufs/ffs/ffs_inode.c:326
ufs_rmdir(ffff8000148e5e88) at ufs_rmdir+0x3af sys/ufs/ufs/ufs_vnops.c:1357
VOP_RMDIR(fffffd802f5451b8,fffffd802f545348,ffff8000148e5f88) at VOP_RMDIR+0xf8 sys/kern/vfs_vops.c:473
dounlinkat(ffff8000ffff49f0,b,c0024ef920,8) at dounlinkat+0x14c sys/kern/vfs_syscalls.c:1818
syscall(ffff8000148e6100) at syscall+0x508
Xsyscall(6,145,c00002a000,145,100,c9) at Xsyscall+0x128
end of kernel
end trace frame: 0xc001e6f808, count: -14
ddb> show registers
rdi                                0
rsi                              0x1
rbp               0xffff8000148e5960
rbx               0xffff8000148e5a10
rdx                              0x2
rcx                                0
rax                                0
r8                0xffff8000148e5920
r9                               0x1
r10                                0
r11               0xcdf905501e60aa1c
r12                     0x3000000008
r13               0xffff8000148e5970
r14                            0x100
r15                              0x1
rip               0xffffffff8200cf28    db_enter+0x18
cs                               0x8
rflags                         0x246
rsp               0xffff8000148e5950
ss                              0x10
db_enter+0x18:  addq    $0x8,%rsp
ddb> show proc
PROC (syz-fuzzer) pid=354215 stat=onproc
    flags process=2<EXEC> proc=4000000<THREAD>
    pri=17, usrpri=50, nice=20
    forw=0xffffffffffffffff, list=0xffff8000ffff4288,0xffff8000ffff53e0
    process=0xffff8000148a2378 user=0xffff8000148e1000, vmspace=0xfffffd803f013cc0
    estcpu=0, cpticks=1, pctcpu=0.0
    user=0, sys=1, intr=0
ddb> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
 79096  486121      1      0  3    0x100083  ttyin         getty
 76071  107575      0      0  3     0x14200  bored         sosplice
 83641  489000  52105      0  3        0x82  thrsleep      syz-fuzzer
 83641  269402  52105      0  3   0x4000082  nanosleep     syz-fuzzer
*83641  354215  52105      0  7   0x4000002                syz-fuzzer
 83641  444538  52105      0  3   0x4000082  thrsleep      syz-fuzzer
 83641  207401  52105      0  3   0x4000082  thrsleep      syz-fuzzer
 83641  499183  52105      0  3   0x4000002  biowait       syz-fuzzer
 83641  350444  52105      0  3   0x4000082  thrsleep      syz-fuzzer
 83641  408818  52105      0  3   0x4000082  thrsleep      syz-fuzzer
 52105  507214  58568      0  3    0x10008a  pause         ksh
 58568   36134  50294      0  3        0x92  select        sshd
 50294  261081      1      0  3        0x80  select        sshd
 80835   70818  83081     73  3    0x100010  biowait       syslogd
 83081  398158      1      0  3    0x100082  netio         syslogd
 73714  348210      1     77  3    0x100090  poll          dhclient
 99543   71155      1      0  3        0x80  poll          dhclient
 28255  220792      0      0  3     0x14200  pgzero        zerothread
 95208  368665      0      0  3     0x14200  aiodoned      aiodoned
 60675  168605      0      0  3     0x14200  syncer        update
  6829  462726      0      0  3     0x14200  cleaner       cleaner
 50986  407630      0      0  3     0x14200  reaper        reaper
 47767  159733      0      0  3     0x14200  pgdaemon      pagedaemon
 53094  188838      0      0  3     0x14200  bored         crynlk
 11149  502758      0      0  3     0x14200  bored         crypto
 34530  389375      0      0  3  0x40014200  acpi0         acpi0
 61197  281898      0      0  3     0x14200  bored         softnet
 92490  508138      0      0  3     0x14200  bored         systqmp
   508  335613      0      0  3     0x14200  bored         systq
 70282  268799      0      0  3  0x40014200  bored         softclock
 79663  272502      0      0  3  0x40014200                idle0
 45956  138204      0      0  3     0x14200  bored         smr
     1  477975      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  9551   6376K   15321K  78643K     38502        0        0
            pcb    13      8K       8K  78643K       931        0        0
         rtable    74      3K       5K  78643K      3275        0        0
         ifaddr    59     19K      26K  78643K      1079        0        0
       counters    19     16K      16K  78643K        19        0        0
       ioctlops     0      0K       2K  78643K       596        0        0
            iov     0      0K      32K  78643K      1162        0        0
          mount     1      1K       1K  78643K         1        0        0
         vnodes  1208     76K      77K  78643K     11384        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       124        0        0
         VM map     2      0K       0K  78643K         2        0        0
            sem    12      0K       1K  78643K      1125        0        0
        dirhash    12      2K       2K  78643K        12        0        0
           ACPI  1793    195K     288K  78643K     12645        0        0
      file desc     2      1K      25K  78643K     10856        0        0
          sigio     0      0K       0K  78643K       152        0        0
           proc    42     30K      54K  78643K      2836        0        0
        subproc     0      0K       2K  78643K       588        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      1077        0        0
       in_multi    11      0K       2K  78643K       720        0        0
    ether_multi     1      0K       0K  78643K        44        0        0
            mrt     0      0K       0K  78643K        19        0        0
    ISOFS mount     1     32K      32K  78643K         1        0        0
  MSDOSFS mount     1     16K      16K  78643K         1        0        0
           ttys   114    503K     503K  78643K       114        0        0
           exec     0      0K       1K  78643K      1614        0        0
     pfkey data     0      0K       0K  78643K         4        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    86      4K      32K  78643K     26447        0        0
       UVM aobj   130      4K       4K  78643K       155        0        0
        memdesc     1      4K       4K  78643K         1        0        0
    crypto data     1      1K       1K  78643K         1        0        0
    ip6_options     0      0K       1K  78643K       756        0        0
            NDP    15      0K       1K  78643K       336        0        0
           temp   157   3533K    4176K  78643K    179530        0        0
         kqueue     0      0K       0K  78643K        80        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       74    0       72     1     0     1     1     0     8    0
rtpcb       80      514    0      512     1     0     1     1     0     8    0
rtentry    112      413    0      390     3     1     2     2     0     8    0
unpcb      120     3920    0     3912     1     0     1     1     0     8    0
syncache   264        4    0        4     1     1     0     1     0     8    0
tcpqe       32     1001    0     1001     1     1     0     1     0     8    0
tcpcb      544     1794    0     1790     1     0     1     1     0     8    0
ipq         40       29    0       28    12    11     1     1     0     8    0
ipqe        40       66    0       65    12    11     1     1     0     8    0
inpcb      280     5287    0     5280     9     8     1     2     0     8    0
nd6         48      102    0      102     1     0     1     1     0     8    1
pkpcb       40       36    0       36    13    13     0     1     0     8    0
swfcl       56        2    0        0     1     0     1     1     0     8    0
ppxss      1128     161    0      161    39    39     0     1     0     8    0
art_heap8  4096       1    0        0     1     0     1     1     0     8    0
art_heap4  256     1677    0     1580    26    13    13    13     0     8    6
art_table   32     1678    0     1580     2     0     2     2     0     8    1
art_node    16      401    0      381     1     0     1     1     0     8    0
sysvmsgpl   40       58    0       34     1     0     1     1     0     8    0
semupl     112        4    0        4     1     1     0     1     0     8    0
semapl     112     1123    0     1113     1     0     1     1     0     8    0
shmpl      112      153    0       25     4     0     4     4     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino1pl    128    18253    0    16832    47     0    47    47     0     8    0
ffsino     240    18253    0    16832    85     0    85    85     0     8    0
nchpl      144    33504    0    31881    62     0    62    62     0     8    0
uvmvnodes   72     7779    0        0   142     0   142   142     0     8    0
vnodes     200     7779    0        0   410     0   410   410     0     8    0
namei      1024  111259    0   111259    11    10     1     1     0     8    1
scsiplug    64       25    0       25    18    18     0     1     0     8    0
scxspl     192   115304    0   115302    33    32     1     7     0     8    0
plimitpl   152      964    0      959     1     0     1     1     0     8    0
sigapl     432    10944    0    10934     2     0     2     2     0     8    0
futexpl     56   176358    0   176358    12    12     0     1     0     8    0
knotepl    112     2529    0     2502     2     1     1     2     0     8    0
kqueuepl   104     2500    0     2498     1     0     1     1     0     8    0
pipepl     112     6140    0     6129    14    13     1     2     0     8    0
fdescpl    424    10945    0    10934     2     0     2     2     0     8    0
filepl     120    66243    0    66185    12     8     4     5     0     8    0
lockfpl    104     3592    0     3592    13    12     1     1     0     8    1
lockfspl    48     1190    0     1190    13    12     1     1     0     8    1
sessionpl  112       62    0       54     1     0     1     1     0     8    0
pgrppl      48      166    0      158     1     0     1     1     0     8    0
ucredpl     96    13487    0    13478     1     0     1     1     0     8    0
zombiepl   144    10937    0    10937     1     0     1     1     0     8    1
processpl  864    10963    0    10937     4     0     4     4     0     8    0
procpl     632    24064    0    24031     5     1     4     5     0     8    0
sosppl     128      122    0      122    31    31     0     1     0     8    0
sockpl     384     9868    0     9851    19    17     2     4     0     8    0
mcl64k     65536   1517    0     1517   155   155     0    33     0     8    0
mcl16k     16384     44    0       44    34    34     0     1     0     8    0
mcl12k     12288    199    0      199    34    34     0     1     0     8    0
mcl9k      9216     143    0      143    41    41     0     1     0     8    0
mcl8k      8192     195    0      195    34    34     0     1     0     8    0
mcl4k      4096     576    0      576    20    20     0     1     0     8    0
mcl2k2     2112      60    0       60    29    29     0     1     0     8    0
mcl2k      2048   76606    0    76563    18    12     6    10     0     8    0
mtagpl      80      296    0      296     5     4     1     1     0     8    1
mbufpl     256   178722    0   178658    89    79    10    24     0     8    3
bufpl      256    34918    0    27136   487     0   487   487     0     8    0
anonpl      16   963737    0   951668   363   295    68    83     0    62    8
amapchunkpl 152   47312    0    47214   101    86    15    18     0   158    9
amappl16   192    55907    0    55221   357   320    37    55     0     8    1
amappl15   184     1301    0     1300     1     0     1     1     0     8    0
amappl14   176     1781    0     1775     1     0     1     1     0     8    0
amappl13   168     2474    0     2474     7     6     1     1     0     8    1
amappl12   160     2289    0     2287     1     0     1     1     0     8    0
amappl11   152     1293    0     1281     1     0     1     1     0     8    0
amappl10   144      617    0      616     1     0     1     1     0     8    0
amappl9    136     2178    0     2177     1     0     1     1     0     8    0
amappl8    128     1659    0     1625     3     1     2     2     0     8    0
amappl7    120      623    0      615     1     0     1     1     0     8    0
amappl6    112     1247    0     1236     1     0     1     1     0     8    0
amappl5    104     2727    0     2717     1     0     1     1     0     8    0
amappl4     96    10138    0    10115     1     0     1     1     0     8    0
amappl3     88     2914    0     2904     1     0     1     1     0     8    0
amappl2     80    86746    0    86691     3     1     2     3     0     8    0
amappl1     72   201441    0   201066    26    17     9    19     0     8    0
amappl      80    24826    0    24797     1     0     1     1     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
dma64       64      259    0      259     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      154    0       25     3     0     3     3     0     8    0
uaddrrnd    24    10945    0    10934     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24    10945    0    10934     1     0     1     1     0     8    0
vmmpekpl   168    66404    0    66383     2     0     2     2     0     8    0
vmmpepl    168  1267200    0  1265696   584   500    84   113     0   357    2
vmsppl     272    10944    0    10934     5     4     1     2     0     8    0
pdppl      4096   21896    0    21868     7     2     5     6     0     8    0
pvpl        32  2795199    0  2780280   985   729   256   275     0   265  120
pmappl     200    10944    0    10934     1     0     1     1     0     8    0
extentpl    40       41    0       26     1     0     1     1     0     8    0
phpool     112      978    0      365    21     2    19    19     0     8    0