From: Ingo Molnar Date: Fri, 25 Apr 2008 15:07:03 +0000 (+0200) Subject: x86: harden kernel code patching X-Git-Tag: v2.6.26-rc1~1073^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=00c6b2d5d7b2414bd46c620d6a8c37fa7a716f29;p=linux-2.6-omap-h63xx.git x86: harden kernel code patching Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 60299f61843..65c7857a90d 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]);