From: Andrew Cooper Date: Tue, 28 Jul 2020 10:23:54 +0000 (+0100) Subject: xen/memory: Fix compat XENMEM_acquire_resource for size requests X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~1161 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=414be7b66349e7dca42bc1fd47c2b2f5b2d27432;p=xen.git xen/memory: Fix compat XENMEM_acquire_resource for size requests Copy the nr_frames from the structure which actually has the correct value, so the caller doesn't unconditionally receive 0. Signed-off-by: Andrew Cooper Reviewed-by: Paul Durrant --- diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c index 3851f756c7..ed92e05b08 100644 --- a/xen/common/compat/memory.c +++ b/xen/common/compat/memory.c @@ -599,7 +599,7 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat) if ( __copy_field_to_guest( guest_handle_cast(compat, compat_mem_acquire_resource_t), - &cmp.mar, nr_frames) ) + nat.mar, nr_frames) ) return -EFAULT; } else