From: Jeremy Fitzhardinge <jeremy@goop.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
yinghai@kernel.org, jirislaby@gmail.com,
jeremy.fitzhardinge@citrix.com, jeremy@goop.org,
tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/mm-v2] x86-32: make sure virt_addr_valid() returns false for fixmap addresses
Date: Sun, 8 Mar 2009 19:27:30 GMT [thread overview]
Message-ID: <tip-0feca851c1b3cb4ebfa3149144b3d5de0879ebaa@git.kernel.org> (raw)
In-Reply-To: <49B166D6.2080505@goop.org>
Commit-ID: 0feca851c1b3cb4ebfa3149144b3d5de0879ebaa
Gitweb: http://git.kernel.org/tip/0feca851c1b3cb4ebfa3149144b3d5de0879ebaa
Author: "Jeremy Fitzhardinge" <jeremy@goop.org>
AuthorDate: Fri, 6 Mar 2009 10:09:26 -0800
Commit: Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 8 Mar 2009 20:03:52 +0100
x86-32: make sure virt_addr_valid() returns false for fixmap addresses
I found that virt_addr_valid() was returning true for fixmap addresses.
I'm not sure whether pfn_valid() is supposed to include this test,
but there's no harm in being explicit.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <49B166D6.2080505@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/mm/ioremap.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 62773ab..62def57 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -87,6 +87,8 @@ bool __virt_addr_valid(unsigned long x)
return false;
if (__vmalloc_start_set && is_vmalloc_addr((void *) x))
return false;
+ if (x >= FIXADDR_START)
+ return false;
return pfn_valid((x - PAGE_OFFSET) >> PAGE_SHIFT);
}
EXPORT_SYMBOL(__virt_addr_valid);
parent reply other threads:[~2009-03-08 19:28 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <49B166D6.2080505@goop.org>]
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=tip-0feca851c1b3cb4ebfa3149144b3d5de0879ebaa@git.kernel.org \
--to=jeremy@goop.org \
--cc=hpa@zytor.com \
--cc=jeremy.fitzhardinge@citrix.com \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=yinghai@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.