summaryrefslogtreecommitdiff
path: root/mm/kfence/kfence.h
diff options
context:
space:
mode:
Diffstat (limited to 'mm/kfence/kfence.h')
-rw-r--r--mm/kfence/kfence.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/mm/kfence/kfence.h b/mm/kfence/kfence.h
index f9caea007246..1f618f9b0d12 100644
--- a/mm/kfence/kfence.h
+++ b/mm/kfence/kfence.h
@@ -16,6 +16,8 @@
#include "../slab.h" /* for struct kmem_cache */
+extern bool kfence_enabled;
+
/*
* Get the canary byte pattern for @addr. Use a pattern that varies based on the
* lower 3 bits of the address, to detect memory corruptions with higher
@@ -140,8 +142,18 @@ enum kfence_error_type {
KFENCE_ERROR_INVALID_FREE, /* Invalid free. */
};
-void kfence_report_error(unsigned long address, bool is_write, struct pt_regs *regs,
- const struct kfence_metadata *meta, enum kfence_error_type type);
+enum kfence_fault {
+ KFENCE_FAULT_NONE,
+ KFENCE_FAULT_REPORT,
+ KFENCE_FAULT_OOPS,
+ KFENCE_FAULT_PANIC,
+};
+
+enum kfence_fault
+kfence_report_error(unsigned long address, bool is_write, struct pt_regs *regs,
+ const struct kfence_metadata *meta, enum kfence_error_type type);
+
+void kfence_handle_fault(enum kfence_fault fault);
void kfence_print_object(struct seq_file *seq, const struct kfence_metadata *meta) __must_hold(&meta->lock);