Commit 00c6b2d5 authored by Ingo Molnar's avatar Ingo Molnar

x86: harden kernel code patching

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b7b66baa
...@@ -519,6 +519,7 @@ void *__kprobes text_poke(void *addr, const void *opcode, size_t len) ...@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment