mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
kprobes: Prohibit probing on .entry.text code
.entry.text is a code area which is used for interrupt/syscall entries, which includes many sensitive code. Thus, it is better to prohibit probing on all of such code instead of a part of that. Since some symbols are already registered on kprobe blacklist, this also removes them from the blacklist. Signed-off-by: Masami Hiramatsu <[email protected]> Reviewed-by: Steven Rostedt <[email protected]> Cc: Ananth N Mavinakayanahalli <[email protected]> Cc: Anil S Keshavamurthy <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David S. Miller <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jan Kiszka <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Jonathan Lebon <[email protected]> Cc: Seiji Aguchi <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
6a5022a56a
commit
be8f274323
5 changed files with 17 additions and 58 deletions
|
|
@ -96,9 +96,6 @@ static raw_spinlock_t *kretprobe_table_lock_ptr(unsigned long hash)
|
|||
static struct kprobe_blackpoint kprobe_blacklist[] = {
|
||||
{"preempt_schedule",},
|
||||
{"native_get_debugreg",},
|
||||
{"irq_entries_start",},
|
||||
{"common_interrupt",},
|
||||
{"mcount",}, /* mcount can be called from everywhere */
|
||||
{NULL} /* Terminator */
|
||||
};
|
||||
|
||||
|
|
@ -1324,12 +1321,18 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool __weak arch_within_kprobe_blacklist(unsigned long addr)
|
||||
{
|
||||
/* The __kprobes marked functions and entry code must not be probed */
|
||||
return addr >= (unsigned long)__kprobes_text_start &&
|
||||
addr < (unsigned long)__kprobes_text_end;
|
||||
}
|
||||
|
||||
static int __kprobes in_kprobes_functions(unsigned long addr)
|
||||
{
|
||||
struct kprobe_blackpoint *kb;
|
||||
|
||||
if (addr >= (unsigned long)__kprobes_text_start &&
|
||||
addr < (unsigned long)__kprobes_text_end)
|
||||
if (arch_within_kprobe_blacklist(addr))
|
||||
return -EINVAL;
|
||||
/*
|
||||
* If there exists a kprobe_blacklist, verify and
|
||||
|
|
|
|||
Loading…
Reference in a new issue