diff options
Diffstat (limited to 'kernel/kprobes.c')
-rw-r--r-- | kernel/kprobes.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 3214289df5a7..734e9a7d280b 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -2037,19 +2037,23 @@ static int __init populate_kprobe_blacklist(unsigned long *start, | |||
2037 | { | 2037 | { |
2038 | unsigned long *iter; | 2038 | unsigned long *iter; |
2039 | struct kprobe_blacklist_entry *ent; | 2039 | struct kprobe_blacklist_entry *ent; |
2040 | unsigned long offset = 0, size = 0; | 2040 | unsigned long entry, offset = 0, size = 0; |
2041 | 2041 | ||
2042 | for (iter = start; iter < end; iter++) { | 2042 | for (iter = start; iter < end; iter++) { |
2043 | if (!kallsyms_lookup_size_offset(*iter, &size, &offset)) { | 2043 | entry = arch_deref_entry_point((void *)*iter); |
2044 | pr_err("Failed to find blacklist %p\n", (void *)*iter); | 2044 | |
2045 | if (!kernel_text_address(entry) || | ||
2046 | !kallsyms_lookup_size_offset(entry, &size, &offset)) { | ||
2047 | pr_err("Failed to find blacklist at %p\n", | ||
2048 | (void *)entry); | ||
2045 | continue; | 2049 | continue; |
2046 | } | 2050 | } |
2047 | 2051 | ||
2048 | ent = kmalloc(sizeof(*ent), GFP_KERNEL); | 2052 | ent = kmalloc(sizeof(*ent), GFP_KERNEL); |
2049 | if (!ent) | 2053 | if (!ent) |
2050 | return -ENOMEM; | 2054 | return -ENOMEM; |
2051 | ent->start_addr = *iter; | 2055 | ent->start_addr = entry; |
2052 | ent->end_addr = *iter + size; | 2056 | ent->end_addr = entry + size; |
2053 | INIT_LIST_HEAD(&ent->list); | 2057 | INIT_LIST_HEAD(&ent->list); |
2054 | list_add_tail(&ent->list, &kprobe_blacklist); | 2058 | list_add_tail(&ent->list, &kprobe_blacklist); |
2055 | } | 2059 | } |