diff options
author | Marco Elver <elver@google.com> | 2021-11-05 21:45:46 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-11-06 21:30:43 +0100 |
commit | 07e8481d3c38f461d7b79c1d5c9afe013b162b0c (patch) | |
tree | 2de0138d084b984eb067db5b12bb47cfca2efac4 /lib/Kconfig.kfence | |
parent | kfence: shorten critical sections of alloc/free (diff) | |
download | linux-07e8481d3c38f461d7b79c1d5c9afe013b162b0c.tar.xz linux-07e8481d3c38f461d7b79c1d5c9afe013b162b0c.zip |
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>
Diffstat (limited to 'lib/Kconfig.kfence')
0 files changed, 0 insertions, 0 deletions