> -----Original Message-----
> From: Andrew Cooper <[email protected]>
> Sent: 28 July 2020 12:37
> To: Xen-devel <[email protected]>
> Cc: Andrew Cooper <[email protected]>; George Dunlap 
> <[email protected]>; Ian
> Jackson <[email protected]>; Jan Beulich <[email protected]>; Konrad 
> Rzeszutek Wilk
> <[email protected]>; Stefano Stabellini <[email protected]>; Wei 
> Liu <[email protected]>; Julien
> Grall <[email protected]>; Paul Durrant <[email protected]>; Michał Leszczyński 
> <[email protected]>;
> Hubert Jasudowicz <[email protected]>
> Subject: [PATCH 3/5] xen/memory: Fix compat XENMEM_acquire_resource for size 
> requests
> 
> Copy the nr_frames from the correct structure, so the caller doesn't
> unconditionally receive 0.
> 
> Signed-off-by: Andrew Cooper <[email protected]>

Reviewed-by: Paul Durrant <[email protected]>

> ---
> CC: George Dunlap <[email protected]>
> CC: Ian Jackson <[email protected]>
> CC: Jan Beulich <[email protected]>
> CC: Konrad Rzeszutek Wilk <[email protected]>
> CC: Stefano Stabellini <[email protected]>
> CC: Wei Liu <[email protected]>
> CC: Julien Grall <[email protected]>
> CC: Paul Durrant <[email protected]>
> CC: Michał Leszczyński <[email protected]>
> CC: Hubert Jasudowicz <[email protected]>
> ---
>  xen/common/compat/memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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
> --
> 2.11.0



Reply via email to