linux/mm/kfence
David Hildenbrand 56531761d4 kfence: drop nth_page() usage
We want to get rid of nth_page(), and kfence init code is the last user.

Unfortunately, we might actually walk a PFN range where the pages are not
contiguous, because we might be allocating an area from memblock that
could span memory sections in problematic kernel configs (SPARSEMEM
without SPARSEMEM_VMEMMAP).

We could check whether the page range is contiguous using
page_range_contiguous() and failing kfence init, or making kfence
incompatible these problemtic kernel configs.

Let's keep it simple and simply use pfn_to_page() by iterating PFNs.

Link: https://lkml.kernel.org/r/20250901150359.867252-36-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Marco Elver <elver@google.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-09-21 14:22:09 -07:00
..
.kunitconfig
Makefile
core.c kfence: drop nth_page() usage 2025-09-21 14:22:09 -07:00
kfence.h kfence: save freeing stack trace at calling time instead of freeing time 2024-09-01 20:26:12 -07:00
kfence_test.c mm/kfence: use str_write_read() helper in get_access_type() 2025-01-25 20:22:45 -08:00
report.c mm/kfence: use str_write_read() helper in get_access_type() 2025-01-25 20:22:45 -08:00