Skip to contentSkip to conversation

x86-32: make sure virt_addr_valid() returns false for fixmap addresses

tip:x86/mm-v2 Jeremy Fitzhardinge 1 participant 1 message Mar 8, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Commit-ID:  0feca851c1b3cb4ebfa3149144b3d5de0879ebaa
Gitweb:     http://git.kernel.org/tip/0feca851c1b3cb4ebfa3149144b3d5de0879ebaa
Author:     "Jeremy Fitzhardinge" <[email protected]>
AuthorDate: Fri, 6 Mar 2009 10:09:26 -0800
Commit:     Ingo Molnar <[email protected]>
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.

LKML-Reference: <[email protected]>

---
 arch/x86/mm/ioremap.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/mm/ioremap.c +2 -0
index 62773ab..62def57 100644
@@ -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);