diff options
| author | Zi Yan <[email protected]> | 2023-09-13 16:12:45 -0400 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-10-04 10:32:29 -0700 |
| commit | 426056efe835cf4864ccf4c328fe3af9146fc539 (patch) | |
| tree | 7a36e306348817e84a9ab87c88a1b003e6f42ceb /include/linux | |
| parent | 2e7cfe5cd5b6b0b98abf57a3074885979e187c1c (diff) | |
mm/hugetlb: use nth_page() in place of direct struct page manipulation
When dealing with hugetlb pages, manipulating struct page pointers
directly can get to wrong struct page, since struct page is not guaranteed
to be contiguous on SPARSEMEM without VMEMMAP. Use nth_page() to handle
it properly.
A wrong or non-existing page might be tried to be grabbed, either
leading to a non freeable page or kernel memory access errors. No bug
is reported. It comes from code inspection.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 57a196a58421 ("hugetlb: simplify hugetlb handling in follow_page_mask")
Signed-off-by: Zi Yan <[email protected]>
Reviewed-by: Muchun Song <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Matthew Wilcox (Oracle) <[email protected]>
Cc: Mike Kravetz <[email protected]>
Cc: Mike Rapoport (IBM) <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions