x86: harden kernel code patching

Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Ingo Molnar 2008-04-25 17:07:03 +02:00
parent b7b66baa8b
commit 00c6b2d5d7

View File

@ -519,6 +519,7 @@ void *__kprobes text_poke(void *addr, const void *opcode, size_t len)
pages[1] = vmalloc_to_page(addr + PAGE_SIZE); pages[1] = vmalloc_to_page(addr + PAGE_SIZE);
} else { } else {
pages[0] = virt_to_page(addr); pages[0] = virt_to_page(addr);
WARN_ON(!PageReserved(pages[0]));
pages[1] = virt_to_page(addr + PAGE_SIZE); pages[1] = virt_to_page(addr + PAGE_SIZE);
} }
BUG_ON(!pages[0]); BUG_ON(!pages[0]);