summaryrefslogtreecommitdiff
path: root/mm/kfence/kfence.h
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2021-02-26 04:19:08 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2021-02-26 20:41:02 +0300
commitd438fabce7860df3cb9337776be6f90b59ced8ed (patch)
tree912661af5be56d1fe1b7428a49e1b176e4b50515 /mm/kfence/kfence.h
parent840b239863449f27bf7522deb81e6746fbfbfeaf (diff)
downloadlinux-d438fabce7860df3cb9337776be6f90b59ced8ed.tar.xz
kfence: use pt_regs to generate stack trace on faults
Instead of removing the fault handling portion of the stack trace based on the fault handler's name, just use struct pt_regs directly. Change kfence_handle_page_fault() to take a struct pt_regs, and plumb it through to kfence_report_error() for out-of-bounds, use-after-free, or invalid access errors, where pt_regs is used to generate the stack trace. If the kernel is a DEBUG_KERNEL, also show registers for more information. Link: https://lkml.kernel.org/r/20201105092133.2075331-1-elver@google.com Signed-off-by: Marco Elver <elver@google.com> Suggested-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Cc: Alexander Potapenko <glider@google.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Jann Horn <jannh@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/kfence/kfence.h')
-rw-r--r--mm/kfence/kfence.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/kfence/kfence.h b/mm/kfence/kfence.h
index 1014060f9707..0d83e628a97d 100644
--- a/mm/kfence/kfence.h
+++ b/mm/kfence/kfence.h
@@ -105,8 +105,8 @@ enum kfence_error_type {
KFENCE_ERROR_INVALID_FREE, /* Invalid free. */
};
-void kfence_report_error(unsigned long address, const struct kfence_metadata *meta,
- enum kfence_error_type type);
+void kfence_report_error(unsigned long address, struct pt_regs *regs,
+ const struct kfence_metadata *meta, enum kfence_error_type type);
void kfence_print_object(struct seq_file *seq, const struct kfence_metadata *meta);