mm/memory.c: initialise mmu_notifier_range correctly
authorMatthew Wilcox <[email protected]>
Tue, 8 Jan 2019 23:23:25 +0000 (15:23 -0800)
committerLinus Torvalds <[email protected]>
Wed, 9 Jan 2019 01:15:11 +0000 (17:15 -0800)
One of the paths in follow_pte_pmd() initialised the mmu_notifier_range
incorrectly.

Link: http://lkml.kernel.org/r/[email protected]
Fixes: ac46d4f3c432 ("mm/mmu_notifier: use structure for invalidate_range_start/end calls v2")
Signed-off-by: Matthew Wilcox <[email protected]>
Tested-by: Dave Chinner <[email protected]>
Reviewed-by: Jérôme Glisse <[email protected]>
Cc: John Hubbard <[email protected]>
Cc: Jan Kara <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/memory.c

index 5e46836714dc996e00582adea1462d78c7f5226d..e11ca9dd823f20c60dd0c20ff7567e34a84a1dda 100644 (file)
@@ -4099,8 +4099,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);