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: <20080527054930.GA2488@srv1-m700-lanp.koti>
Date:	Tue, 27 May 2008 08:49:32 +0300
From:	Mika Kukkonen <mikukkon@...1-m700-lanp.koti>
To:	linux-kernel@...r.kernel.org
Cc:	torvalds@...ux-foundation.org, arjan@...ux.intel.com
Subject: [PATCH 2.6.26-rc4] Fix nesting error checking in
	arch/x86/mm/ioremap.c

The discussion about latest -rc reminded me of this patch (probably
unrelated but anyway). With "-Wextra" I get following warning:

  CC      arch/x86/mm/ioremap.o
arch/x86/mm/ioremap.c: In function 'early_iounmap':
arch/x86/mm/ioremap.c:599: warning: comparison of unsigned expression < 0 is always false

Following patch avoids potential underflow and actually does the WARN().

Signed-off-by: Mika Kukkonen <mikukkon@....fi>

---

 arch/x86/mm/ioremap.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 71bb315..78667f4 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -595,8 +595,12 @@ void __init early_iounmap(void *addr, unsigned long size)
 	enum fixed_addresses idx;
 	unsigned int nesting;
 
-	nesting = --early_ioremap_nested;
-	WARN_ON(nesting < 0);
+	if (early_ioremap_nested)
+		nesting = --early_ioremap_nested;
+	else { 
+		nesting = 0;
+		WARN_ON(1);
+	}
 
 	if (early_ioremap_debug) {
 		printk(KERN_INFO "early_iounmap(%p, %08lx) [%d]\n", addr,
--
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