All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Initialise mmu_notifier_range correctly
@ 2019-01-03  0:21 Matthew Wilcox
  2019-01-03  1:56   ` Jerome Glisse
  2019-01-03 14:31 ` Jerome Glisse
  0 siblings, 2 replies; 15+ messages in thread
From: Matthew Wilcox @ 2019-01-03  0:21 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, linux-xfs, linux-kernel, Christian König,
	Jan Kara, Jérôme Glisse


One of the paths in follow_pte_pmd() initialised the mmu_notifier_range
incorrectly.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
Fixes: ac46d4f3c432 ("mm/mmu_notifier: use structure for invalidate_range_start/end calls v2")
Tested-by: Dave Chinner <dchinner@redhat.com>

diff --git a/mm/memory.c b/mm/memory.c
index 2dd2f9ab57f4..21a650368be0 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4078,8 +4078,8 @@ static int __follow_pte_pmd(struct mm_struct *mm, unsigned long address,
 		goto out;
 
 	if (range) {
-		range->start = address & PAGE_MASK;
-		range->end = range->start + PAGE_SIZE;
+		mmu_notifier_range_init(range, mm, address & PAGE_MASK,
+				     (address & PAGE_MASK) + PAGE_SIZE);
 		mmu_notifier_invalidate_range_start(range);
 	}
 	ptep = pte_offset_map_lock(mm, pmd, address, ptlp);

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

end of thread, other threads:[~2019-01-03 15:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03  0:21 [PATCH] Initialise mmu_notifier_range correctly Matthew Wilcox
2019-01-03  1:56 ` Jerome Glisse
2019-01-03  1:56   ` Jerome Glisse
2019-01-03  3:32   ` John Hubbard
2019-01-03  4:18     ` Matthew Wilcox
2019-01-03 14:29       ` Jerome Glisse
2019-01-03 14:39         ` Matthew Wilcox
2019-01-03 14:39           ` Matthew Wilcox
2019-01-03 14:59           ` Jerome Glisse
2019-01-03 14:59             ` Jerome Glisse
2019-01-03 14:31 ` Jerome Glisse
2019-01-03 14:36   ` Matthew Wilcox
2019-01-03 14:43   ` Matthew Wilcox
2019-01-03 15:05     ` Jerome Glisse
2019-01-03 15:05       ` Jerome Glisse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.