summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2021-02-26 02:19:47 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2021-02-26 18:41:02 +0100
commitf2b84d2e40eb1a17f72dc4a1da463ec8de649f19 (patch)
tree4137dee69706077ababa1478e1fba14656b33ca8 /mm
parenttracing: add error_report_end trace point (diff)
downloadlinux-f2b84d2e40eb1a17f72dc4a1da463ec8de649f19.tar.xz
linux-f2b84d2e40eb1a17f72dc4a1da463ec8de649f19.zip
kfence: use error_report_end tracepoint
Make it possible to trace KFENCE error reporting. A good usecase is watching for trace events from the userspace to detect and process memory corruption reports from the kernel. Link: https://lkml.kernel.org/r/20210121131915.1331302-3-glider@google.com Signed-off-by: Alexander Potapenko <glider@google.com> Suggested-by: Marco Elver <elver@google.com> Cc: Andrey Konovalov <andreyknvl@google.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Petr Mladek <pmladek@suse.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/kfence/report.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/kfence/report.c b/mm/kfence/report.c
index 4a424de44e2d..ab83d5a59bb1 100644
--- a/mm/kfence/report.c
+++ b/mm/kfence/report.c
@@ -14,6 +14,7 @@
#include <linux/seq_file.h>
#include <linux/stacktrace.h>
#include <linux/string.h>
+#include <trace/events/error_report.h>
#include <asm/kfence.h>
@@ -248,6 +249,7 @@ void kfence_report_error(unsigned long address, bool is_write, struct pt_regs *r
show_regs(regs);
else
dump_stack_print_info(KERN_ERR);
+ trace_error_report_end(ERROR_DETECTOR_KFENCE, address);
pr_err("==================================================================\n");
lockdep_on();