]> xenbits.xensource.com Git - xen.git/commit
xen/mm: make sure node is less than MAX_NUMNODES
authorGeorge Dunlap <george.dunlap@citrix.com>
Tue, 12 Sep 2017 13:12:56 +0000 (15:12 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Sep 2017 13:12:56 +0000 (15:12 +0200)
commit629eddde2b6d23a08cf2fa3fb7a80399e8dbb96c
treed6b4388ae503db948c98cccb780a50c7aa26f04f
parent64c03bbacfb099f464c0fe0850ece71d4007d0ea
xen/mm: make sure node is less than MAX_NUMNODES

The output of MEMF_get_node(memflags) can be as large as nodeid_t can
hold (currently 255).  This is then used as an index to arrays of size
MAX_NUMNODE, which is 64 on x86 and 1 on ARM, can be passed in by an
untrusted guest (via memory_exchange and increase_reservation) and is
not currently bounds-checked.

Check the value in page_alloc.c before using it, and also check the
value in the hypercall call sites and return -EINVAL if appropriate.
Don't permit domains other than the hardware or control domain to
allocate node-constrained memory.

This is CVE-2017-14316 / XSA-231.

Reported-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 2fece35303529395bfea6b03d2268380ef682c93
master date: 2017-09-12 14:43:16 +0200
xen/common/memory.c
xen/common/page_alloc.c