Thread (4 messages) flat view 4 messages, 3 authors, 2016-01-12

Re: [PATCH V2] mm/powerpc: Fix _PAGE_PTE breaking swapoff

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2016-01-12 00:03:45
Also in: linux-mm

On Mon, 2016-01-11 at 21:19 +0530, Aneesh Kumar K.V wrote:
Core kernel expect swp_entry_t to be consisting of
only swap type and swap offset. We should not leak pte bits to
swp_entry_t. This breaks swapoff which use the swap type and offset
to build a swp_entry_t and later compare that to the swp_entry_t
obtained from linux page table pte. Leaking pte bits to swp_entry_t
breaks that comparison and results in us looping in try_to_unuse.

The stack trace can be anywhere below try_to_unuse() in mm/swapfile.c,
since swapoff is circling around and around that function, reading from
each used swap block into a page, then trying to find where that page
belongs, looking at every non-file pte of every mm that ever swapped.

Reported-by: Hugh Dickins <hughd@google.com>
Suggested-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Aneesh Kumar K.V <redacted>
Thanks. I slightly edited the wording in the change log and added:

Fixes: 6a119eae942c ("powerpc/mm: Add a _PAGE_PTE bit")

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help