diff options
| author | Dan Carpenter <[email protected]> | 2018-03-29 09:01:53 +0000 |
|---|---|---|
| committer | Boris Ostrovsky <[email protected]> | 2018-03-30 15:30:13 +0000 |
| commit | c37a3c94775855567b90f91775b9691e10bd2806 (patch) | |
| tree | ffec56d7af62bc785c7346f201759934dee0a784 /drivers/xen/xen-acpi-processor.c | |
| parent | xen/acpi: upload _PSD info for non Dom0 CPUs too (diff) | |
| download | kernel-c37a3c94775855567b90f91775b9691e10bd2806.tar.gz kernel-c37a3c94775855567b90f91775b9691e10bd2806.zip | |
xen/acpi: off by one in read_acpi_id()
If acpi_id is == nr_acpi_bits, then we access one element beyond the end
of the acpi_psd[] array or we set one bit beyond the end of the bit map
when we do __set_bit(acpi_id, acpi_id_present);
Fixes: 59a568029181 ("xen/acpi-processor: C and P-state driver that uploads said data to hypervisor.")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Joao Martins <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Signed-off-by: Boris Ostrovsky <[email protected]>
Diffstat (limited to 'drivers/xen/xen-acpi-processor.c')
| -rw-r--r-- | drivers/xen/xen-acpi-processor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c index c80195e8fbd1..b29f4e40851f 100644 --- a/drivers/xen/xen-acpi-processor.c +++ b/drivers/xen/xen-acpi-processor.c @@ -364,9 +364,9 @@ read_acpi_id(acpi_handle handle, u32 lvl, void *context, void **rv) } /* There are more ACPI Processor objects than in x2APIC or MADT. * This can happen with incorrect ACPI SSDT declerations. */ - if (acpi_id > nr_acpi_bits) { - pr_debug("We only have %u, trying to set %u\n", - nr_acpi_bits, acpi_id); + if (acpi_id >= nr_acpi_bits) { + pr_debug("max acpi id %u, trying to set %u\n", + nr_acpi_bits - 1, acpi_id); return AE_OK; } /* OK, There is a ACPI Processor object */ |
