Skip to content

Commit 0feca85

Browse files
jsgfIngo Molnar
authored andcommitted
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>
1 parent e954ef2 commit 0feca85

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎arch/x86/mm/ioremap.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ bool __virt_addr_valid(unsigned long x)
8787
return false;
8888
if (__vmalloc_start_set && is_vmalloc_addr((void *) x))
8989
return false;
90+
if (x >= FIXADDR_START)
91+
return false;
9092
return pfn_valid((x - PAGE_OFFSET) >> PAGE_SHIFT);
9193
}
9294
EXPORT_SYMBOL(__virt_addr_valid);

0 commit comments

Comments
 (0)