linux-stable/mm/kfence
Marco Elver 07e8481d3c kfence: always use static branches to guard kfence_alloc()
Regardless of KFENCE mode (CONFIG_KFENCE_STATIC_KEYS: either using
static keys to gate allocations, or using a simple dynamic branch),
always use a static branch to avoid the dynamic branch in kfence_alloc()
if KFENCE was disabled at boot.

For CONFIG_KFENCE_STATIC_KEYS=n, this now avoids the dynamic branch if
KFENCE was disabled at boot.

To simplify, also unifies the location where kfence_allocation_gate is
read-checked to just be inline in kfence_alloc().

Link: https://lkml.kernel.org/r/20211019102524.2807208-1-elver@google.com
Signed-off-by: Marco Elver <elver@google.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>
2021-11-06 13:30:43 -07:00
..
Makefile kfence: add test suite 2021-02-26 09:41:02 -08:00
core.c kfence: always use static branches to guard kfence_alloc() 2021-11-06 13:30:43 -07:00
kfence.h kfence: limit currently covered allocations when pool nearly full 2021-11-06 13:30:43 -07:00
kfence_test.c kfence: test: use kunit_skip() to skip tests 2021-11-06 13:30:43 -07:00
report.c Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00