[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v1] x86/domctl: remove impossible condition in XEN_DOMCTL_getpageframeinfo3



On 09/03/18 16:01, Olaf Hering wrote:
> The value of num is always the same as domctl->u.getpageframeinfo3.num,
> it was assigned just a few lines before.
>
> Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

This isn't dead code.  It is a truncation check.

~Andrew

> ---
>  xen/arch/x86/domctl.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
> index 8fbbf3aeb3..46d288a490 100644
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -421,8 +421,7 @@ long arch_do_domctl(
>          /* Games to allow this code block to handle a compat guest. */
>          void __user *guest_handle = domctl->u.getpageframeinfo3.array.p;
>  
> -        if ( unlikely(num > 1024) ||
> -             unlikely(num != domctl->u.getpageframeinfo3.num) )
> +        if ( unlikely(num > 1024) )
>          {
>              ret = -E2BIG;
>              break;


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.