diff options
| author | Kirill A. Shutemov <[email protected]> | 2025-04-09 09:40:43 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-04-12 00:32:41 +0000 |
| commit | a995199384347261bb3f21b2e171fa7f988bd2f8 (patch) | |
| tree | f4cd49728ffc22dc98913869d66d3e5b9a013d6b /net/unix/af_unix.c | |
| parent | selftests/mm: fix compiler -Wmaybe-uninitialized warning (diff) | |
| download | kernel-a995199384347261bb3f21b2e171fa7f988bd2f8.tar.gz kernel-a995199384347261bb3f21b2e171fa7f988bd2f8.zip | |
mm: fix apply_to_existing_page_range()
In the case of apply_to_existing_page_range(), apply_to_pte_range() is
reached with 'create' set to false. When !create, the loop over the PTE
page table is broken.
apply_to_pte_range() will only move to the next PTE entry if 'create' is
true or if the current entry is not pte_none().
This means that the user of apply_to_existing_page_range() will not have
'fn' called for any entries after the first pte_none() in the PTE page
table.
Fix the loop logic in apply_to_pte_range().
There are no known runtime issues from this, but the fix is trivial enough
for stable@ even without a known buggy user.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Kirill A. Shutemov <[email protected]>
Fixes: be1db4753ee6 ("mm/memory.c: add apply_to_existing_page_range() helper")
Cc: Daniel Axtens <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
