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
*487380  69661      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(ffffffff821e4529,ffffffff821fa563,149,ffffffff821c34b8) at __assert+0x2b sys/kern/subr_prf.c:154
buf_free_pages(fffffd803c76f500) at buf_free_pages+0x1ee sys/kern/vfs_biomem.c:318
buf_dealloc_mem(fffffd803c76f500) at buf_dealloc_mem+0xe1 sys/kern/vfs_biomem.c:194
buf_put(fffffd803c76f500) at buf_put+0x16b sys/kern/vfs_bio.c:131
brelse(fffffd803c76f500) at brelse+0x257 sys/kern/vfs_bio.c:922
vinvalbuf(fffffd80361561b8,2,fffffd803f7c6960,ffff8000ffff4500,0,ffffffffffffffff) at vinvalbuf+0x3b1 sys/kern/vfs_subr.c:1977
ffs_truncate(fffffd803d1c21e0,0,4,fffffd803f7c6960) at ffs_truncate+0xeb1 sys/ufs/ffs/ffs_inode.c:326
ufs_rmdir(ffff8000148e6208) at ufs_rmdir+0x3af sys/ufs/ufs/ufs_vnops.c:1357
VOP_RMDIR(fffffd802b481018,fffffd80361561b8,ffff8000148e6308) at VOP_RMDIR+0xf8 sys/kern/vfs_vops.c:474
dounlinkat(ffff8000ffff4500,b,c00393e8c0,8) at dounlinkat+0x14c sys/kern/vfs_syscalls.c:1818
syscall(ffff8000148e6480) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555
Xsyscall(6,145,c00002a000,145,100,46) at Xsyscall+0x128
end of kernel
end trace frame: 0xc0032157e8, 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(ffffffff821e4529,ffffffff821fa563,149,ffffffff821c34b8) at __assert+0x2b sys/kern/subr_prf.c:154
buf_free_pages(fffffd803c76f500) at buf_free_pages+0x1ee sys/kern/vfs_biomem.c:318
buf_dealloc_mem(fffffd803c76f500) at buf_dealloc_mem+0xe1 sys/kern/vfs_biomem.c:194
buf_put(fffffd803c76f500) at buf_put+0x16b sys/kern/vfs_bio.c:131
brelse(fffffd803c76f500) at brelse+0x257 sys/kern/vfs_bio.c:922
vinvalbuf(fffffd80361561b8,2,fffffd803f7c6960,ffff8000ffff4500,0,ffffffffffffffff) at vinvalbuf+0x3b1 sys/kern/vfs_subr.c:1977
ffs_truncate(fffffd803d1c21e0,0,4,fffffd803f7c6960) at ffs_truncate+0xeb1 sys/ufs/ffs/ffs_inode.c:326
ufs_rmdir(ffff8000148e6208) at ufs_rmdir+0x3af sys/ufs/ufs/ufs_vnops.c:1357
VOP_RMDIR(fffffd802b481018,fffffd80361561b8,ffff8000148e6308) at VOP_RMDIR+0xf8 sys/kern/vfs_vops.c:474
dounlinkat(ffff8000ffff4500,b,c00393e8c0,8) at dounlinkat+0x14c sys/kern/vfs_syscalls.c:1818
syscall(ffff8000148e6480) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555
Xsyscall(6,145,c00002a000,145,100,46) at Xsyscall+0x128
end of kernel
end trace frame: 0xc0032157e8, count: -14
ddb> show registers
rdi                                0
rsi                              0x1
rbp               0xffff8000148e5ce0
rbx               0xffff8000148e5d90
rdx                              0x2
rcx                                0
rax                                0
r8                0xffff8000148e5ca0
r9                               0x1
r10                                0
r11               0x677c2bc415d22877
r12                     0x3000000008
r13               0xffff8000148e5cf0
r14                            0x100
r15                              0x1
rip               0xffffffff81f6e8c8    db_enter+0x18
cs                               0x8
rflags                         0x246
rsp               0xffff8000148e5cd0
ss                                 0
db_enter+0x18:  addq    $0x8,%rsp
ddb> show proc
PROC (syz-fuzzer) pid=487380 stat=onproc
    flags process=2<EXEC> proc=4000000<THREAD>
    pri=17, usrpri=81, nice=20
    forw=0xffffffffffffffff, list=0xffff8000ffff58c0,0xffff8000ffff4788
    process=0xffff8000148a2018 user=0xffff8000148e1000, vmspace=0xfffffd803f013990
    estcpu=31, cpticks=1, pctcpu=0.15
    user=0, sys=1, intr=0
ddb> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
   334  384396  79127      0  2           0                syz-executor.1
   334  127141  79127      0  3   0x4000000  biowait       syz-executor.1
 79127  378567  69661      0  3        0x82  nanosleep     syz-executor.1
 67722  125491      0      0  3     0x14200  acct          acct
 44974  437608      1      0  3    0x100083  ttyin         getty
 44261   76825      0      0  3     0x14200  bored         sosplice
 69661   16606  27787      0  3        0x82  thrsleep      syz-fuzzer
 69661  112921  27787      0  3   0x4000082  nanosleep     syz-fuzzer
*69661  487380  27787      0  7   0x4000002                syz-fuzzer
 69661  159953  27787      0  3   0x4000082  thrsleep      syz-fuzzer
 69661  146899  27787      0  3   0x4000082  thrsleep      syz-fuzzer
 69661  199505  27787      0  3   0x4000082  thrsleep      syz-fuzzer
 69661  359210  27787      0  3   0x4000082  thrsleep      syz-fuzzer
 69661  421938  27787      0  3   0x4000082  thrsleep      syz-fuzzer
 27787  461017   1950      0  3    0x10008a  pause         ksh
  1950   73647  44529      0  3        0x92  select        sshd
 44529  198008      1      0  3        0x80  select        sshd
 44445  290175  48273     73  3    0x100090  kqread        syslogd
 48273  340378      1      0  3    0x100082  netio         syslogd
 47682  493282      1     77  3    0x100090  poll          dhclient
 66593  484400      1      0  3        0x80  poll          dhclient
 91694  168296      0      0  2     0x14200                zerothread
 13406  247144      0      0  3     0x14200  aiodoned      aiodoned
  8707  296196      0      0  3     0x14200  syncer        update
 62001  323517      0      0  3     0x14200  cleaner       cleaner
 19861  311353      0      0  3     0x14200  reaper        reaper
 38829  180023      0      0  3     0x14200  pgdaemon      pagedaemon
 28544  173670      0      0  3     0x14200  bored         crynlk
 79358  158682      0      0  3     0x14200  bored         crypto
 25701  317109      0      0  3  0x40014200  acpi0         acpi0
 98951  469508      0      0  3     0x14200  bored         softnet
 29744  376129      0      0  3     0x14200  bored         systqmp
  1838  154382      0      0  3     0x14200  bored         systq
 46713  395224      0      0  3  0x40014200  bored         softclock
  7173  184136      0      0  3  0x40014200                idle0
 38028  114242      0      0  3     0x14200  bored         smr
     1  164201      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  9577   7014K    8245K  78643K     29720        0        0
            pcb    13     11K      12K  78643K      2034        0        0
         rtable   118     12K      13K  78643K      3058        0        0
         ifaddr    89     20K      21K  78643K       792        0        0
       counters    19     16K      16K  78643K        19        0        0
       ioctlops     0      0K       2K  78643K       378        0        0
            iov     0      0K      28K  78643K      1195        0        0
          mount     1      1K       1K  78643K         1        0        0
         vnodes  1211     76K      77K  78643K      7803        0        0
      UFS quota     1     32K      32K  78643K         1        0        0
      UFS mount     5     36K      36K  78643K         5        0        0
            shm     2      1K       9K  78643K        74        0        0
         VM map    45     11K      11K  78643K        80        0        0
            sem    12      0K       0K  78643K      3172        0        0
        dirhash    12      2K       2K  78643K        12        0        0
           ACPI  1793    195K     288K  78643K     12645        0        0
      file desc     4      9K      25K  78643K      4554        0        0
          sigio     0      0K       0K  78643K        76        0        0
           proc    49     38K      63K  78643K      1771        0        0
        subproc    16      1K       2K  78643K       493        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       384        0        0
       in_multi    28      1K       2K  78643K       500        0        0
    ether_multi     1      0K       0K  78643K        34        0        0
            mrt     0      0K       0K  78643K        22        0        0
    ISOFS mount     1     32K      32K  78643K         1        0        0
  MSDOSFS mount     1     16K      16K  78643K         1        0        0
           ttys    78    344K     344K  78643K        78        0        0
           exec     0      0K       1K  78643K      1038        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   161    295K     312K  78643K     12370        0        0
       UVM aobj   130      4K       4K  78643K       137        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       983        0        0
            NDP    21      0K       1K  78643K       262        0        0
           temp   219   3546K    4185K  78643K    204447        0        0
         kqueue     0      0K       0K  78643K        46        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      113    0      108     1     0     1     1     0     8    0
rtpcb       80      493    0      491     1     0     1     1     0     8    0
rtentry    112      553    0      512     2     0     2     2     0     8    0
unpcb      120     3430    0     3417     3     2     1     2     0     8    0
syncache   264       31    0       31    14    13     1     1     0     8    1
sackhl      24        3    0        3     1     1     0     1     0     8    0
tcpqe       32      221    0      221     8     8     0     1     0     8    0
tcpcb      544     3822    0     3818    46    44     2    14     0     8    1
ipq         40       48    0       48    12    12     0     1     0     8    0
ipqe        40     1017    0     1017    12    12     0     1     0     8    0
inpcb      280     8295    0     8288    40    38     2     9     0     8    1
rttmr       72        6    0        5     2     1     1     1     0     8    0
ip6q        72        6    0        6     4     4     0     1     0     8    0
ip6af       40       15    0       15     3     3     0     1     0     8    0
nd6         48       74    0       72     5     4     1     1     0     8    0
pkpcb       40       12    0       12     5     5     0     1     0     8    0
swfcl       56        6    0        0     1     0     1     1     0     8    0
ppxss      1128      88    0       88    19    18     1     1     0     8    1
art_heap8  4096      17    0       14     9     6     3     4     0     8    0
art_heap4  256     2252    0     2042    35    21    14    18     0     8    0
art_table   32     2269    0     2056     4     1     3     3     0     8    0
art_node    16      552    0      516     1     0     1     1     0     8    0
sysvmsgpl   40       44    0       25     1     0     1     1     0     8    0
semupl     112        1    0        1     1     1     0     1     0     8    0
semapl     112     3170    0     3160     1     0     1     1     0     8    0
shmpl      112      135    0        7     4     0     4     4     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino1pl    128     8319    0     6921    46     0    46    46     0     8    0
ffsino     240     8319    0     6921    83     0    83    83     0     8    0
nchpl      144    15219    0    14787    60    41    19    60     0     8    0
uvmvnodes   72     8085    0        0   147     0   147   147     0     8    0
vnodes     208     8085    0        0   426     0   426   426     0     8    0
namei      1024   60257    0    60256     3     2     1     1     0     8    0
vcpupl     1984      43    0        0     6     0     6     6     0     8    0
vmpool     520       78    0       35     3     0     3     3     0     8    0
scsiplug    64        4    0        4     4     3     1     1     0     8    1
scxspl     192    60913    0    60912    32    28     4     7     0     8    3
plimitpl   152      391    0      385     1     0     1     1     0     8    0
sigapl     432     4645    0     4633     2     0     2     2     0     8    0
futexpl     56   166800    0   166800     5     4     1     1     0     8    1
knotepl    112     1358    0     1336     5     4     1     3     0     8    0
kqueuepl   104     1547    0     1544     7     6     1     4     0     8    0
pipepl     112     4744    0     4729    16    15     1     2     0     8    0
fdescpl    424     4646    0     4633     2     0     2     2     0     8    0
filepl     120    45964    0    45886    36    31     5    11     0     8    2
lockfpl    104     1761    0     1760     1     0     1     1     0     8    0
lockfspl    48      592    0      591     1     0     1     1     0     8    0
sessionpl  112       45    0       36     1     0     1     1     0     8    0
pgrppl      48      189    0      180     1     0     1     1     0     8    0
ucredpl     96     5116    0     5109     1     0     1     1     0     8    0
zombiepl   144     4634    0     4634     1     0     1     1     0     8    1
processpl  864     4663    0     4634     4     0     4     4     0     8    0
procpl     632    10142    0    10105     5     1     4     5     0     8    0
sosppl     128       50    0       50    12    12     0     1     0     8    0
sockpl     384    12318    0    12294    55    50     5    14     0     8    2
mcl64k     65536   1769    0     1769   165   164     1    65     0     8    1
mcl16k     16384     77    0       77    16    15     1     1     0     8    1
mcl12k     12288    193    0      193    10     9     1     1     0     8    1
mcl9k      9216      92    0       92    15    14     1     1     0     8    1
mcl8k      8192     236    0      236    10     9     1     1     0     8    1
mcl4k      4096     520    0      520     8     7     1     1     0     8    1
mcl2k2     2112      56    0       56    17    17     0     1     0     8    0
mcl2k      2048   78570    0    78521    27    20     7    16     0     8    0
mtagpl      80      231    0      231     7     6     1     1     0     8    1
mbufpl     256   171889    0   171782   194   186     8    41     0     8    0
bufpl      256    27649    0    19554   507     0   507   507     0     8    0
anonpl      16   692002    0   675541   201   114    87   108     0    62    0
amapchunkpl 152   27912    0    27707   119   109    10    23     0   158    0
amappl16   192    32872    0    31724   272   212    60    75     0     8    0
amappl15   184      585    0      584     1     0     1     1     0     8    0
amappl14   176      729    0      725     1     0     1     1     0     8    0
amappl13   168      382    0      382     4     3     1     1     0     8    1
amappl12   160     1070    0     1066     1     0     1     1     0     8    0
amappl11   152      426    0      415     1     0     1     1     0     8    0
amappl10   144     1252    0     1250     4     3     1     1     0     8    0
amappl9    136     1283    0     1277     1     0     1     1     0     8    0
amappl8    128      813    0      772     2     0     2     2     0     8    0
amappl7    120     1359    0     1352     1     0     1     1     0     8    0
amappl6    112      371    0      359     1     0     1     1     0     8    0
amappl5    104     1448    0     1439     1     0     1     1     0     8    0
amappl4     96     4070    0     4042     1     0     1     1     0     8    0
amappl3     88     1901    0     1895     1     0     1     1     0     8    0
amappl2     80    35184    0    35109     3     1     2     3     0     8    0
amappl1     72    95087    0    94676    28    19     9    20     0     8    0
amappl      80    10903    0    10838     2     0     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      136    0        7     3     0     3     3     0     8    0
uaddrrnd    24     4724    0     4633     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24     4724    0     4633     1     0     1     1     0     8    0
vmmpekpl   168    35413    0    35374     2     0     2     2     0     8    0
vmmpepl    168   578732    0   576440   394   247   147   157     0   357   38
vmsppl     272     4645    0     4633     6     5     1     2     0     8    0
pdppl      4096    9454    0     9379    14     4    10    10     0     8    0
pvpl        32  1789992    0  1771235   567   307   260   328     0   265   68
pmappl     200     4723    0     4668     4     0     4     4     0     8    0
extentpl    40       41    0       26     1     0     1     1     0     8    0
phpool     112     1128    0      485    21     1    20    21     0     8    0