Skip to content

Commit c37a3c9

Browse files
Dan CarpenterBoris Ostrovsky
authored andcommitted
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: 59a5680 ("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]>
1 parent 4d0f1ce commit c37a3c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/xen/xen-acpi-processor.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,9 @@ read_acpi_id(acpi_handle handle, u32 lvl, void *context, void **rv)
364364
}
365365
/* There are more ACPI Processor objects than in x2APIC or MADT.
366366
* This can happen with incorrect ACPI SSDT declerations. */
367-
if (acpi_id > nr_acpi_bits) {
368-
pr_debug("We only have %u, trying to set %u\n",
369-
nr_acpi_bits, acpi_id);
367+
if (acpi_id >= nr_acpi_bits) {
368+
pr_debug("max acpi id %u, trying to set %u\n",
369+
nr_acpi_bits - 1, acpi_id);
370370
return AE_OK;
371371
}
372372
/* OK, There is a ACPI Processor object */

0 commit comments

Comments
 (0)