]> 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:06:05 +0000 (15:06 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Sep 2017 13:06:05 +0000 (15:06 +0200)
commit90dafa46ea8e9e9a433b18fdf867d99606ea75a2
tree9e903b35dd8a34232d351bc2458a2e660559580d
parentc020cf2ec0f333f3e20cef4c3eb8339edff194bd
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