25 lines
824 B
Diff
25 lines
824 B
Diff
|
# HG changeset patch
|
||
|
# User Keir Fraser <keir@xen.org>
|
||
|
# Date 1307689724 -3600
|
||
|
# Node ID 5a557fda70a99d287735b53957e865c8dac0e351
|
||
|
# Parent c34604d5a29336d902837542b915d3b09b27a361
|
||
|
x86: Fix argument checking in (privileged) function cpu_add().
|
||
|
|
||
|
Thanks to John McDermott <john.mcdermott@nrl.navy.mil> for spotting.
|
||
|
|
||
|
Signed-off-by: Keir Fraser <keir@xen.org>
|
||
|
|
||
|
--- a/xen/arch/x86/smpboot.c
|
||
|
+++ b/xen/arch/x86/smpboot.c
|
||
|
@@ -899,7 +899,9 @@ int cpu_add(uint32_t apic_id, uint32_t a
|
||
|
dprintk(XENLOG_DEBUG, "cpu_add apic_id %x acpi_id %x pxm %x\n",
|
||
|
apic_id, acpi_id, pxm);
|
||
|
|
||
|
- if ( acpi_id > MAX_MADT_ENTRIES || apic_id > MAX_APICS || pxm > 256 )
|
||
|
+ if ( (acpi_id >= MAX_MADT_ENTRIES) ||
|
||
|
+ (apic_id >= MAX_APICS) ||
|
||
|
+ (pxm >= 256) )
|
||
|
return -EINVAL;
|
||
|
|
||
|
if ( !cpu_hotplug_begin() )
|