Skip to content

arm64: remove page granularity limitation from KFENCE

Jisheng Zhang linux-arm-kernel linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2kfence: allow providing __kfence_pool in arch specific waymm/kfence/core.c+4 -22 replies
2/2arm64: remove page granularity limitation from KFENCEarch/arm64/kernel/setup.c arch/arm64/mm/mmu.c+22 -84 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] arm64: remove page granularity limitation from KFENCE

KFENCE requires linear map to be mapped at page granularity, so that it is possible to protect/unprotect single pages in the KFENCE pool. Currently if KFENCE is enabled, arm64 maps all pages at page granularity, it seems overkilled. We want both KFENCE feature and arm64's block level and contiguous mapping for non KEFENCE pool pages.

We acchieve this goal by allocating KFENCE pool before paging_init() so we know the KFENCE pool address, then we take care to map the pool at page granularity during map_mem().

patch1 is a preparation patch.
patch2 removes the limitation.

Jisheng Zhang (2):
kfence: allow providing __kfence_pool in arch specific way
arm64: remove page granularity limitation from KFENCE

 arch/arm64/kernel/setup.c |  3 +++
 arch/arm64/mm/mmu.c       | 27 +++++++++++++++++++--------
 mm/kfence/core.c          |  6 ++++--
 3 files changed, 26 insertions(+), 10 deletions(-)
Signature · 1 line
2.31.0