diff options
Diffstat (limited to 'kernel/kprobes.c')
-rw-r--r-- | kernel/kprobes.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 9e47d8c493f3..3e9f513a728d 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -675,9 +675,18 @@ static struct notifier_block kprobe_exceptions_nb = { | |||
675 | .priority = 0x7fffffff /* we need to be notified first */ | 675 | .priority = 0x7fffffff /* we need to be notified first */ |
676 | }; | 676 | }; |
677 | 677 | ||
678 | unsigned long __weak arch_deref_entry_point(void *entry) | ||
679 | { | ||
680 | return (unsigned long)entry; | ||
681 | } | ||
678 | 682 | ||
679 | int __kprobes register_jprobe(struct jprobe *jp) | 683 | int __kprobes register_jprobe(struct jprobe *jp) |
680 | { | 684 | { |
685 | unsigned long addr = arch_deref_entry_point(jp->entry); | ||
686 | |||
687 | if (!kernel_text_address(addr)) | ||
688 | return -EINVAL; | ||
689 | |||
681 | /* Todo: Verify probepoint is a function entry point */ | 690 | /* Todo: Verify probepoint is a function entry point */ |
682 | jp->kp.pre_handler = setjmp_pre_handler; | 691 | jp->kp.pre_handler = setjmp_pre_handler; |
683 | jp->kp.break_handler = longjmp_break_handler; | 692 | jp->kp.break_handler = longjmp_break_handler; |