linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hmm: Fix bad subpage pointer in try_to_unmap_one
@ 2019-07-09 22:35 Ralph Campbell
  2019-07-10  0:28 ` Andrew Morton
  0 siblings, 1 reply; 9+ messages in thread
From: Ralph Campbell @ 2019-07-09 22:35 UTC (permalink / raw)
  To: linux-mm
  Cc: linux-kernel, Ralph Campbell, Andrew Morton,
	Jérôme Glisse, Kirill A. Shutemov, Mike Kravetz

When migrating a ZONE device private page from device memory to system
memory, the subpage pointer is initialized from a swap pte which computes
an invalid page pointer. A kernel panic results such as:

BUG: unable to handle page fault for address: ffffea1fffffffc8

Initialize subpage correctly before calling page_remove_rmap().

Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Jérôme Glisse" <jglisse@redhat.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
---
 mm/rmap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/rmap.c b/mm/rmap.c
index e5dfe2ae6b0d..ec1af8b60423 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1476,6 +1476,7 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
 			 * No need to invalidate here it will synchronize on
 			 * against the special swap migration pte.
 			 */
+			subpage = page;
 			goto discard;
 		}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-07-16 21:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-09 22:35 [PATCH] mm/hmm: Fix bad subpage pointer in try_to_unmap_one Ralph Campbell
2019-07-10  0:28 ` Andrew Morton
2019-07-10  1:24   ` Ralph Campbell
2019-07-15 22:00     ` Andrew Morton
2019-07-15 23:34       ` John Hubbard
2019-07-16  0:38         ` Ralph Campbell
2019-07-16  6:14           ` John Hubbard
2019-07-16 15:33             ` Jerome Glisse
2019-07-16 21:10           ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).