Re: [Xen-devel] [PATCH 4/6] sysctl: use xmalloc_array() for XEN_SYSCTL_page_offline_op

2020-02-05 Thread Julien Grall
Hi Jan, On 05/02/2020 16:38, Jan Beulich wrote: On 05.02.2020 15:34, Julien Grall wrote: On 05/02/2020 13:16, Jan Beulich wrote: This is more robust than the raw xmalloc_bytes(). Also add a sanity check on the input page range. It feels to me that the commit message/title should focus on

Re: [Xen-devel] [PATCH 4/6] sysctl: use xmalloc_array() for XEN_SYSCTL_page_offline_op

2020-02-05 Thread Jan Beulich
On 05.02.2020 15:34, Julien Grall wrote: > On 05/02/2020 13:16, Jan Beulich wrote: >> This is more robust than the raw xmalloc_bytes(). >> >> Also add a sanity check on the input page range. > > It feels to me that the commit message/title should focus on the sanity > check. The xmalloc_array()

Re: [Xen-devel] [PATCH 4/6] sysctl: use xmalloc_array() for XEN_SYSCTL_page_offline_op

2020-02-05 Thread Julien Grall
Hi Jan, On 05/02/2020 13:16, Jan Beulich wrote: This is more robust than the raw xmalloc_bytes(). Also add a sanity check on the input page range. It feels to me that the commit message/title should focus on the sanity check. The xmalloc_array() is just a cleanup is "less important".

[Xen-devel] [PATCH 4/6] sysctl: use xmalloc_array() for XEN_SYSCTL_page_offline_op

2020-02-05 Thread Jan Beulich
This is more robust than the raw xmalloc_bytes(). Also add a sanity check on the input page range. Signed-off-by: Jan Beulich --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -187,13 +187,17 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe uint32_t *status, *ptr; mfn_t mfn;