summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-04-25 17:07:03 +0200
committerIngo Molnar <mingo@elte.hu>2008-04-25 19:54:07 +0200
commit00c6b2d5d7b2414bd46c620d6a8c37fa7a716f29 (patch)
tree61395a1d6e1665e3f491a0601a6de237b61de194
parentb7b66baa8bc3f8e0cda6576e31e9bde09382565d (diff)
x86: harden kernel code patching
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/alternative.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 60299f61843f..65c7857a90dd 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -519,6 +519,7 @@ void *__kprobes text_poke(void *addr, const void *opcode, size_t len)
pages[1] = vmalloc_to_page(addr + PAGE_SIZE);
} else {
pages[0] = virt_to_page(addr);
+ WARN_ON(!PageReserved(pages[0]));
pages[1] = virt_to_page(addr + PAGE_SIZE);
}
BUG_ON(!pages[0]);