summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2021-11-05 23:45:46 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2021-11-06 23:30:43 +0300
commit07e8481d3c38f461d7b79c1d5c9afe013b162b0c (patch)
tree2de0138d084b984eb067db5b12bb47cfca2efac4 /lib
parent49332956227adb35ffa7e3282c13e787325ff301 (diff)
downloadlinux-07e8481d3c38f461d7b79c1d5c9afe013b162b0c.tar.xz
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')
0 files changed, 0 insertions, 0 deletions