lkdtm: Add kfence read after free crash type
authorStephen Boyd <swboyd@chromium.org>
Wed, 29 Nov 2023 21:44:04 +0000 (13:44 -0800)
committerKees Cook <keescook@chromium.org>
Fri, 1 Dec 2023 17:51:43 +0000 (09:51 -0800)
commitaabf7c37dfbce3e5fe24f0c86a34bc8f2f63cee8
tree13153d6a772137a57ebc6fb343135dbab7e4798d
parente5a4975ca463e91c2009f5950e0156f0b857eb10
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 <glider@google.com>
Acked-by: Marco Elver <elver@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: kasan-dev@googlegroups.com
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20231129214413.3156334-1-swboyd@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
drivers/misc/lkdtm/heap.c
include/linux/kfence.h