|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] ACPI: fix return value of XEN_PM_PDC platform op
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1354093431 -3600
# Node ID 5faf5b8b702e0c7ad9f362dcde3ee41d950f66b7
# Parent 7670eabcbafc7251c336550cd7ce3ea4078a36b9
ACPI: fix return value of XEN_PM_PDC platform op
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>
---
diff -r 7670eabcbafc -r 5faf5b8b702e xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c Wed Nov 28 10:02:26 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c Wed Nov 28 10:03:51 2012 +0100
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |