Skip to content

provide the flexibility to enable KFENCE

Tianchen Ding linux-mm lkml 3 versions – Applied

Status from this message: [merged] kfence-alloc-kfence_pool-after-system-startup.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 3 repliesApplied 2/2
  2. v22 patches 3 repliesSuperseded
  3. v1 RFC2 patches 9 repliesSuperseded

Changes in v3 from the cover letter

Use alloc_pages_exact() instead of alloc_contig_pages() if CONFIG_CONTIG_ALLOC is not defined.

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2kfence: Allow re-enabling KFENCE after system startupmm/kfence/core.c+18 -31 replyApplied
2/2kfence: Alloc kfence_pool after system startupmm/kfence/core.c+90 -212 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMarco ElverPeng Liu
1/2R-b
2/2R-b T-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] provide the flexibility to enable KFENCE

This is v3 for (re-)enabling KFENCE.

If CONFIG_CONTIG_ALLOC is not supported, we fallback to try alloc_pages_exact(). Allocating pages in this way has limits about MAX_ORDER (default 11). So we will not support allocating kfence pool after system startup with a large KFENCE_NUM_OBJECTS.

When handling failures in kfence_init_pool_late(), we pair free_pages_exact() to alloc_pages_exact() for compatibility consideration, though it actually does the same as free_contig_range().

v3:
Use alloc_pages_exact() instead of alloc_contig_pages() if CONFIG_CONTIG_ALLOC is not defined.

v2: https://lore.kernel.org/all/[email protected]/
Take KFENCE_WARN_ON() into account. Do not allow re-enabling KFENCE if it once disabled by warn.
Modify func names and comments.

RFC/v1: https://lore.kernel.org/all/[email protected]/

Tianchen Ding (2):
kfence: Allow re-enabling KFENCE after system startup
kfence: Alloc kfence_pool after system startup

 mm/kfence/core.c | 126 +++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 105 insertions(+), 21 deletions(-)
Signature · 1 line
2.27.0