Aneesh Kumar K.V 44734f23de powerpc/mm: Fix _PAGE_PTE breaking swapoff
Core kernel expects swp_entry_t to consist of only swap type and swap
offset. We should not leak pte bits into 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 into 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.

Fixes: 6a119eae942c ("powerpc/mm: Add a _PAGE_PTE bit")
Reported-by: Hugh Dickins <hughd@google.com>
Suggested-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-01-12 11:02:35 +11:00
..
2015-07-27 14:06:24 +02:00
2015-08-07 22:59:19 -05:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2015-07-13 10:10:54 +10:00
2013-04-18 13:03:53 +10:00
2015-05-28 15:31:53 +02:00
2014-04-09 12:53:28 +10:00
2012-03-28 18:30:02 +01:00
2014-01-23 16:36:54 -08:00
2011-11-08 14:51:46 +11:00
2014-06-25 18:49:40 -05:00
2015-01-12 05:04:13 -08:00
2015-02-03 18:47:18 +01:00
2014-11-03 12:12:32 +11:00
2015-05-11 15:06:39 +08:00
2015-12-17 22:40:59 +11:00
2015-07-13 10:10:54 +10:00
2015-02-23 14:52:04 +11:00
2015-10-06 14:52:48 -04:00
2011-07-26 16:49:47 -07:00
2013-12-09 11:40:25 +11:00
2015-06-24 17:49:41 -07:00
2010-05-05 09:11:10 -04:00
2014-07-28 14:10:23 +10:00
2011-03-31 11:26:23 -03:00
2015-12-14 15:19:09 +11:00
2011-03-31 11:26:23 -03:00
2015-12-14 15:19:14 +11:00
2015-12-14 20:40:32 +11:00
2015-12-17 22:40:56 +11:00
2013-11-06 14:13:49 +11:00
2015-03-06 23:21:07 +01:00
2012-09-17 16:31:51 +10:00
2011-03-31 11:26:23 -03:00
2015-12-02 19:34:41 +11:00
2015-11-16 17:05:53 +11:00
2015-12-16 12:54:04 +11:00
2014-02-17 11:19:37 +11:00
2015-05-05 13:35:39 -06:00
2013-10-30 16:02:28 +11:00