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, 16 Jun 2014 18:23:48 +0100
From:	Lee Jones <lee.jones@...aro.org>
To:	Sachin Kamat <sachin.kamat@...aro.org>
Cc:	linux-kernel@...r.kernel.org, sameo@...ux.intel.com,
	spk.linux@...il.com
Subject: Re: [PATCH Resend] mfd: asic3: Fix potential null pointer dereference

On Tue, 10 Jun 2014, Sachin Kamat wrote:

> We previously assumed 'mem_sdio' could be null but it is
> dereferenced in ioremap(). Add a check to avoid a potential
> null pointer dereference error.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@...aro.org>
> ---
>  drivers/mfd/asic3.c |   12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
> index 9f6294f2a070..9fc4186d4132 100644
> --- a/drivers/mfd/asic3.c
> +++ b/drivers/mfd/asic3.c
> @@ -899,13 +899,15 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
>  	ds1wm_resources[0].end   >>= asic->bus_shift;
>  
>  	/* MMC */
> -	asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> asic->bus_shift) +
> +	if (mem_sdio) {
> +		asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> asic->bus_shift) +
>  				 mem_sdio->start,
>  				 ASIC3_SD_CONFIG_SIZE >> asic->bus_shift);
> -	if (!asic->tmio_cnf) {
> -		ret = -ENOMEM;
> -		dev_dbg(asic->dev, "Couldn't ioremap SD_CONFIG\n");
> -		goto out;
> +		if (!asic->tmio_cnf) {
> +			ret = -ENOMEM;
> +			dev_dbg(asic->dev, "Couldn't ioremap SD_CONFIG\n");
> +			goto out;
> +		}
>  	}
>  	asic3_mmc_resources[0].start >>= asic->bus_shift;
>  	asic3_mmc_resources[0].end   >>= asic->bus_shift;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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