]> xenbits.xensource.com Git - xen.git/commit
memory: properly check guest memory ranges in XENMEM_exchange handling
authorJan Beulich <jbeulich@suse.com>
Tue, 4 Apr 2017 12:55:00 +0000 (14:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 4 Apr 2017 12:55:00 +0000 (14:55 +0200)
commit06403aa5f28bf697051de0435ef942f4c0d25849
tree71f3321532ce425046a1dfdd1c52b993758e0139
parentf3623bdbe5f7ff63e728865a8b986b2312231685
memory: properly check guest memory ranges in XENMEM_exchange handling

The use of guest_handle_okay() here (as introduced by the XSA-29 fix)
is insufficient here, guest_handle_subrange_okay() needs to be used
instead.

Note that the uses are okay in
- XENMEM_add_to_physmap_batch handling due to the size field being only
  16 bits wide,
- livepatch_list() due to the limit of 1024 enforced on the
  number-of-entries input (leaving aside the fact that this can be
  called by a privileged domain only anyway),
- compat mode handling due to counts there being limited to 32 bits,
- everywhere else due to guest arrays being accessed sequentially from
  index zero.

This is CVE-2017-7228 / XSA-212.

Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 938fd2586eb081bcbd694f4c1f09ae6a263b0d90
master date: 2017-04-04 14:47:46 +0200
xen/common/memory.c
xen/include/asm-x86/x86_64/uaccess.h