For Kprobes critical path is the path from debug break exception handler till the control reaches kprobes exception code. No probes can be supported in this path as we will end up in recursion. This patch prevents this by moving the below function to safe __kprobes section onto which no probes can be inserted.
Showing the changes to kernel (1 of 2 files). Show all
Unified · Split
| @@ -32,6 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | #include <linux/compat.h> |
| 34 | 34 | #include <linux/syscalls.h> |
| 35 | +#include <linux/kprobes.h> | |
| 35 | 36 | |
| 36 | 37 | #include <asm/uaccess.h> |
| 37 | 38 | #include <asm/io.h> |
| @@ -168,7 +169,7 @@ EXPORT_SYMBOL(notifier_chain_unregister); · 130 unmodified lines | ||
| 168 | 169 | * of the last notifier function called. |
| 169 | 170 | */ |
| 170 | 171 | |
| 171 | −int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v) | |
| 172 | +int __kprobes notifier_call_chain(struct notifier_block **n, unsigned long val, void *v) | |
| 172 | 173 | { |
| 173 | 174 | int ret=NOTIFY_DONE; |
| 174 | 175 | struct notifier_block *nb = *n; |