exploit the possibilities

Xen xen-netback xenvif_set_hash_mapping Integer Overflow

Xen xen-netback xenvif_set_hash_mapping Integer Overflow
Posted Aug 17, 2018
Authored by FX, Google Security Research

Xen suffers from an integer overflow vulnerability in xen-netback xenvif_set_hash_mapping.

tags | advisory, overflow
MD5 | 056a37f9c265e3d9566b012c2ea95423

Xen xen-netback xenvif_set_hash_mapping Integer Overflow

Change Mirror Download
Xen: integer overflow in xen-netback xenvif_set_hash_mapping 




The xen-netback linux kernel module is the default backend for Xen's virtual network devices. Since commit <a href="https://crrev.com/40d8abdee806d496a60ee607a6d01b1cd7fabaf0" title="" class="" rel="nofollow">40d8abdee806d496a60ee607a6d01b1cd7fabaf0</a> the backend supports an additional control protocol described in (include/xen/interface/io/netif.h) to enable
receive side scaling (RSS) for Windows guests.

When a guest sends a control request with the type XEN_NETIF_CTRL_TYPE_SET_HASH_MAPPING to the backend, the function xenvif_set_hash_mapping is called with guest controlled values in gref, off and len:

u32 xenvif_set_hash_mapping(struct xenvif *vif, u32 gref, u32 len,
u32 off)
{
u32 *mapping = &vif->hash.mapping[off];
struct gnttab_copy copy_op = {
.source.u.ref = gref,
.source.domid = vif->domid,
.dest.u.gmfn = virt_to_gfn(mapping),
.dest.domid = DOMID_SELF,
.dest.offset = xen_offset_in_page(mapping),
.len = len * sizeof(u32),
.flags = GNTCOPY_source_gref
};

(A) if ((off + len > vif->hash.size) || copy_op.len > XEN_PAGE_SIZE)
return XEN_NETIF_CTRL_STATUS_INVALID_PARAMETER;

(B) while (len-- != 0)
if (mapping[off++] >= vif->num_queues)
return XEN_NETIF_CTRL_STATUS_INVALID_PARAMETER;

if (copy_op.len != 0) {
(C) gnttab_batch_copy(&copy_op, 1);

if (copy_op.status != GNTST_okay)
return XEN_NETIF_CTRL_STATUS_INVALID_PARAMETER;
}

return XEN_NETIF_CTRL_STATUS_SUCCESS;
}

A malicious guest can trigger an integer overflow for off + len and bypass the
check at (A). This leads to OOB read access in (B) and might be turned into a controlled
OOB write in dom0 when reaching (C)








Found by: fwilhelm

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    16 Files
  • 2
    May 2nd
    8 Files
  • 3
    May 3rd
    8 Files
  • 4
    May 4th
    2 Files
  • 5
    May 5th
    1 Files
  • 6
    May 6th
    15 Files
  • 7
    May 7th
    22 Files
  • 8
    May 8th
    16 Files
  • 9
    May 9th
    17 Files
  • 10
    May 10th
    16 Files
  • 11
    May 11th
    3 Files
  • 12
    May 12th
    4 Files
  • 13
    May 13th
    25 Files
  • 14
    May 14th
    24 Files
  • 15
    May 15th
    78 Files
  • 16
    May 16th
    16 Files
  • 17
    May 17th
    12 Files
  • 18
    May 18th
    2 Files
  • 19
    May 19th
    1 Files
  • 20
    May 20th
    2 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close