Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
xen.6649
5a1d5350-improve-xatpb-address-checking.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5a1d5350-improve-xatpb-address-checking.patch of Package xen.6649
# Commit 7f080956e9eed821fd42013bef11c1a2873fbeba # Date 2017-11-28 13:15:12 +0100 # Author Jan Beulich <jbeulich@suse.com> # Committer Jan Beulich <jbeulich@suse.com> improve XENMEM_add_to_physmap_batch address checking As a follow-up to XSA-212 we should have addressed a similar issue here: The handles being advanced at the top of xenmem_add_to_physmap_batch() means we allow hypervisor space accesses (in particular, for "errs", writes) with suitably crafted input arguments. This isn't a security issue in this case because of the limited width of struct xen_add_to_physmap_batch's size field: It being 16-bits wide, only the r/o M2P area can be accessed. Still we can and should do better. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com> --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -774,6 +774,11 @@ static int xenmem_add_to_physmap_batch(s guest_handle_add_offset(xatpb->errs, start); xatpb->size -= start; + if ( !guest_handle_okay(xatpb->idxs, xatpb->size) || + !guest_handle_okay(xatpb->gpfns, xatpb->size) || + !guest_handle_okay(xatpb->errs, xatpb->size) ) + return -EFAULT; + while ( xatpb->size > done ) { xen_ulong_t idx; @@ -1092,10 +1097,7 @@ long do_memory_op(unsigned long cmd, XEN if ( start_extent != (typeof(xatpb.size))start_extent ) return -EDOM; - if ( copy_from_guest(&xatpb, arg, 1) || - !guest_handle_okay(xatpb.idxs, xatpb.size) || - !guest_handle_okay(xatpb.gpfns, xatpb.size) || - !guest_handle_okay(xatpb.errs, xatpb.size) ) + if ( copy_from_guest(&xatpb, arg, 1) ) return -EFAULT; /* This mapspace is unsupported for this hypercall. */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor