syzbot


uvm_fault: pfi_address_add

Status: fixed on 2020/08/05 06:16
Reported-by: syzbot+d70144b3ae2ec068e318@syzkaller.appspotmail.com
Fix commit: efa3c3dd644f Validate input given to ioctl(SIOCAIFADDR_IN6) like NetBSD already does. Fixes a bunch of panics reported by syzkaller.
First crash: 1636d, last: 1580d

Sample crash report:
login: uvm_fault(0xfffffd806bc09bb0, 0x4, 0, 1) -> e
kernel: page fault trap, code=0
Stopped at      pfi_address_add+0x1eb:  movl    0x4(%rax),%eax
ddb> 
ddb> set $lines = 0
ddb> set $maxwidth = 0
ddb> show panic
kernel page fault
uvm_fault(0xfffffd806bc09bb0, 0x4, 0, 1) -> e
pfi_address_add(0,2,0) at pfi_address_add+0x1eb sys/net/pf_if.c:585
end trace frame: 0xffff80001d807e80, count: 0
ddb> trace
pfi_address_add(0,2,0) at pfi_address_add+0x1eb sys/net/pf_if.c:585
pfi_instance_add(ffff8000009f6800,0,2) at pfi_instance_add+0x5e5
pfi_table_update(ffff800000a0af40,ffff8000006b5200,0,2) at pfi_table_update+0x174
pfi_kif_update(ffff8000006b5200) at pfi_kif_update+0xba pfi_dynaddr_update sys/net/pf_if.c:466 [inline]
pfi_kif_update(ffff8000006b5200) at pfi_kif_update+0xba sys/net/pf_if.c:442
if_addgroup(ffff8000009f6800,ffff80001d808098) at if_addgroup+0x280 sys/net/if.c:2742
ifioctl(fffffd805dad8c88,80286987,ffff80001d808080,ffff80001d739ea8) at ifioctl+0x13e7 sys/net/if.c:2154
sys_ioctl(ffff80001d739ea8,ffff80001d808198,ffff80001d8081e0) at sys_ioctl+0x4a1
syscall(ffff80001d808260) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7fffff61f0, count: -9
ddb> show registers
rdi                             0x20
rsi                                0
rbp               0xffff80001d807de0
rbx                                0
rdx                                0
rcx               0xffff800000654000
rax                                0
r8                0xffffffff813ede51    pfi_instance_add+0xf1
r9                               0x1
r10                              0x2
r11               0xe179ff2c045ab858
r12                             0x34
r13                              0x2
r14               0xffff800000654034
r15                                0
rip               0xffffffff813ee59b    pfi_address_add+0x1eb
cs                               0x8
rflags                       0x10246    __ALIGN_SIZE+0xf246
rsp               0xffff80001d807d70
ss                              0x10
pfi_address_add+0x1eb:  movl    0x4(%rax),%eax
ddb> show proc
PROC (syz-executor.0) pid=456735 stat=onproc
    flags process=0 proc=0
    pri=50, usrpri=50, nice=20
    forw=0xffffffffffffffff, list=0xffff80001d73a868,0xffffffff825ec610
    process=0xffff8000ffffb5a0 user=0xffff80001d803000, vmspace=0xfffffd806bc09bb0
    estcpu=3, cpticks=1, pctcpu=0.0
    user=0, sys=1, intr=0
ddb> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
*74354  456735  97446      0  7           0                syz-executor.0
 97446  194221  49897      0  3        0x82  nanosleep     syz-executor.0
 49897  167501  22615      0  3        0x82  thrsleep      syz-execprog
 49897    3363  22615      0  2   0x4000482                syz-execprog
 49897  359441  22615      0  3   0x4000082  thrsleep      syz-execprog
 49897  195466  22615      0  3   0x4000082  thrsleep      syz-execprog
 49897  401384  22615      0  3   0x4000082  kqread        syz-execprog
 49897  249174  22615      0  3   0x4000082  thrsleep      syz-execprog
 49897  179508  22615      0  3   0x4000082  thrsleep      syz-execprog
 49897   72769  22615      0  3   0x4000082  thrsleep      syz-execprog
 22615  279574  21817      0  3    0x10008a  pause         ksh
 21817  457497   5317      0  3        0x92  select        sshd
 19088  427973      1      0  3    0x100083  ttyin         getty
  5317  239351      1      0  3        0x80  select        sshd
 78480   39425  60670     73  3    0x100090  kqread        syslogd
 60670   22119      1      0  3    0x100082  netio         syslogd
 57617  519553      1     77  3    0x100090  poll          dhclient
 12013  477431      1      0  3        0x80  poll          dhclient
 92273  476749      0      0  3     0x14200  bored         smr
 55559  311887      0      0  2     0x14200                zerothread
 28531  181759      0      0  3     0x14200  aiodoned      aiodoned
  9683  516574      0      0  3     0x14200  syncer        update
 93045  127724      0      0  3     0x14200  cleaner       cleaner
  1386    9468      0      0  3     0x14200  reaper        reaper
 30954  503685      0      0  3     0x14200  pgdaemon      pagedaemon
 90014  441025      0      0  3     0x14200  bored         crynlk
  3434  418717      0      0  3     0x14200  bored         crypto
 54763  234795      0      0  3  0x40014200  acpi0         acpi0
 88689  101016      0      0  3     0x14200  bored         softnet
 40100  476348      0      0  3     0x14200  bored         systqmp
 69708  519109      0      0  3     0x14200  bored         systq
 81392  183425      0      0  2  0x40014200                softclock
 67786   71402      0      0  3  0x40014200                idle0
     1  500557      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  9444   6321K    6321K  78643K     10543        0
            pcb    13      8K       8K  78643K        13        0
         rtable    88      3K       4K  78643K       160        0
         ifaddr    34      9K       9K  78643K        34        0
       counters    20     16K      16K  78643K        20        0
       ioctlops     0      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     3      8K      12K  78643K        18        0
           proc    47     38K      54K  78643K       318        0
    NFS srvsock     1      0K       0K  78643K         1        0
     NFS daemon     1     16K      16K  78643K         1        0
       in_multi    26      1K       1K  78643K        26        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       1K  78643K       171        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    69     11K      12K  78643K       838        0
       UVM aobj     2      2K       2K  78643K         2        0
        memdesc     1      4K       4K  78643K         1        0
    crypto data     1      1K       1K  78643K         1        0
            NDP     6      0K       0K  78643K         6        0
           temp    27   3027K    3089K  78643K      1628        0
         kqueue     3      4K       4K  78643K         3        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        4    0        0     1     0     1     1     0     8    0
rtpcb       80       17    0       15     1     0     1     1     0     8    0
rtentry    112       34    0        1     1     0     1     1     0     8    0
unpcb      120       27    0       19     1     0     1     1     0     8    0
syncache   264        5    0        5     2     1     1     1     0     8    1
tcpcb      544        9    0        5     1     0     1     1     0     8    0
inpcb      280       28    0       20     1     0     1     1     0     8    0
nd6         48        3    0        0     1     0     1     1     0     8    0
pfrktable  1344       3    0        1     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      144    0        0     9     0     9     9     0     8    0
art_table   32      145    0        0     2     0     2     2     0     8    0
art_node    16       33    0        3     1     0     1     1     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino2pl    256     1415    0       21    88     0    88    88     0     8    0
ffsino     240     1415    0       21    82     0    82    82     0     8    0
nchpl      144     1633    0       36    60     0    60    60     0     8    0
uvmvnodes   72     1424    0        0    26     0    26    26     0     8    0
vnodes     208     1424    0        0    75     0    75    75     0     8    0
namei      1024    3920    0     3920     2     1     1     1     0     8    1
pfiaddrpl  120        1    0        0     1     0     1     1     0     8    0
scxspl     192     3848    0     3848     6     5     1     1     0     8    1
plimitpl   152       14    0        8     1     0     1     1     0     8    0
sigapl     424      212    0      185     4     0     4     4     0     8    0
knotepl    112       47    0       36     1     0     1     1     0     8    0
kqueuepl   144        2    0        0     1     0     1     1     0     8    0
pipelkpl    16       70    0       63     2     1     1     1     0     8    0
pipepl     120      140    0      127     2     1     1     1     0     8    0
fdescpl    432      198    0      185     2     0     2     2     0     8    0
filepl     120      980    0      924     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  112       18    0        9     1     0     1     1     0     8    0
pgrppl      48       18    0        9     1     0     1     1     0     8    0
ucredpl     96       57    0       50     1     0     1     1     0     8    0
zombiepl   144      185    0      185     2     1     1     1     0     8    1
processpl  920      212    0      185     4     0     4     4     0     8    0
procpl     624      219    0      185     3     0     3     3     0     8    0
sockpl     400       72    0       54     2     0     2     2     0     8    0
mcl4k      4096      10    0       10     2     1     1     1     0     8    1
mcl2k      2048    5524    0     5495     7     3     4     7     0     8    0
mtagpl      80        2    0        2     1     1     0     1     0     8    0
mbufpl     256     9621    0     9546     7     2     5     5     0     8    0
bufpl      280     2899    0      126   199     0   199   199     0     8    0
anonpl      16    20283    0    18694    14     2    12    12     0   107    4
amapchunkpl 152     788    0      727     4     0     4     4     0   158    1
amappl16   192      126    0       92     2     0     2     2     0     8    0
amappl15   184        3    0        0     1     0     1     1     0     8    0
amappl14   176       26    0       22     1     0     1     1     0     8    0
amappl13   168       21    0       18     2     1     1     1     0     8    0
amappl12   160        6    0        4     2     1     1     1     0     8    0
amappl11   152       46    0       37     1     0     1     1     0     8    0
amappl10   144       12    0        9     1     0     1     1     0     8    0
amappl9    136      202    0      201     1     0     1     1     0     8    0
amappl8    128      240    0      231     1     0     1     1     0     8    0
amappl7    120      102    0       91     1     0     1     1     0     8    0
amappl6    112       22    0       20     2     1     1     1     0     8    0
amappl5    104      174    0      165     1     0     1     1     0     8    0
amappl4     96      427    0      402     1     0     1     1     0     8    0
amappl3     88      107    0      102     1     0     1     1     0     8    0
amappl2     80      803    0      749     3     1     2     2     0     8    0
amappl1     72    13520    0    13122    25     8    17    17     0     8    9
amappl      80      418    0      392     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        1    0        0     1     0     1     1     0     8    0
uaddrrnd    24      198    0      185     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24      198    0      185     1     0     1     1     0     8    0
vmmpekpl   168     6150    0     6132     1     0     1     1     0     8    0
vmmpepl    168    29009    0    28134    86    17    69    69     0   357   30
vmsppl     272      197    0      185     1     0     1     1     0     8    0
pdppl      4096     402    0      370     5     0     5     5     0     8    0
pvpl        32   104720    0   100855   109     7   102   102     0   265   69
pmappl     200      197    0      185     1     0     1     1     0     8    0
extentpl    40       53    0       36     1     0     1     1     0     8    0
phpool     112      216    0        9     6     0     6     6     0     8    0
ddb> machine ddbcpu 0
No such command
ddb> trace
pfi_address_add(0,2,0) at pfi_address_add+0x1eb sys/net/pf_if.c:585
pfi_instance_add(ffff8000009f6800,0,2) at pfi_instance_add+0x5e5
pfi_table_update(ffff800000a0af40,ffff8000006b5200,0,2) at pfi_table_update+0x174
pfi_kif_update(ffff8000006b5200) at pfi_kif_update+0xba pfi_dynaddr_update sys/net/pf_if.c:466 [inline]
pfi_kif_update(ffff8000006b5200) at pfi_kif_update+0xba sys/net/pf_if.c:442
if_addgroup(ffff8000009f6800,ffff80001d808098) at if_addgroup+0x280 sys/net/if.c:2742
ifioctl(fffffd805dad8c88,80286987,ffff80001d808080,ffff80001d739ea8) at ifioctl+0x13e7 sys/net/if.c:2154
sys_ioctl(ffff80001d739ea8,ffff80001d808198,ffff80001d8081e0) at sys_ioctl+0x4a1
syscall(ffff80001d808260) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7fffff61f0, count: -9
ddb> machine ddbcpu 1
No such command
ddb> trace
pfi_address_add(0,2,0) at pfi_address_add+0x1eb sys/net/pf_if.c:585
pfi_instance_add(ffff8000009f6800,0,2) at pfi_instance_add+0x5e5
pfi_table_update(ffff800000a0af40,ffff8000006b5200,0,2) at pfi_table_update+0x174
pfi_kif_update(ffff8000006b5200) at pfi_kif_update+0xba pfi_dynaddr_update sys/net/pf_if.c:466 [inline]
pfi_kif_update(ffff8000006b5200) at pfi_kif_update+0xba sys/net/pf_if.c:442
if_addgroup(ffff8000009f6800,ffff80001d808098) at if_addgroup+0x280 sys/net/if.c:2742
ifioctl(fffffd805dad8c88,80286987,ffff80001d808080,ffff80001d739ea8) at ifioctl+0x13e7 sys/net/if.c:2154
sys_ioctl(ffff80001d739ea8,ffff80001d808198,ffff80001d8081e0) at sys_ioctl+0x4a1
syscall(ffff80001d808260) at syscall+0x507 sys/arch/amd64/amd64/trap.c:570
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7f7fffff61f0, count: -9

Crashes (1359):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/05/30 03:39 openbsd d0e5c0ea53c9 954bd312 .config console log report syz ci-openbsd-main
2020/07/25 07:35 openbsd a9f43bc31f08 0a13649c .config console log report ci-openbsd-multicore
2020/07/25 04:05 openbsd a9f43bc31f08 0a13649c .config console log report ci-openbsd-multicore
2020/07/22 23:45 openbsd fad015d206fd 340ea530 .config console log report ci-openbsd-main
2020/07/22 22:15 openbsd e9ef9ac65b9c 128cd85f .config console log report ci-openbsd-main
2020/07/22 20:56 openbsd e9ef9ac65b9c 128cd85f .config console log report ci-openbsd-main
2020/07/22 19:38 openbsd e9ef9ac65b9c 128cd85f .config console log report ci-openbsd-main
2020/07/22 17:46 openbsd e9ef9ac65b9c 128cd85f .config console log report ci-openbsd-main
2020/07/22 06:48 openbsd 12d98fe19503 21f1765e .config console log report ci-openbsd-main
2020/07/22 04:53 openbsd 12d98fe19503 21f1765e .config console log report ci-openbsd-main
2020/07/22 03:43 openbsd 12d98fe19503 21f1765e .config console log report ci-openbsd-main
2020/07/22 02:15 openbsd 12d98fe19503 21f1765e .config console log report ci-openbsd-main
2020/07/21 19:14 openbsd 38194102e48c 328906f3 .config console log report ci-openbsd-main
2020/07/21 12:40 openbsd 38194102e48c 328906f3 .config console log report ci-openbsd-main
2020/07/21 10:14 openbsd 610b9993a684 d88894e6 .config console log report ci-openbsd-main
2020/07/21 08:36 openbsd 610b9993a684 d88894e6 .config console log report ci-openbsd-main
2020/07/21 06:09 openbsd 610b9993a684 d88894e6 .config console log report ci-openbsd-main
2020/07/21 00:56 openbsd 610b9993a684 d88894e6 .config console log report ci-openbsd-main
2020/07/20 23:45 openbsd 610b9993a684 d88894e6 .config console log report ci-openbsd-main
2020/07/20 22:15 openbsd 610b9993a684 d88894e6 .config console log report ci-openbsd-main
2020/07/20 13:31 openbsd bea295828719 8caeeeb7 .config console log report ci-openbsd-main
2020/07/20 11:29 openbsd bea295828719 8caeeeb7 .config console log report ci-openbsd-main
2020/07/20 06:07 openbsd 5cb69e53a7eb 9c812472 .config console log report ci-openbsd-main
2020/07/20 04:25 openbsd 5cb69e53a7eb 9c812472 .config console log report ci-openbsd-main
2020/07/20 01:49 openbsd 5cb69e53a7eb 9c812472 .config console log report ci-openbsd-main
2020/07/19 23:41 openbsd 5cb69e53a7eb 9c812472 .config console log report ci-openbsd-main
2020/07/19 17:50 openbsd 6a6361194be2 9c812472 .config console log report ci-openbsd-main
2020/07/19 16:45 openbsd 6a6361194be2 9c812472 .config console log report ci-openbsd-main
2020/07/19 15:08 openbsd 6a6361194be2 9c812472 .config console log report ci-openbsd-main
2020/07/19 12:19 openbsd 6a6361194be2 9c812472 .config console log report ci-openbsd-main
2020/07/19 11:09 openbsd 6a6361194be2 9c812472 .config console log report ci-openbsd-main
2020/07/19 05:25 openbsd d711776be3d8 9c812472 .config console log report ci-openbsd-main
2020/07/19 03:40 openbsd d711776be3d8 9c812472 .config console log report ci-openbsd-main
2020/07/19 02:37 openbsd d711776be3d8 9c812472 .config console log report ci-openbsd-main
2020/07/19 00:43 openbsd d711776be3d8 9c812472 .config console log report ci-openbsd-main
2020/07/18 23:33 openbsd d711776be3d8 9c812472 .config console log report ci-openbsd-main
2020/07/18 22:05 openbsd d711776be3d8 9c812472 .config console log report ci-openbsd-main
2020/07/18 21:43 openbsd d711776be3d8 9c812472 .config console log report ci-openbsd-main
2020/07/18 18:15 openbsd d711776be3d8 9c812472 .config console log report ci-openbsd-main
2020/07/18 12:59 openbsd a44bf07fbdaa 9c812472 .config console log report ci-openbsd-main
2020/07/18 10:06 openbsd a44bf07fbdaa 9c812472 .config console log report ci-openbsd-main
2020/07/18 08:26 openbsd a44bf07fbdaa 9c812472 .config console log report ci-openbsd-main
2020/07/18 07:18 openbsd a44bf07fbdaa 9c812472 .config console log report ci-openbsd-main
2020/07/18 06:10 openbsd a44bf07fbdaa 9c812472 .config console log report ci-openbsd-main
2020/07/18 03:16 openbsd a44bf07fbdaa 9c812472 .config console log report ci-openbsd-main
2020/07/18 00:59 openbsd 452daaedc6a4 9c812472 .config console log report ci-openbsd-main
2020/07/17 23:46 openbsd 452daaedc6a4 9c812472 .config console log report ci-openbsd-main
2020/07/17 20:50 openbsd 452daaedc6a4 9c812472 .config console log report ci-openbsd-main
2020/07/17 19:37 openbsd 452daaedc6a4 9c812472 .config console log report ci-openbsd-main
2020/07/17 18:34 openbsd 452daaedc6a4 9c812472 .config console log report ci-openbsd-main
2020/07/17 16:57 openbsd 452daaedc6a4 9c812472 .config console log report ci-openbsd-main
2020/07/17 15:29 openbsd 452daaedc6a4 9c812472 .config console log report ci-openbsd-main
2020/07/17 13:14 openbsd 452daaedc6a4 54b3c45e .config console log report ci-openbsd-main
2020/07/17 11:41 openbsd 452daaedc6a4 54b3c45e .config console log report ci-openbsd-main
2020/07/17 03:13 openbsd c45df27875dd 54b3c45e .config console log report ci-openbsd-main
2020/07/11 22:21 openbsd b1f788244d72 7ba05d2d .config console log report ci-openbsd-multicore
2020/05/30 02:10 openbsd d0e5c0ea53c9 954bd312 .config console log report ci-openbsd-main
* Struck through repros no longer work on HEAD.