path: root/mm/pagewalk.c
diff options
authorKonstantin Khlebnikov <>2015-02-11 15:27:31 -0800
committerLinus Torvalds <>2015-02-11 17:06:05 -0800
commit05fbf357d94152171bc50f8a369390f1f16efd89 (patch)
tree656156ba6e3b055ef9353f0d17e92b59de49175b /mm/pagewalk.c
parent0664e57ff0c68cbca012a45a38288fa277eb6795 (diff)
proc/pagemap: walk page tables under pte lock
Lockless access to pte in pagemap_pte_range() might race with page migration and trigger BUG_ON(!PageLocked()) in migration_entry_to_page(): CPU A (pagemap) CPU B (migration) lock_page() try_to_unmap(page, TTU_MIGRATION...) make_migration_entry() set_pte_at() <read *pte> pte_to_pagemap_entry() remove_migration_ptes() unlock_page() if(is_migration_entry()) migration_entry_to_page() BUG_ON(!PageLocked(page)) Also lockless read might be non-atomic if pte is larger than wordsize. Other pte walkers (smaps, numa_maps, clear_refs) already lock ptes. Fixes: 052fb0d635df ("proc: report file/anon bit in /proc/pid/pagemap") Signed-off-by: Konstantin Khlebnikov <> Reported-by: Andrey Ryabinin <> Reviewed-by: Cyrill Gorcunov <> Acked-by: Naoya Horiguchi <> Acked-by: Kirill A. Shutemov <> Cc: <> [3.5+] Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/pagewalk.c')
0 files changed, 0 insertions, 0 deletions