syzbot


uvm_fault (2)

Status: fixed on 2020/08/05 06:16
Reported-by: syzbot+c26b058a499ce38f689f@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: 906d, last: 906d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
openbsd uvm_fault 10 1146d 1161d 0/3 auto-closed as invalid on 2020/01/15 14:32

Sample crash report:
login: uvm_fault(0xffffffff827c6788, 0xffffffff00000000, 0, 4) -> e
kernel: page fault trap, code=0
Stopped at      0xffffffff00000000:uvm_fault(0xffffffff827c6788, 0xffffffff00000000, 0, 1) -> e
     kernel: page fault trap, code=0
Stopped at      db_read_bytes+0xe3:     movzbl  0(%r15,%rbx,1),%eax
ddb> 
ddb> set $lines = 0
ddb> set $maxwidth = 0
ddb> show panic
kernel page fault
uvm_fault(0xffffffff827c6788, 0xffffffff00000000, 0, 1) -> e
db_read_bytes(ffffffff00000000,1,ffff80001d779ce4) at db_read_bytes+0xe3 sys/arch/amd64/amd64/db_memrw.c:85
end trace frame: 0xffff80001d779d40, count: 0
ddb> trace
db_read_bytes(ffffffff00000000,1,ffff80001d779ce4) at db_read_bytes+0xe3 sys/arch/amd64/amd64/db_memrw.c:85
db_get_value(ffffffff00000000,1,0) at db_get_value+0x60 sys/ddb/db_access.c:59
db_disasm(ffffffff00000000,0) at db_disasm+0x8f
db_trap(6,0) at db_trap+0x12e sys/ddb/db_trap.c:71
db_ktrap(6,0,ffff80001d779f70) at db_ktrap+0x1b6 sys/arch/amd64/amd64/db_interface.c:149
kerntrap(ffff80001d779f70) at kerntrap+0x129 sys/arch/amd64/amd64/trap.c:293
alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b
end trace frame: 0x0, count: -7
ddb> show registers
rdi                                0
rsi                              0x1
rbp               0xffff80001d779cc0
rbx                                0
rdx                              0x4
rcx                              0x7
rax                              0x1
r8                0xffffffff81af4a8f    db_read_bytes+0x3f
r9                               0x7
r10               0xd5dfee9bbff53431
r11               0xee075ab59bb7b684
r12                                0
r13                                0
r14               0xffff80001d779ce4
r15               0xffffffff00000000
rip               0xffffffff81af4b33    db_read_bytes+0xe3
cs                               0x8
rflags                       0x10246    __ALIGN_SIZE+0xf246
rsp               0xffff80001d779c60
ss                              0x10
db_read_bytes+0xe3:     movzbl  0(%r15,%rbx,1),%eax
ddb> show proc
PROC (syz-executor.0) pid=398801 stat=onproc
    flags process=0 proc=0
    pri=50, usrpri=50, nice=20
    forw=0xffffffffffffffff, list=0xffff80001d6aa388,0xffffffff827c95b8
    process=0xffff8000ffffb938 user=0xffff80001d775000, vmspace=0xfffffd806bc0a220
    estcpu=36, cpticks=1, pctcpu=0.0
    user=0, sys=1, intr=0
ddb> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
*  281  398801  27540      0  7           0                syz-executor.0
 27540  449385   2571      0  3        0x82  nanosleep     syz-executor.0
  2571  224380  45374      0  3        0x82  kqread        syz-execprog
  2571  515283  45374      0  3   0x4000082  nanosleep     syz-execprog
  2571  397138  45374      0  3   0x4000082  thrsleep      syz-execprog
  2571   70963  45374      0  3   0x4000082  thrsleep      syz-execprog
  2571  519160  45374      0  3   0x4000082  thrsleep      syz-execprog
  2571  239287  45374      0  3   0x4000082  thrsleep      syz-execprog
  2571  502047  45374      0  3   0x4000082  thrsleep      syz-execprog
  2571  249780  45374      0  3   0x4000082  thrsleep      syz-execprog
 45374  237603  14166      0  3    0x10008a  pause         ksh
 14166  373510  41631      0  3        0x92  select        sshd
 44020  222771      1      0  3    0x100083  ttyin         getty
 41631  350847      1      0  3        0x80  select        sshd
 85857  341790   4502     73  3    0x100090  kqread        syslogd
  4502   98544      1      0  3    0x100082  netio         syslogd
 65636  484699      1     77  3    0x100090  poll          dhclient
 19476  133793      1      0  3        0x80  poll          dhclient
 40170  426379      0      0  3     0x14200  bored         smr
 66559  150803      0      0  2     0x14200                zerothread
   938  308470      0      0  3     0x14200  aiodoned      aiodoned
  5657  244279      0      0  3     0x14200  syncer        update
 12443   51390      0      0  3     0x14200  cleaner       cleaner
 14178  378891      0      0  3     0x14200  reaper        reaper
  1106  202517      0      0  3     0x14200  pgdaemon      pagedaemon
 21140  512845      0      0  3     0x14200  bored         crynlk
  8672  170441      0      0  3     0x14200  bored         crypto
 12814  411847      0      0  3  0x40014200  acpi0         acpi0
 25881  140502      0      0  3     0x14200  bored         softnet
 54826  355563      0      0  3     0x14200  bored         systqmp
 88905  507514      0      0  3     0x14200  bored         systq
 49130   49234      0      0  2  0x40014200                softclock
   175  501163      0      0  3  0x40014200                idle0
     1  350429      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    83      2K       2K  78643K       153        0
         ifaddr    32      8K       9K  78643K        82        0
       counters    20     16K      16K  78643K        20        0
       ioctlops     0      0K       2K  78643K        14        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        67        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    22      1K       1K  78643K        22        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    67     11K      12K  78643K       886        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     4      0K       0K  78643K         6        0
           temp    23   3837K    3901K  78643K      1718        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        8    0        5     1     0     1     1     0     8    0
inpcb      280       76    0       69     1     0     1     1     0     8    0
nd6         48        3    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      145    0        0    10     0    10    10     0     8    0
art_table   32      146    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     1464    0       70    88     0    88    88     0     8    0
ffsino     240     1464    0       70    83     0    83    83     0     8    0
nchpl      144     1731    0      135    60     0    60    60     0     8    0
uvmvnodes   72     1473    0        0    27     0    27    27     0     8    0
vnodes     208     1473    0        0    78     0    78    78     0     8    0
namei      1024    4115    0     4115     2     1     1     1     0     8    1
scxspl     192     4708    0     4708     2     1     1     1     0     8    1
plimitpl   152       14    0        8     1     0     1     1     0     8    0
sigapl     424      261    0      234     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      247    0      234     2     0     2     2     0     8    0
filepl     120     1076    0     1022     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      234    0      234     2     1     1     1     0     8    1
processpl  920      261    0      234     4     0     4     4     0     8    0
procpl     624      268    0      234     3     0     3     3     0     8    0
sockpl     400      120    0      103     2     0     2     2     0     8    0
mcl4k      4096      10    0       10     2     1     1     1     0     8    1
mcl2k      2048    5522    0     5494     6     2     4     6     0     8    0
mtagpl      80        2    0        2     1     1     0     1     0     8    0
mbufpl     256     9672    0     9593     7     1     6     6     0     8    1
bufpl      280     3008    0      125   206     0   206   206     0     8    0
anonpl      16    21591    0    20044    14     2    12    12     0   107    4
amapchunkpl 152     806    0      745     4     0     4     4     0   158    1
amappl16   192      297    0      261     2     0     2     2     0     8    0
amappl15   184        1    0        0     1     0     1     1     0     8    0
amappl14   176       27    0       23     1     0     1     1     0     8    0
amappl13   168      122    0      116     2     1     1     1     0     8    0
amappl12   160        5    0        5     2     1     1     1     0     8    1
amappl11   152       43    0       33     1     0     1     1     0     8    0
amappl10   144       10    0        7     1     0     1     1     0     8    0
amappl9    136      214    0      213     1     0     1     1     0     8    0
amappl8    128      235    0      228     1     0     1     1     0     8    0
amappl7    120      102    0       91     1     0     1     1     0     8    0
amappl6    112       25    0       21     1     0     1     1     0     8    0
amappl5    104      146    0      136     1     0     1     1     0     8    0
amappl4     96      486    0      456     1     0     1     1     0     8    0
amappl3     88      158    0      151     1     0     1     1     0     8    0
amappl2     80      883    0      830     2     0     2     2     0     8    0
amappl1     72    13995    0    13594    24     7    17    17     0     8    8
amappl      80      467    0      441     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      247    0      234     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24      247    0      234     1     0     1     1     0     8    0
vmmpekpl   168     6233    0     6213     2     0     2     2     0     8    1
vmmpepl    168    31066    0    30178    85    16    69    69     0   357   30
vmsppl     272      246    0      234     1     0     1     1     0     8    0
pdppl      4096     500    0      468     5     0     5     5     0     8    0
pvpl        32   110025    0   106193   108     6   102   102     0   265   70
pmappl     200      246    0      234     1     0     1     1     0     8    0
extentpl    40       53    0       36     1     0     1     1     0     8    0
phpool     112      216    0        7     6     0     6     6     0     8    0
ddb> machine ddbcpu 0
No such command
ddb> trace
db_read_bytes(ffffffff00000000,1,ffff80001d779ce4) at db_read_bytes+0xe3 sys/arch/amd64/amd64/db_memrw.c:85
db_get_value(ffffffff00000000,1,0) at db_get_value+0x60 sys/ddb/db_access.c:59
db_disasm(ffffffff00000000,0) at db_disasm+0x8f
db_trap(6,0) at db_trap+0x12e sys/ddb/db_trap.c:71
db_ktrap(6,0,ffff80001d779f70) at db_ktrap+0x1b6 sys/arch/amd64/amd64/db_interface.c:149
kerntrap(ffff80001d779f70) at kerntrap+0x129 sys/arch/amd64/amd64/trap.c:293
alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b
end trace frame: 0x0, count: -7
ddb> machine ddbcpu 1
No such command
ddb> trace
db_read_bytes(ffffffff00000000,1,ffff80001d779ce4) at db_read_bytes+0xe3 sys/arch/amd64/amd64/db_memrw.c:85
db_get_value(ffffffff00000000,1,0) at db_get_value+0x60 sys/ddb/db_access.c:59
db_disasm(ffffffff00000000,0) at db_disasm+0x8f
db_trap(6,0) at db_trap+0x12e sys/ddb/db_trap.c:71
db_ktrap(6,0,ffff80001d779f70) at db_ktrap+0x1b6 sys/arch/amd64/amd64/db_interface.c:149
kerntrap(ffff80001d779f70) at kerntrap+0x129 sys/arch/amd64/amd64/trap.c:293
alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b
end trace frame: 0x0, count: -7
ddb> 

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-openbsd-main 2020/06/13 08:40 openbsd fe9bb68285b7 f4724dd3 .config log report syz
* Struck through repros no longer work on HEAD.