From: Ingo Molnar <mingo@elte.hu>
To: mikukkon@iki.fi
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
arjan@linux.intel.com, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH 2.6.26-rc4] Fix nesting error checking in arch/x86/mm/ioremap.c
Date: Tue, 27 May 2008 10:00:30 +0200 [thread overview]
Message-ID: <20080527080030.GC29246@elte.hu> (raw)
In-Reply-To: <20080527054930.GA2488@srv1-m700-lanp.koti>
* Mika Kukkonen <mikukkon@srv1-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@elte.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@srv1-m700-lanp.koti>
Signed-off-by: Ingo Molnar <mingo@elte.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,
prev parent reply other threads:[~2008-05-27 8:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-27 5:49 Mika Kukkonen
2008-05-27 8:00 ` Ingo Molnar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080527080030.GC29246@elte.hu \
--to=mingo@elte.hu \
--cc=arjan@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikukkon@iki.fi \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®