aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorStephen Boyd <[email protected]>2023-11-29 13:44:04 -0800
committerKees Cook <[email protected]>2023-12-01 09:51:43 -0800
commitaabf7c37dfbce3e5fe24f0c86a34bc8f2f63cee8 (patch)
tree13153d6a772137a57ebc6fb343135dbab7e4798d /include/linux
parente5a4975ca463e91c2009f5950e0156f0b857eb10 (diff)
lkdtm: Add kfence read after free crash type
Add the ability to allocate memory from kfence and trigger a read after free on that memory to validate that kfence is working properly. This is used by ChromeOS integration tests to validate that kfence errors can be collected on user devices and parsed properly. Cc: Alexander Potapenko <[email protected]> Acked-by: Marco Elver <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Andrew Morton <[email protected]> Cc: [email protected] Signed-off-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kfence.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/kfence.h b/include/linux/kfence.h
index 401af4757514..88100cc9caba 100644
--- a/include/linux/kfence.h
+++ b/include/linux/kfence.h
@@ -223,6 +223,8 @@ bool __kfence_obj_info(struct kmem_obj_info *kpp, void *object, struct slab *sla
#else /* CONFIG_KFENCE */
+#define kfence_sample_interval (0)
+
static inline bool is_kfence_address(const void *addr) { return false; }
static inline void kfence_alloc_pool_and_metadata(void) { }
static inline void kfence_init(void) { }