Skip to content

Commit 55ca226

Browse files
chleroympe
authored andcommitted
mm/gup: Use huge_ptep_get() in gup_hugepte()
gup_hugepte() reads hugepage table entries, it can't read them directly, huge_ptep_get() must be used. Fixes: 9e343b4 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") Signed-off-by: Christophe Leroy <[email protected]> Acked-by: Will Deacon <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/ffc3714334c3bfaca6f13788ad039e8759ae413f.1592225558.git.christophe.leroy@csgroup.eu
1 parent 1497eea commit 55ca226

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/gup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,7 @@ static int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
24252425
if (pte_end < end)
24262426
end = pte_end;
24272427

2428-
pte = READ_ONCE(*ptep);
2428+
pte = huge_ptep_get(ptep);
24292429

24302430
if (!pte_access_permitted(pte, flags & FOLL_WRITE))
24312431
return 0;

0 commit comments

Comments
 (0)