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

Re: [Xen-devel] [Patch v2 1/4] common/sysctl: Don't leak status in SYSCTL_page_offline_op


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Fri, 17 Jan 2014 17:59:12 +0000
  • Cc: Jan Beulich <JBeulich@xxxxxxxx>
  • Delivery-date: Fri, 17 Jan 2014 18:00:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac8TrdPB52RuskKr1kSEqrp1gqIE9A==
  • Thread-topic: [Xen-devel] [Patch v2 1/4] common/sysctl: Don't leak status in SYSCTL_page_offline_op

On 07/01/2014 11:59, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx> wrote:

> In addition, 'copyback' should be cleared even in the error case.
> 
> Also fix the indentation of the arguments to copy_to_guest() to help clarify
> that the 'ret = -EFAULT' is not part of the condition.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> CC: Keir Fraser <keir@xxxxxxx>
> CC: Jan Beulich <JBeulich@xxxxxxxx>

Acked-by: Keir Fraser <keir@xxxxxxx>

> ---
> 
> Changes in v2:
>  * Still clear copyback even in the error case.
> ---
>  xen/common/sysctl.c |    7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
> index 117e095..0cb6ee1 100644
> --- a/xen/common/sysctl.c
> +++ b/xen/common/sysctl.c
> @@ -230,12 +230,9 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t)
> u_sysctl)
>          }
>  
>          if ( copy_to_guest(
> -            op->u.page_offline.status, status,
> -            op->u.page_offline.end - op->u.page_offline.start + 1) )
> -        {
> +                 op->u.page_offline.status, status,
> +                 op->u.page_offline.end - op->u.page_offline.start + 1) )
>              ret = -EFAULT;
> -            break;
> -        }
>  
>          xfree(status);
>          copyback = 0;



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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