syzbot


uvm_fault: rtable_satoplen (2)

Status: fixed on 2019/04/04 06:33
Reported-by: syzbot+7e4426b400fe6ee4afc1@syzkaller.appspotmail.com
Fix commit: 575ef11475ca Add a more strict rtm_hdrlen size check. Make sure that at least struct rt_msghdr bytes are passed in. Also return a failure from rtm_xaddrs() if rti_addrs has bad flags or run out of space. Ok bluhm@
First crash: 1859d, last: 1850d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
openbsd uvm_fault: rtable_satoplen 158 1859d 1876d 3/3 fixed on 2019/03/22 16:06
openbsd uvm_fault: rtable_satoplen (3) syz 237 1644d 1687d 0/3 closed as invalid on 2020/02/21 15:01

Sample crash report:
login: uvm_fault(0xffffffff82239020, 0xffff800000970002, 0, 1) -> e
kernel: page fault trap, code=0
Stopped at      rtable_satoplen+0x150:  movzbl  0xffffffffffffffff(%r13),%r12d
ddb{0}> 
ddb{0}> set $lines = 0
ddb{0}> set $maxwidth = 0
ddb{0}> show panic
kernel page fault
uvm_fault(0xffffffff82239020, 0xffff800000970002, 0, 1) -> e
rtable_satoplen(21,ffff80000096ff59) at rtable_satoplen+0x150 sys/net/rtable.c:888
end trace frame: 0xffff800020c29890, count: 0
ddb{0}> trace
rtable_satoplen(21,ffff80000096ff59) at rtable_satoplen+0x150 sys/net/rtable.c:888
rtable_lookup(0,ffff80000096ff09,ffff80000096ff59,ffff80000096ff11,21) at rtable_lookup+0xfd sys/net/rtable.c:391
rtm_output(ffff80000096ff00,ffff800020c29980,ffff800020c29988,21,0) at rtm_output+0x1a7 sys/net/rtsock.c:952
route_output(fffffd806b9b8500,fffffd806f73ac00,0,0) at route_output+0x79b sys/net/rtsock.c:806
route_usrreq(fffffd806f73ac00,9,fffffd806b9b8500,0,0,ffff800020b8b2d8) at route_usrreq+0x35d sys/net/rtsock.c:271
sosend(fffffd806f73ac00,0,ffff800020c29c48,0,0,0) at sosend+0x6eb sys/kern/uipc_socket.c:513
sendit(ffff800020b8b2d8,3,ffff800020c29d08,0,ffff800020c29dd0) at sendit+0x590 sys/kern/uipc_syscalls.c:662
sys_sendto(ffff800020b8b2d8,ffff800020c29de8,ffff800020c29dd0) at sys_sendto+0x92
syscall(ffff800020c29e80) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline]
syscall(ffff800020c29e80) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574
Xsyscall(6,0,ffffffffffffffd8,0,6,e82b879a0d8) at Xsyscall+0x128
end of kernel
end trace frame: 0xe854b156250, count: -10
ddb{0}> show registers
rdi                                0
rsi                             0xaa
rbp               0xffff800020c297f0
rbx               0xffffffffffffff5a
rdx               0xffff80000096ff5d
rcx               0xffff800000970003
rax               0xffff800000970003
r8                              0x21
r9                               0x1
r10               0xa52e4aac02df6813
r11               0xada72ae7fd465549
r12                                0
r13               0xffff800000970003
r14               0xffffffff821f6ad0    mplsdomain
r15                              0x4
rip               0xffffffff81657e70    rtable_satoplen+0x150
cs                               0x8
rflags                       0x10287    __ALIGN_SIZE+0xf287
rsp               0xffff800020c297a0
ss                              0x10
rtable_satoplen+0x150:  movzbl  0xffffffffffffffff(%r13),%r12d
ddb{0}> show proc
PROC (syz-executor.1) pid=109220 stat=onproc
    flags process=0 proc=4000000<THREAD>
    pri=50, usrpri=50, nice=20
    forw=0xffffffffffffffff, list=0xffff800020b8b530,0xffffffff823c8d80
    process=0xffff800020b7c018 user=0xffff800020c24000, vmspace=0xfffffd807effd438
    estcpu=0, cpticks=0, pctcpu=0.0
    user=0, sys=0, intr=0
ddb{0}> ps
   PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
 87275  374462  78432      0  2           0                syz-executor.1
 87275  120137  78432      0  3   0x4000080  fsleep        syz-executor.1
*87275  109220  78432      0  7   0x4000000                syz-executor.1
 57511  181023  67338      0  2         0x2                syz-executor.0
 78432   61833  67338      0  3        0x82  nanosleep     syz-executor.1
 67338  465995  95034      0  3        0x82  kqread        syz-execprog
 67338   10017  95034      0  3   0x4000082  nanosleep     syz-execprog
 67338  361246  95034      0  3   0x4000082  thrsleep      syz-execprog
 67338  132938  95034      0  3   0x4000082  thrsleep      syz-execprog
 67338   64974  95034      0  3   0x4000082  thrsleep      syz-execprog
 67338  341388  95034      0  3   0x4000082  thrsleep      syz-execprog
 67338   97732  95034      0  3   0x4000082  thrsleep      syz-execprog
 67338  349843  95034      0  3   0x4000082  thrsleep      syz-execprog
 67338  286084  95034      0  3   0x4000082  thrsleep      syz-execprog
 95034   73743  87733      0  3    0x10008a  pause         ksh
 87733  297291  25133      0  3        0x92  select        sshd
 62041   59578      1      0  3    0x100083  ttyin         getty
 25133  428667      1      0  3        0x80  select        sshd
 28057  317001   3445     74  3    0x100092  bpf           pflogd
  3445  330000      1      0  3        0x80  netio         pflogd
 33769  310516  59352     73  7    0x100090                syslogd
 59352  169789      1      0  3    0x100082  netio         syslogd
 89446  164350      1     77  3    0x100090  poll          dhclient
 13329  519883      1      0  3        0x80  poll          dhclient
 31541  146333      0      0  3     0x14200  pgzero        zerothread
 86089  399325      0      0  3     0x14200  aiodoned      aiodoned
 75377  370726      0      0  3     0x14200  syncer        update
 36301  143798      0      0  3     0x14200  cleaner       cleaner
 30542  278908      0      0  3     0x14200  reaper        reaper
  7770  377567      0      0  3     0x14200  pgdaemon      pagedaemon
 39307  507230      0      0  3     0x14200  bored         crynlk
 26568  314924      0      0  3     0x14200  bored         crypto
 10111  319614      0      0  3  0x40014200  acpi0         acpi0
 29983  219529      0      0  3  0x40014200                idle1
 23811  440674      0      0  3     0x14200  bored         softnet
 10159    5407      0      0  3     0x14200  bored         systqmp
 20811  213260      0      0  3     0x14200  bored         systq
 26466  516458      0      0  3  0x40014200  bored         softclock
 42308  383358      0      0  3  0x40014200                idle0
 25649    3910      0      0  3     0x14200  bored         smr
     1  291544      0      0  3        0x82  wait          init
     0       0     -1      0  3     0x10200  scheduler     swapper
ddb{0}> show all locks
Process 87275 (syz-executor.1) thread 0xffff800020b8b2d8 (109220)
exclusive kernel_lock &kernel_lock r = 1 (0xffffffff82360b08) locked @ /syzkaller/managers/multicore/kernel/sys/scsi/scsi_base.c:256
#0  witness_lock+0x594 sys/kern/subr_witness.c:1201
#1  solock+0x7e sys/kern/uipc_socket2.c:292
#2  sosend+0x586 sys/kern/uipc_socket.c:501
#3  sendit+0x590 sys/kern/uipc_syscalls.c:662
#4  sys_sendto+0x92
#5  syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline]
#5  syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574
#6  Xsyscall+0x128
Process 57511 (syz-executor.0) thread 0xffff800020b04e18 (181023)
exclusive rrwlock inode r = 0 (0xfffffd806cf984e0) locked @ /syzkaller/managers/multicore/kernel/sys/ufs/ufs/ufs_vnops.c:1547
#0  witness_lock+0x594 sys/kern/subr_witness.c:1201
#1  _rw_enter+0x45d sys/kern/kern_rwlock.c:280
#2  _rrw_enter+0x60 sys/kern/kern_rwlock.c:410
#3  VOP_LOCK+0x57 sys/kern/vfs_vops.c:602
#4  vn_lock+0x6e sys/kern/vfs_vnops.c:549
#5  vget+0x1c3 sys/kern/vfs_subr.c:672
#6  ufs_ihashget+0x151 sys/ufs/ufs/ufs_ihash.c:119
#7  ffs_vget+0x84 sys/ufs/ffs/ffs_vfsops.c:1323
#8  ufs_lookup+0x15d3 sys/ufs/ufs/ufs_lookup.c:487
#9  VOP_LOOKUP+0x67 sys/kern/vfs_vops.c:90
#10 vfs_lookup+0x556 sys/kern/vfs_lookup.c:523
#11 namei+0x4b2 sys/kern/vfs_lookup.c:224
#12 dounlinkat+0xa5 sys/kern/vfs_syscalls.c:1673
#13 syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline]
#13 syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574
#14 Xsyscall+0x128
exclusive rrwlock inode r = 0 (0xfffffd806cf983d0) locked @ /syzkaller/managers/multicore/kernel/sys/ufs/ufs/ufs_vnops.c:1547
#0  witness_lock+0x594 sys/kern/subr_witness.c:1201
#1  _rw_enter+0x45d sys/kern/kern_rwlock.c:280
#2  _rrw_enter+0x60 sys/kern/kern_rwlock.c:410
#3  VOP_LOCK+0x57 sys/kern/vfs_vops.c:602
#4  vn_lock+0x6e sys/kern/vfs_vnops.c:549
#5  vfs_lookup+0xf5 sys/kern/vfs_lookup.c:387
#6  namei+0x4b2 sys/kern/vfs_lookup.c:224
#7  dounlinkat+0xa5 sys/kern/vfs_syscalls.c:1673
#8  syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline]
#8  syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574
#9  Xsyscall+0x128
ddb{0}> show malloc
           Type InUse  MemUse  HighUse   Limit  Requests Type Lim Kern Lim
         devbuf  9460   6387K    6387K  78643K     10547        0        0
            pcb    27      9K       9K  78643K       105        0        0
         rtable    98      3K       3K  78643K       225        0        0
         ifaddr    38     10K      10K  78643K        39        0        0
       counters    39     33K      33K  78643K        39        0        0
       ioctlops     0      0K       4K  78643K      1469        0        0
          mount     1      1K       1K  78643K         1        0        0
         vnodes  1167     73K      73K  78643K      1172        0        0
      UFS quota     1     32K      32K  78643K         1        0        0
      UFS mount     5     36K      36K  78643K         5        0        0
            shm     2      1K       1K  78643K         2        0        0
         VM map     2      1K       1K  78643K         2        0        0
            sem     2      0K       0K  78643K         2        0        0
        dirhash    12      2K       2K  78643K        12        0        0
           ACPI  1808    196K     290K  78643K     12628        0        0
      file desc     5     13K      25K  78643K        42        0        0
           proc    52     50K      83K  78643K       319        0        0
    NFS srvsock     1      0K       0K  78643K         1        0        0
     NFS daemon     1     16K      16K  78643K         1        0        0
       in_multi    33      2K       2K  78643K        33        0        0
    ether_multi     1      0K       0K  78643K         1        0        0
    ISOFS mount     1     32K      32K  78643K         1        0        0
  MSDOSFS mount     1     16K      16K  78643K         1        0        0
           ttys    18     79K      79K  78643K        18        0        0
           exec     0      0K       1K  78643K       195        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    74     20K      20K  78643K       991        0        0
       UVM aobj     2      2K       2K  78643K         2        0        0
        memdesc     1      4K       4K  78643K         1        0        0
    crypto data     1      1K       1K  78643K         1        0        0
            NDP    10      0K       0K  78643K        10        0        0
           temp    95   2372K    2436K  78643K      3211        0        0
      SYN cache     2     16K      16K  78643K         2        0        0
ddb{0}> 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
inpcbpl    280       80    0       73     1     0     1     1     0     8    0
plimitpl   152       16    0        8     1     0     1     1     0     8    0
plcache    128       20    0        0     1     0     1     1     0     8    0
rtentry    112       41    0        1     2     0     2     2     0     8    0
syncache   264        5    0        5     2     1     1     1     0     8    1
tcpcb      544       55    0       51     1     0     1     1     0     8    0
nd6         48        4    0        0     1     0     1     1     0     8    0
pfosfp      40      846    0      423     5     0     5     5     0     8    0
pfosfpen   112     1428    0      714    21     0    21    21     0     8    0
pfstitem    24       12    0        6     2     1     1     1     0     8    0
pfstkey    112       12    0        6     2     1     1     1     0     8    0
pfstate    328       12    0        6     2     1     1     1     0     8    0
pfrule     1360      21    0       16     2     1     1     2     0     8    0
art_heap8  4096       1    0        0     1     0     1     1     0     8    0
art_heap4  256      184    0        0    12     0    12    12     0     8    0
art_table   32      185    0        0     2     0     2     2     0     8    0
art_node    16       40    0        6     1     0     1     1     0     8    0
dirhash    1024      17    0        0     3     0     3     3     0     8    0
dino1pl    128     1461    0       43    46     0    46    46     0     8    0
ffsino     272     1461    0       43    95     0    95    95     0     8    0
nchpl      144     1760    0      127    61     0    61    61     0     8    0
uvmvnodes   72     1471    0        0    27     0    27    27     0     8    0
vnodes     200     1471    0        0    78     0    78    78     0     8    0
namei      1024    4431    0     4431     3     2     1     1     0     8    1
percpumem   16       30    0        0     1     0     1     1     0     8    0
scxspl     192     4034    0     4034    49    48     1     6     0     8    1
sigapl     432      245    0      230     3     0     3     3     0     8    1
futexpl     56      358    0      357     1     0     1     1     0     8    0
knotepl    112       45    0       28     1     0     1     1     0     8    0
kqueuepl   104        2    0        0     1     0     1     1     0     8    0
pipepl     112      252    0      233     3     2     1     1     0     8    0
fdescpl    488      246    0      230     3     0     3     3     0     8    0
filepl     152     1386    0     1317     3     0     3     3     0     8    0
lockfpl    104        6    0        6     1     1     0     1     0     8    0
lockfspl    32        3    0        3     1     1     0     1     0     8    0
sessionpl  112       20    0        9     1     0     1     1     0     8    0
pgrppl      48       20    0        9     1     0     1     1     0     8    0
ucredpl     96       52    0       43     1     0     1     1     0     8    0
zombiepl   144      230    0      230     3     2     1     1     0     8    1
processpl  840      261    0      230     4     0     4     4     0     8    0
procpl     600      335    0      294     4     0     4     4     0     8    0
sockpl     384      172    0      151     3     0     3     3     0     8    0
mcl4k      4096       2    0        0     1     0     1     1     0     8    0
mcl2k      2048      56    0        0     7     0     7     7     0     8    0
mtagpl      80        1    0        0     1     0     1     1     0     8    0
mbufpl     256      199    0        0    12     0    12    12     0     8    0
bufpl      256     5371    0     1143   265     0   265   265     0     8    0
anonpl      16    23360    0    21679    16     3    13    13     0   125    6
amapchunkpl 152     881    0      811     5     0     5     5     0   158    1
amappl16   192      172    0      137     2     0     2     2     0     8    0
amappl15   184       72    0       66     1     0     1     1     0     8    0
amappl14   176       28    0       25     3     2     1     1     0     8    0
amappl13   168       31    0       27     1     0     1     1     0     8    0
amappl12   160        9    0        7     2     1     1     1     0     8    0
amappl11   152       54    0       35     1     0     1     1     0     8    0
amappl10   144       72    0       69     1     0     1     1     0     8    0
amappl9    136      425    0      420     1     0     1     1     0     8    0
amappl8    128      129    0      118     1     0     1     1     0     8    0
amappl7    120       28    0       26     1     0     1     1     0     8    0
amappl6    112       84    0       76     1     0     1     1     0     8    0
amappl5    104      127    0      114     1     0     1     1     0     8    0
amappl4     96      488    0      464     2     0     2     2     0     8    1
amappl3     88      123    0      117     1     0     1     1     0     8    0
amappl2     80      956    0      902     2     0     2     2     0     8    0
amappl1     72    15033    0    14589    26     8    18    20     0     8    8
amappl      72      579    0      546     1     0     1     1     0    75    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        1    0        0     1     0     1     1     0     8    0
uaddrrnd    24      246    0      230     1     0     1     1     0     8    0
uaddrbest   32        2    0        0     1     0     1     1     0     8    0
uaddr       24      246    0      230     1     0     1     1     0     8    0
vmmpekpl   168     6789    0     6765     2     0     2     2     0     8    0
vmmpepl    168    32117    0    31148    91    17    74    74     0   357   31
vmsppl     360      245    0      230     2     0     2     2     0     8    0
pdppl      4096     500    0      460     6     0     6     6     0     8    0
pvpl        32   113446    0   109159   111     9   102   102     0   265   67
pmappl     224      245    0      230     2     0     2     2     0     8    1
extentpl    40       39    0       25     1     0     1     1     0     8    0
phpool     112      410    0        5    12     0    12    12     0     8    0

Crashes (101):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/03/25 04:45 openbsd b3dbd5f2ca08 2c86e0a5 .config console log report syz ci-openbsd-multicore
2019/03/31 21:00 openbsd de3d60f82d4f 0c624d4d .config console log report ci-openbsd-multicore
2019/03/31 19:29 openbsd de3d60f82d4f 0c624d4d .config console log report ci-openbsd-main
2019/03/31 11:25 openbsd de3d60f82d4f 0c624d4d .config console log report ci-openbsd-setuid
2019/03/31 09:32 openbsd de3d60f82d4f 0c624d4d .config console log report ci-openbsd-multicore
2019/03/31 03:59 openbsd 4672739ed7b2 0c624d4d .config console log report ci-openbsd-multicore
2019/03/31 00:52 openbsd 4672739ed7b2 0c624d4d .config console log report ci-openbsd-multicore
2019/03/30 17:42 openbsd 67caf7119898 c35ee0ea .config console log report ci-openbsd-main
2019/03/30 14:14 openbsd 67caf7119898 c35ee0ea .config console log report ci-openbsd-setuid
2019/03/30 12:03 openbsd 67caf7119898 c35ee0ea .config console log report ci-openbsd-setuid
2019/03/30 09:29 openbsd 67caf7119898 c35ee0ea .config console log report ci-openbsd-setuid
2019/03/30 06:19 openbsd 20a5560209a4 c35ee0ea .config console log report ci-openbsd-main
2019/03/30 03:39 openbsd 20a5560209a4 c35ee0ea .config console log report ci-openbsd-setuid
2019/03/29 22:46 openbsd 20a5560209a4 c35ee0ea .config console log report ci-openbsd-setuid
2019/03/29 20:11 openbsd 20a5560209a4 c35ee0ea .config console log report ci-openbsd-setuid
2019/03/29 15:49 openbsd 6218530a164e e825006c .config console log report ci-openbsd-main
2019/03/29 11:14 openbsd 6218530a164e e825006c .config console log report ci-openbsd-main
2019/03/29 06:23 openbsd 6218530a164e 14c58f8d .config console log report ci-openbsd-main
2019/03/29 04:17 openbsd 6218530a164e 14c58f8d .config console log report ci-openbsd-main
2019/03/29 01:48 openbsd 3b0d22e75067 14c58f8d .config console log report ci-openbsd-setuid
2019/03/29 00:28 openbsd 7ac074f6b41e 14c58f8d .config console log report ci-openbsd-main
2019/03/28 23:21 openbsd 8423d6adca2c 14c58f8d .config console log report ci-openbsd-multicore
2019/03/28 16:23 openbsd 8423d6adca2c 14c58f8d .config console log report ci-openbsd-multicore
2019/03/28 13:10 openbsd 3b0d22e75067 f94f56fe .config console log report ci-openbsd-setuid
2019/03/28 06:58 openbsd c95a22197bfd f94f56fe .config console log report ci-openbsd-main
2019/03/28 03:14 openbsd c95a22197bfd f94f56fe .config console log report ci-openbsd-multicore
2019/03/27 16:53 openbsd 709e530bc956 70d776a2 .config console log report ci-openbsd-main
2019/03/27 14:17 openbsd 690d147bdb68 70d776a2 .config console log report ci-openbsd-multicore
2019/03/27 12:41 openbsd 709e530bc956 70d776a2 .config console log report ci-openbsd-setuid
2019/03/27 11:30 openbsd 709e530bc956 70d776a2 .config console log report ci-openbsd-main
2019/03/27 10:40 openbsd 709e530bc956 70d776a2 .config console log report ci-openbsd-setuid
2019/03/27 08:56 openbsd ad597a5fc5a3 70d776a2 .config console log report ci-openbsd-setuid
2019/03/27 07:53 openbsd ad597a5fc5a3 55684ce1 .config console log report ci-openbsd-multicore
2019/03/26 23:19 openbsd 6baecefef8fe 55684ce1 .config console log report ci-openbsd-main
2019/03/26 19:46 openbsd 6a51f920f2c9 55684ce1 .config console log report ci-openbsd-main
2019/03/26 18:02 openbsd ad597a5fc5a3 55684ce1 .config console log report ci-openbsd-setuid
2019/03/26 15:12 openbsd 6a51f920f2c9 55684ce1 .config console log report ci-openbsd-main
2019/03/26 14:02 openbsd 6a51f920f2c9 55684ce1 .config console log report ci-openbsd-main
2019/03/26 12:11 openbsd 6a51f920f2c9 55684ce1 .config console log report ci-openbsd-main
2019/03/26 10:09 openbsd 6a51f920f2c9 55684ce1 .config console log report ci-openbsd-setuid
2019/03/26 08:46 openbsd 6a51f920f2c9 55684ce1 .config console log report ci-openbsd-multicore
2019/03/26 06:42 openbsd 6a51f920f2c9 55684ce1 .config console log report ci-openbsd-main
2019/03/26 05:00 openbsd 6a51f920f2c9 55684ce1 .config console log report ci-openbsd-main
2019/03/26 02:41 openbsd 13a73e99f6f8 52a20ba4 .config console log report ci-openbsd-setuid
2019/03/22 21:01 openbsd 9c1f1fecff88 028c0951 .config console log report ci-openbsd-multicore
* Struck through repros no longer work on HEAD.