diff options
-rw-r--r-- | arch/x86/kernel/ftrace.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 89de3eaf8772..cbc4a91b131e 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -297,16 +297,7 @@ int ftrace_int3_handler(struct pt_regs *regs) | |||
297 | 297 | ||
298 | static int ftrace_write(unsigned long ip, const char *val, int size) | 298 | static int ftrace_write(unsigned long ip, const char *val, int size) |
299 | { | 299 | { |
300 | /* | 300 | ip = text_ip_addr(ip); |
301 | * On x86_64, kernel text mappings are mapped read-only with | ||
302 | * CONFIG_DEBUG_RODATA. So we use the kernel identity mapping instead | ||
303 | * of the kernel text mapping to modify the kernel text. | ||
304 | * | ||
305 | * For 32bit kernels, these mappings are same and we can use | ||
306 | * kernel identity mapping to modify code. | ||
307 | */ | ||
308 | if (within(ip, (unsigned long)_text, (unsigned long)_etext)) | ||
309 | ip = (unsigned long)__va(__pa_symbol(ip)); | ||
310 | 301 | ||
311 | if (probe_kernel_write((void *)ip, val, size)) | 302 | if (probe_kernel_write((void *)ip, val, size)) |
312 | return -EPERM; | 303 | return -EPERM; |