diff options
author | David Hildenbrand <[email protected]> | 2024-12-10 10:34:37 +0100 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2024-12-18 19:04:45 -0800 |
commit | faeec8e23c10bd30e8aa759a2eb3018dae00f924 (patch) | |
tree | df0e8a66c887a19e7258e946a57ed42bf8d3430c /tools/perf/scripts/python/task-analyzer.py | |
parent | 8ac662f5da19f5873fdd94c48a5cdb45b2e1b58f (diff) |
mm/page_alloc: don't call pfn_to_page() on possibly non-existent PFN in split_large_buddy()
In split_large_buddy(), we might call pfn_to_page() on a PFN that might
not exist. In corner cases, such as when freeing the highest pageblock in
the last memory section, this could result with CONFIG_SPARSEMEM &&
!CONFIG_SPARSEMEM_EXTREME in __pfn_to_section() returning NULL and and
__section_mem_map_addr() dereferencing that NULL pointer.
Let's fix it, and avoid doing a pfn_to_page() call for the first
iteration, where we already have the page.
So far this was found by code inspection, but let's just CC stable as the
fix is easy.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: fd919a85cd55 ("mm: page_isolation: prepare for hygienic freelists")
Signed-off-by: David Hildenbrand <[email protected]>
Reported-by: Vlastimil Babka <[email protected]>
Closes: https://lkml.kernel.org/r/[email protected]
Reviewed-by: Vlastimil Babka <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Cc: Yu Zhao <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions