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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 11 Jan 2011 16:40:24 +0000
From:	Jamie Iles <jamie@...ieiles.com>
To:	Aaro Koskinen <aaro.koskinen@...ia.com>
Cc:	Jamie Iles <jamie@...ieiles.com>, linux-kernel@...r.kernel.org,
	Omar Ramirez Luna <omar.ramirez@...com>,
	Greg Kroah-Hartman <gregkh@...e.de>
Subject: Re: [PATCH 07/16] staging: tidspbridge: don't treat NULL clk as an
 error

Hi Aaro,

On Tue, Jan 11, 2011 at 05:50:06PM +0200, Aaro Koskinen wrote:
> On Tue, 11 Jan 2011, Jamie Iles wrote:
[...]
> >#include <dspbridge/dbdefs.h>
> >@@ -60,15 +61,15 @@ int dsp_wdt_init(void)
> >
> >	dsp_wdt.fclk = clk_get(NULL, "wdt3_fck");
> >
> >-	if (dsp_wdt.fclk) {
> >+	if (!IS_ERR(dsp_wdt.fclk)) {
> >		dsp_wdt.iclk = clk_get(NULL, "wdt3_ick");
> >-		if (!dsp_wdt.iclk) {
> >+		if (IS_ERR(dsp_wdt.iclk)) {
> >			clk_put(dsp_wdt.fclk);
> >			dsp_wdt.fclk = NULL;
> >-			ret = -EFAULT;
> >+			ret = PTR_ERR(dsp_wdt.iclk);
> >		}
> >	} else
> >-		ret = -EFAULT;
> >+		ret = PTR_ERR(dsp_wdt.fclk);
> 
> There are also other places in this driver where dsp_wdt.[if]clk is
> checked against NULL, so this change alone is not sufficient.

Yes, you're quite right.

On closer inspection it looks to me like the error handling in 
drivers/staging/tidspbridge/io_sm.c::bridge_io_create needs to be fixed 
up first otherwise we can end up calling dsp_wdt_exit() through 
bridge_io_destroy() without the contents of dsp_wdt being coherently 
initialized (there are also failure paths where the wdt irq and tasklet 
can be freed/killed without first being setup).

Jamie
--
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