[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080527080030.GC29246@elte.hu>
Date: Tue, 27 May 2008 10:00:30 +0200
From: Ingo Molnar <mingo@...e.hu>
To: mikukkon@....fi
Cc: linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
arjan@...ux.intel.com, Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH 2.6.26-rc4] Fix nesting error checking in
arch/x86/mm/ioremap.c
* Mika Kukkonen <mikukkon@...1-m700-lanp.koti> wrote:
> 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);
> + }
the better fix would be to turn 'nesting' into an int, hm?
Also, instead of forcing nesting to 0, it is better to just return - as
we cannot do any sane unmap here anymore. (we are unbalanced)
I.e. something like the fix below?
Ingo
------------------------------>
Subject: ioremap: nesting fix
From: Ingo Molnar <mingo@...e.hu>
Date: Tue May 27 09:56:49 CEST 2008
Mika Kukkonen noticed that the nesting check in early_iounmap() is not
actually done.
Reported-by: Mika Kukkonen <mikukkon@...1-m700-lanp.koti>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
arch/x86/mm/ioremap.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: linux/arch/x86/mm/ioremap.c
===================================================================
--- linux.orig/arch/x86/mm/ioremap.c
+++ linux/arch/x86/mm/ioremap.c
@@ -602,10 +602,11 @@ void __init early_iounmap(void *addr, un
unsigned long offset;
unsigned int nrpages;
enum fixed_addresses idx;
- unsigned int nesting;
+ int nesting;
nesting = --early_ioremap_nested;
- WARN_ON(nesting < 0);
+ if (WARN_ON(nesting < 0))
+ return;
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