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]
Message-Id: <20090112.215202.194850308.davem@davemloft.net>
Date:	Mon, 12 Jan 2009 21:52:02 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	florian@...nwrt.org
Cc:	jeff@...zik.org, netdev@...r.kernel.org, n0-1@...ewrt.org
Subject: Re: [PATCH] korina: fix probing crash

From: Florian Fainelli <florian@...nwrt.org>
Date: Sun, 11 Jan 2009 16:54:24 +0100

> korina: fix probing crash
> 
> This patch fixes the wrong retrieval of platform_data
> which makes the driver crash on probe. Propagate error
> if the platform_driver cannot use its data.
> 
> Signed-off-by: Florian Fainelli <florian@...nwrt.org>

There are several problems with this patch:

> @@ -1078,12 +1078,18 @@ static int korina_close(struct net_device *dev)
>  
>  static int korina_probe(struct platform_device *pdev)
>  {
> -	struct korina_device *bif = platform_get_drvdata(pdev);
> +	struct korina_device *bif;
>  	struct korina_private *lp;
>  	struct net_device *dev;
>  	struct resource *r;
>  	int rc;
>  
> +	bif = (struct korina_device *)pdev->dev.platform_data;

This cast is unnecessary, platform_data is "void *"

Secondly, korina_remove() also expects the korina_device pointer to be
in the platform drvdata.  It therefore has the same bug as
korina_probe() and needs to be fixed too.

But I suspect there is some other weird problem here.  If
you need to change from drvdata over to platform_data, then
this driver never could have been probed or removed properly.

This is absolutely a fundamental bug, where did it come from?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ