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

Re: [Xen-devel] [PATCH] ACPI: fix return value of XEN_PM_PDC platform op


  • To: Jan Beulich <JBeulich@xxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Wed, 28 Nov 2012 08:28:44 +0000
  • Delivery-date: Wed, 28 Nov 2012 08:30:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac3NQmDZbQj9QKJ4KEeBhCsdOZo1EQ==
  • Thread-topic: [Xen-devel] [PATCH] ACPI: fix return value of XEN_PM_PDC platform op

On 28/11/2012 07:44, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> Should return -EFAULT when copying to guest memory fails.
> 
> Once touching this code, also switch to using the more relaxed copy
> function (copying from the same guest memory already validated the
> virtual address range).
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Keir Fraser <keir@xxxxxxx>

> --- a/xen/drivers/acpi/pmstat.c
> +++ b/xen/drivers/acpi/pmstat.c
> @@ -521,8 +521,8 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_G
>                      ACPI_PDC_SMP_C1PT) & ~mask;
>          ret = arch_acpi_set_pdc_bits(acpi_id, bits, mask);
>      }
> -    if ( !ret )
> -        ret = copy_to_guest_offset(pdc, 2, bits + 2, 1);
> +    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, 1) )
> +        ret = -EFAULT;
>  
>      return ret;
>  }
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel



_______________________________________________
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®.