Re: [PATCH] xen/acpi: off by one in read_acpi_id()

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

 



On 03/28/2018 12:47 PM, Dan Carpenter wrote:
> 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_cst_present);
> 
... or even acpi_id_present (which comes right after the condition you're fixing).

> Fixes: 59a568029181 ("xen/acpi-processor: C and P-state driver that uploads said data to hypervisor.")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
FWIW,

Reviewed-by: Joao Martins <joao.m.martins@xxxxxxxxxx>

> diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
> index c80195e8fbd1..d23c9c150199 100644
> --- a/drivers/xen/xen-acpi-processor.c
> +++ b/drivers/xen/xen-acpi-processor.c
> @@ -364,7 +364,7 @@ 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) {
> +	if (acpi_id >= nr_acpi_bits) {
>  		pr_debug("We only have %u, trying to set %u\n",
>  			 nr_acpi_bits, acpi_id);
>  		return AE_OK;
> 
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux