aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/probes
diff options
context:
space:
mode:
authorPratyush Anand <panand@redhat.com>2016-07-08 12:35:50 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2016-07-19 10:03:21 -0400
commit888b3c8720e0a4033db09ba2364afde6a4763638 (patch)
tree12140433a56615c59bd4451b1ff535a88993adb1 /arch/arm64/kernel/probes
parent44b53f67c99d0fc53af3066a05d9e7ca5080a850 (diff)
arm64: Treat all entry code as non-kprobe-able
Entry symbols are not kprobe safe. So blacklist them for kprobing. Signed-off-by: Pratyush Anand <panand@redhat.com> Signed-off-by: David A. Long <dave.long@linaro.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> [catalin.marinas@arm.com: Do not include syscall wrappers in .entry.text] Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/probes')
-rw-r--r--arch/arm64/kernel/probes/kprobes.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
index 44968019ce0d..0fe2b6578163 100644
--- a/arch/arm64/kernel/probes/kprobes.c
+++ b/arch/arm64/kernel/probes/kprobes.c
@@ -30,6 +30,7 @@
30#include <asm/insn.h> 30#include <asm/insn.h>
31#include <asm/uaccess.h> 31#include <asm/uaccess.h>
32#include <asm/irq.h> 32#include <asm/irq.h>
33#include <asm-generic/sections.h>
33 34
34#include "decode-insn.h" 35#include "decode-insn.h"
35 36
@@ -519,6 +520,31 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
519 return 1; 520 return 1;
520} 521}
521 522
523bool arch_within_kprobe_blacklist(unsigned long addr)
524{
525 extern char __idmap_text_start[], __idmap_text_end[];
526 extern char __hyp_idmap_text_start[], __hyp_idmap_text_end[];
527
528 if ((addr >= (unsigned long)__kprobes_text_start &&
529 addr < (unsigned long)__kprobes_text_end) ||
530 (addr >= (unsigned long)__entry_text_start &&
531 addr < (unsigned long)__entry_text_end) ||
532 (addr >= (unsigned long)__idmap_text_start &&
533 addr < (unsigned long)__idmap_text_end) ||
534 !!search_exception_tables(addr))
535 return true;
536
537 if (!is_kernel_in_hyp_mode()) {
538 if ((addr >= (unsigned long)__hyp_text_start &&
539 addr < (unsigned long)__hyp_text_end) ||
540 (addr >= (unsigned long)__hyp_idmap_text_start &&
541 addr < (unsigned long)__hyp_idmap_text_end))
542 return true;
543 }
544
545 return false;
546}
547
522int __init arch_init_kprobes(void) 548int __init arch_init_kprobes(void)
523{ 549{
524 return 0; 550 return 0;