syzbot


uvm_fault: pfsync_state_import

Status: fixed on 2021/12/22 16:40
Reported-by: syzbot+7de8d8aecb6de84a0bc9@syzkaller.appspotmail.com
Fix commit: d13e571b26fd Remove ptr_array from struct pf_ruleset
First crash: 902d, last: 832d

Sample crash report:
uvm_fault(0xfffffd806bc09220, 0x0, 0, 1) -> e
kernel: page fault trap, code=0
Stopped at      pfsync_state_import+0x108:      movq    0(%rax,%rbx,8),%r15
ddb> 
ddb> set $lines = 0
ddb> set $maxwidth = 0
ddb> show panic
kernel page fault
uvm_fault(0xfffffd806bc09220, 0x0, 0, 1) -> e
pfsync_state_import(ffff800000ac6400,1) at pfsync_state_import+0x108 sys/net/if_pfsync.c:529
end trace frame: 0xffff80001d735590, count: 0
ddb> trace
pfsync_state_import(ffff800000ac6400,1) at pfsync_state_import+0x108 sys/net/if_pfsync.c:529
pfioctl(4900,c1084425,ffff800000ac6400,3,ffff80001d702778) at pfioctl+0x2764 sys/net/pf_ioctl.c:1688
VOP_IOCTL(fffffd805e06c270,c1084425,ffff800000ac6400,3,fffffd806c3bfc00,ffff80001d702778) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290
vn_ioctl(fffffd805d7f9710,c1084425,ffff800000ac6400,ffff80001d702778) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531
sys_ioctl(ffff80001d702778,ffff80001d735878,ffff80001d7358c0) at sys_ioctl+0x4ac
syscall(ffff80001d735940) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7ffffc0dc0, count: -7
ddb> show registers
rdi                                0
rsi                              0x1
rbp               0xffff80001d735430
rbx                                0
rdx                             0x10
rcx                                0
rax                                0
r8                 0x101010101010101
r9                0x8080808080808080
r10               0x8045b81d9660cc30
r11               0xe287f92add5b6a42
r12               0xffff8000006b5f00
r13               0xffff800000ac6400
r14                              0x1
r15                              0x1
rip               0xffffffff82330928    pfsync_state_import+0x108
cs                               0x8
rflags                       0x10246    __ALIGN_SIZE+0xf246
rsp               0xffff80001d7353b0
ss                              0x10
pfsync_state_import+0x108:      movq    0(%rax,%rbx,8),%r15
ddb> show proc
PROC (syz-executor6259) pid=255530 stat=onproc
    flags process=2<EXEC,8ORPHAN> proc=0
    pri=53, usrpri=53, nice=20
    forw=0xffffffffffffffff, list=0xffff80001d702010,0xffffffff827ac148
    process=0xffff80001d704778 user=0xffff80001d730000, vmspace=0xfffffd806bc09220
    estcpu=3, cpticks=1, pctcpu=0.0
    user=0, sys=1, intr=0
ddb> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
*69313  255530    577      0  7         0x2                syz-executor6259
   577   23040  25054      0  3    0x10008a  pause         ksh
 25054  117155  69479      0  3        0x92  select        sshd
 22974   73219      1      0  3    0x100083  ttyin         getty
 69479  450583      1      0  3        0x80  select        sshd
 75573  432745  37897     73  3    0x100090  kqread        syslogd
 37897  312517      1      0  3    0x100082  netio         syslogd
 43284   12971      1     77  3    0x100090  poll          dhclient
 73477  185321      1      0  3        0x80  poll          dhclient
 64502  136354      0      0  3     0x14200  bored         smr
 15097  269284      0      0  2     0x14200                zerothread
 62256  327951      0      0  3     0x14200  aiodoned      aiodoned
  3754  365547      0      0  3     0x14200  syncer        update
 78062   26911      0      0  3     0x14200  cleaner       cleaner
 75362  406900      0      0  3     0x14200  reaper        reaper
  9290  129517      0      0  3     0x14200  pgdaemon      pagedaemon
 80579  490807      0      0  3     0x14200  bored         crynlk
 62347  328871      0      0  3     0x14200  bored         crypto
 25957  300227      0      0  3  0x40014200  acpi0         acpi0
 86713  452054      0      0  3     0x14200  bored         softnet
 85572   38095      0      0  3     0x14200  bored         systqmp
 22906  162641      0      0  3     0x14200  bored         systq
 21634  447379      0      0  3  0x40014200  bored         softclock
 20253  457117      0      0  3  0x40014200                idle0
     1  469393      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
         devbuf  9438   6318K    6319K  78643K     10537        0
            pcb    13      8K       8K  78643K        13        0
         rtable    61      1K       2K  78643K       117        0
         ifaddr    25      7K       7K  78643K        25        0
       counters    19     16K      16K  78643K        19        0
       ioctlops     1      0K       4K  78643K        15        0
          mount     1      1K       1K  78643K         1        0
         vnodes  1182     74K      74K  78643K      1187        0
      UFS quota     1     32K      32K  78643K         1        0
      UFS mount     5     36K      36K  78643K         5        0
            shm     2      1K       1K  78643K         2        0
         VM map     2      0K       0K  78643K         2        0
            sem     2      0K       0K  78643K         2        0
        dirhash    12      2K       2K  78643K        12        0
           ACPI  1809    195K     288K  78643K     12938        0
      file desc     1      0K       0K  78643K         1        0
           proc    47     38K      46K  78643K       278        0
    NFS srvsock     1      0K       0K  78643K         1        0
     NFS daemon     1     16K      16K  78643K         1        0
       in_multi    11      0K       0K  78643K        11        0
    ether_multi     1      0K       0K  78643K         1        0
    ISOFS mount     1     32K      32K  78643K         1        0
  MSDOSFS mount     1     16K      16K  78643K         1        0
           ttys    19     95K      95K  78643K        19        0
           exec     0      0K       2K  78643K       261        0
        pagedep     1      8K       8K  78643K         1        0
       inodedep     1     32K      32K  78643K         1        0
         newblk     1      0K       0K  78643K         1        0
        VM swap     7     26K      26K  78643K         7        0
       UVM amap    32      1K       2K  78643K       558        0
       UVM aobj     3      2K       2K  78643K         3        0
        memdesc     1      4K       4K  78643K         1        0
    crypto data     1      1K       1K  78643K         1        0
            NDP     3      0K       0K  78643K         3        0
           temp    18   3941K    4005K  78643K      1436        0
         kqueue     2      2K       2K  78643K         2        0
      SYN cache     2     16K      16K  78643K         2        0
ddb> show all pools
Name      Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
arp         64        2    0        0     1     0     1     1     0     8    0
rtpcb       96       15    0       13     1     0     1     1     0     8    0
rtentry    112       23    0        1     1     0     1     1     0     8    0
unpcb      120       27    0       19     1     0     1     1     0     8    0
syncache   272        5    0        5     2     1     1     1     0     8    1
tcpcb      592        8    0        5     1     0     1     1     0     8    0
inpcb      296       22    0       16     1     0     1     1     0     8    0
pfrule     1360       1    0        0     1     0     1     1     0     8    0
art_heap8  4096       1    0        0     1     0     1     1     0     8    0
art_heap4  256       96    0        0     6     0     6     6     0     8    0
art_table   32       97    0        0     1     0     1     1     0     8    0
art_node    16       22    0        2     1     0     1     1     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino2pl    256     1389    0       15    86     0    86    86     0     8    0
ffsino     240     1389    0       15    81     0    81    81     0     8    0
nchpl      144     1563    0       30    57     0    57    57     0     8    0
uvmvnodes   72     1398    0        0    26     0    26    26     0     8    0
vnodes     208     1398    0        0    74     0    74    74     0     8    0
namei      1024    3487    0     3487     2     1     1     1     0     8    1
scxspl     200     3351    0     3351     2     1     1     1     0     8    1
plimitpl   152       13    0        8     1     0     1     1     0     8    0
sigapl     424      191    0      166     4     0     4     4     0     8    0
knotepl    112        5    0        0     1     0     1     1     0     8    0
kqueuepl   152        1    0        0     1     0     1     1     0     8    0
pipepl     272       57    0       53     2     1     1     1     0     8    0
fdescpl    432      177    0      166     2     0     2     2     0     8    0
filepl     120      824    0      779     2     0     2     2     0     8    0
lockfpl    104        5    0        4     1     0     1     1     0     8    0
lockfspl    48        3    0        2     1     0     1     1     0     8    0
sessionpl  120       17    0        9     1     0     1     1     0     8    0
pgrppl      48       17    0        9     1     0     1     1     0     8    0
ucredpl     96       57    0       50     1     0     1     1     0     8    0
zombiepl   144      166    0      166     2     1     1     1     0     8    1
processpl  944      191    0      166     4     0     4     4     0     8    0
procpl     632      191    0      166     3     0     3     3     0     8    0
sockpl     400       64    0       48     2     0     2     2     0     8    0
mcl4k      4096      10    0       10     2     1     1     1     0     8    1
mcl2k      2048    5400    0     5372     8     2     6     6     0     8    2
mtagpl      96        2    0        2     1     1     0     1     0     8    0
mbufpl     256     9393    0     9355     5     1     4     4     0     8    0
bufpl      280     1837    0      100   125     0   125   125     0     8    0
anonpl      16    20822    0    19700     7     2     5     7     0   107    0
amapchunkpl 152     676    0      641     3     0     3     3     0   158    0
amappl16   192       75    0       70     1     0     1     1     0     8    0
amappl15   184        1    0        0     1     0     1     1     0     8    0
amappl14   176       22    0       19     1     0     1     1     0     8    0
amappl13   168       12    0       11     2     1     1     1     0     8    0
amappl12   160        5    0        5     1     1     0     1     0     8    0
amappl11   152       39    0       30     1     0     1     1     0     8    0
amappl10   144        4    0        2     1     0     1     1     0     8    0
amappl9    136      175    0      175     1     1     0     1     0     8    0
amappl8    128       40    0       39     1     0     1     1     0     8    0
amappl7    120      193    0      192     1     0     1     1     0     8    0
amappl6    112       89    0       79     1     0     1     1     0     8    0
amappl5    104      293    0      284     1     0     1     1     0     8    0
amappl4     96      241    0      216     1     0     1     1     0     8    0
amappl3     88       74    0       65     1     0     1     1     0     8    0
amappl2     80      786    0      740     3     1     2     2     0     8    1
amappl1     72    12197    0    11813    16     6    10    16     0     8    0
amappl      80      395    0      377     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
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      64        2    0        0     1     0     1     1     0     8    0
uaddrrnd    24      177    0      166     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24      177    0      166     1     0     1     1     0     8    0
vmmpekpl   168     5189    0     5173     1     0     1     1     0     8    0
vmmpepl    168    26302    0    25560    55    19    36    48     0   357    1
vmsppl     272      176    0      166     1     0     1     1     0     8    0
pdppl      4096     360    0      332     5     0     5     5     0     8    0
pvpl        32    75385    0    72592    33     6    27    27     0   265    3
pmappl     200      176    0      166     1     0     1     1     0     8    0
extentpl    40       53    0       36     1     0     1     1     0     8    0
phpool     112      209    0        9     6     0     6     6     0     8    0
ddb> machine ddbcpu 0
No such command
ddb> trace
pfsync_state_import(ffff800000ac6400,1) at pfsync_state_import+0x108 sys/net/if_pfsync.c:529
pfioctl(4900,c1084425,ffff800000ac6400,3,ffff80001d702778) at pfioctl+0x2764 sys/net/pf_ioctl.c:1688
VOP_IOCTL(fffffd805e06c270,c1084425,ffff800000ac6400,3,fffffd806c3bfc00,ffff80001d702778) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290
vn_ioctl(fffffd805d7f9710,c1084425,ffff800000ac6400,ffff80001d702778) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531
sys_ioctl(ffff80001d702778,ffff80001d735878,ffff80001d7358c0) at sys_ioctl+0x4ac
syscall(ffff80001d735940) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7ffffc0dc0, count: -7
ddb> machine ddbcpu 1
No such command
ddb> trace
pfsync_state_import(ffff800000ac6400,1) at pfsync_state_import+0x108 sys/net/if_pfsync.c:529
pfioctl(4900,c1084425,ffff800000ac6400,3,ffff80001d702778) at pfioctl+0x2764 sys/net/pf_ioctl.c:1688
VOP_IOCTL(fffffd805e06c270,c1084425,ffff800000ac6400,3,fffffd806c3bfc00,ffff80001d702778) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290
vn_ioctl(fffffd805d7f9710,c1084425,ffff800000ac6400,ffff80001d702778) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531
sys_ioctl(ffff80001d702778,ffff80001d735878,ffff80001d7358c0) at sys_ioctl+0x4ac
syscall(ffff80001d735940) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7ffffc0dc0, count: -7

Crashes (10):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-openbsd-main 2020/08/19 15:09 openbsd 7a3e72b5ba77 a7d4a4f9 .config log report syz C
ci-openbsd-main 2020/08/22 13:53 openbsd 76de64e82b8f 6436ce4b .config log report
ci-openbsd-main 2020/08/19 22:00 openbsd 7a3e72b5ba77 a7d4a4f9 .config log report
ci-openbsd-main 2020/08/19 10:20 openbsd 7a3e72b5ba77 a7d4a4f9 .config log report
ci-openbsd-main 2020/08/09 13:19 openbsd 97da2ad2205f 70301872 .config log report
ci-openbsd-main 2020/08/08 18:25 openbsd a395eaf7c290 f721e4a0 .config log report
ci-openbsd-main 2020/08/07 18:54 openbsd 42858fb0ce8a bb468f32 .config log report
ci-openbsd-main 2020/07/15 12:57 openbsd f8fbf366cc5a ada108d0 .config log report
ci-openbsd-main 2020/07/12 19:13 openbsd 1721822955a2 9ebcc5b1 .config log report
ci-openbsd-main 2020/06/13 21:46 openbsd 2ed200e57779 dbce178a .config log report
* Struck through repros no longer work on HEAD.