diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-04-25 15:07:03 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-25 17:54:07 (GMT) |
commit | 00c6b2d5d7b2414bd46c620d6a8c37fa7a716f29 (patch) | |
tree | 61395a1d6e1665e3f491a0601a6de237b61de194 | |
parent | b7b66baa8bc3f8e0cda6576e31e9bde09382565d (diff) | |
download | linux-00c6b2d5d7b2414bd46c620d6a8c37fa7a716f29.tar.xz |
x86: harden kernel code patching
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/alternative.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 60299f6..65c7857 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]); |