lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 02 Sep 2013 14:25:22 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:	linux-acpi@...r.kernel.org,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	Imre Kaloz <kaloz@...nwrt.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ACPI / LPSS: don't crash if a device has no MMIO resources

On Monday, September 02, 2013 01:30:25 PM Mika Westerberg wrote:
> Intel LPSS devices that are enumerated from ACPI have both MMIO and IRQ
> resources returned in their _CRS method. However, Apple Macbook Air with
> Haswell has LPSS devices enumerated from PCI bus instead and _CRS method
> returns only an interrupt number (but the device has _HID set that causes
> the scan handler to match it).
> 
> The current ACPI / LPSS code sets pdata->dev_desc only when MMIO resource
> is found for the device and in case of Macbook Air it is never found. That
> leads to a NULL pointer dereference in register_device_clock().
> 
> Correct this by always setting the pdata->dev_desc.
> 
> Reported-and-tested-by: Imre Kaloz <kaloz@...nwrt.org>
> Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
> Cc: stable@...r.kernel.org # 3.10+

Queued up for 3.12, thanks for taking care of this Mika!

> ---
>  drivers/acpi/acpi_lpss.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index 6a38218..fb78bb9 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -257,12 +257,13 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
>  				pdata->mmio_size = resource_size(&rentry->res);
>  			pdata->mmio_base = ioremap(rentry->res.start,
>  						   pdata->mmio_size);
> -			pdata->dev_desc = dev_desc;
>  			break;
>  		}
>  
>  	acpi_dev_free_resource_list(&resource_list);
>  
> +	pdata->dev_desc = dev_desc;
> +
>  	if (dev_desc->clk_required) {
>  		ret = register_device_clock(adev, pdata);
>  		if (ret) {
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ