| Date | Tue, 19 May 2020 19:52:36 -0000 | From | "tip-bot2 for Peter Zijlstra" <> | Subject | [tip: core/rcu] printk: Disallow instrumenting print_nmi_enter() |
| |
The following commit has been merged into the core/rcu branch of tip:
Commit-ID: b0f51883f551b900a04a80f49fb0886caf7e9a12 Gitweb: https://git.kernel.org/tip/b0f51883f551b900a04a80f49fb0886caf7e9a12 Author: Peter Zijlstra <peterz@infradead.org> AuthorDate: Mon, 24 Feb 2020 22:25:03 +01:00 Committer: Thomas Gleixner <tglx@linutronix.de> CommitterDate: Tue, 19 May 2020 15:51:16 +02:00
printk: Disallow instrumenting print_nmi_enter()
It happens early in nmi_enter(), no tracing, probing or other funnies allowed. Specifically as nmi_enter() will be used in do_debug(), which would cause recursive exceptions when kprobed.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com> Link: https://lkml.kernel.org/r/20200505134101.139720912@linutronix.de
--- kernel/printk/printk_safe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c index e8791f2..4242403 100644 --- a/kernel/printk/printk_safe.c +++ b/kernel/printk/printk_safe.c @@ -10,6 +10,7 @@ #include <linux/cpumask.h> #include <linux/irq_work.h> #include <linux/printk.h> +#include <linux/kprobes.h> #include "internal.h" @@ -293,12 +294,12 @@ static __printf(1, 0) int vprintk_nmi(const char *fmt, va_list args) return printk_safe_log_store(s, fmt, args); } -void notrace printk_nmi_enter(void) +void noinstr printk_nmi_enter(void) { this_cpu_add(printk_context, PRINTK_NMI_CONTEXT_OFFSET); } -void notrace printk_nmi_exit(void) +void noinstr printk_nmi_exit(void) { this_cpu_sub(printk_context, PRINTK_NMI_CONTEXT_OFFSET); }
|