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-next>] [day] [month] [year] [list]
Message-ID: <4B781E05.9040502@gmail.com>
Date:	Sun, 14 Feb 2010 17:00:05 +0100
From:	Roel Kluin <roel.kluin@...il.com>
To:	paul@...an.com, Andrew Morton <akpm@...ux-foundation.org>,
	linux-omap@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] OMAP: Dereference of NULL autodep in _autodep_lookup()

Don't dereference autodep when it's NULL. In _autodep_lookup() an
ERR_PTR(-ENOENT) is assigned to autodep->pwrdm.ptr if pwrdm_lookup() fails.

Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---

Alternatively we could do:

-		for (autodep = autodeps; autodep->pwrdm.ptr; autodep++)
+		for (autodep = autodeps; !IS_ERR(autodep->pwrdm.ptr); autodep++)

...but considering how _clkdm_add_autodeps() traverses trough the autodeps it
appears that we want to ignore failures. Correct?

Roel

diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index dd285f0..8f359c1 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -64,9 +64,6 @@ static void _autodep_lookup(struct clkdm_pwrdm_autodep *autodep)
 {
 	struct powerdomain *pwrdm;
 
-	if (!autodep)
-		return;
-
 	if (!omap_chip_is(autodep->omap_chip))
 		return;
 
@@ -211,7 +208,7 @@ void clkdm_init(struct clockdomain **clkdms,
 
 	autodeps = init_autodeps;
 	if (autodeps)
-		for (autodep = autodeps; autodep->pwrdm.ptr; autodep++)
+		for (autodep = autodeps; autodep; autodep++)
 			_autodep_lookup(autodep);
 }
 
--
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