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:	Tue, 19 Oct 2010 01:25:02 +0200
From:	Samuel Ortiz <sameo@...ux.intel.com>
To:	Brian Harring <ferringb@...il.com>
Cc:	linux-kernel@...r.kernel.org, richard.rojfors@...agicore.com
Subject: Re: [PATCH] add platform_data only if non NULL

Hi Brian,

On Sun, Oct 03, 2010 at 06:50:56PM -0700, Brian Harring wrote:
> If a NULL or 0 size platform_data is added, the underlying dup results in a pointer into nullspace- meaning drivers can't do null checks for platform_data.
> 
> This fixes an oops during probing for drivers/net/ks8842, and drivers/mmc/host/sdhci-pltform when the mfd is timberdale
> 
Patch applied, without the paranoid setting :) Many thanks.

Cheers,
Samuel.


> Signed-off-by: Brian Harring <ferringb@...il.com>
> ---
>  drivers/mfd/mfd-core.c |   13 +++++++++----
>  1 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
> index 1823a57..eee73a8 100644
> --- a/drivers/mfd/mfd-core.c
> +++ b/drivers/mfd/mfd-core.c
> @@ -38,10 +38,15 @@ static int mfd_add_device(struct device *parent, int id,
>  	pdev->dev.parent = parent;
>  	platform_set_drvdata(pdev, cell->driver_data);
>  
> -	ret = platform_device_add_data(pdev,
> -			cell->platform_data, cell->data_size);
> -	if (ret)
> -		goto fail_res;
> +	if (cell->data_size) {
> +		ret = platform_device_add_data(pdev,
> +				cell->platform_data, cell->data_size);
> +		if (ret)
> +			goto fail_res;
> +	} else {
> +		/* potentially nulled already, just being paranoid. */
> +		pdev->dev.platform_data = NULL;
> +	}
>  
>  	for (r = 0; r < cell->num_resources; r++) {
>  		res[r].name = cell->resources[r].name;
> -- 
> 1.7.2
> 



-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
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