x86, kfence: enable KFENCE for x86

Linux Kernel / Linux Kernel - Alexander Potapenko [google.com] - 26 February 2021 17:41 UTC

Add architecture specific implementation details for KFENCE and enable KFENCE for the x86 architecture. In particular, this implements the required interface in for setting up the pool and providing helper functions for protecting and unprotecting pages.

For x86, we need to ensure that the pool uses 4K pages, which is done using the set_memory_4k() helper function.

[elver@google.com: add missing copyright and description header] Link: https://lkml.kernel.org/r/20210118092159.145934-2-elver@google.com

Link: https://lkml.kernel.org/r/20201103175841.3495947-3-elver@google.com

1dc0da6e9ec0 x86, kfence: enable KFENCE for x86
arch/x86/Kconfig | 1 +
arch/x86/include/asm/kfence.h | 70 +++++++++++++++++++++++++++++++++++++++++++
arch/x86/mm/fault.c | 5 ++++
3 files changed, 76 insertions(+)

Upstream: git.kernel.org

  • Share