Skip to content

Commit

Permalink
mm/gup: Use huge_ptep_get() in gup_hugepte()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chleroy authored and mpe committed Jun 20, 2020
1 parent 1497eea commit 55ca226
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/gup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2425,7 +2425,7 @@ static int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
if (pte_end < end)
end = pte_end;

pte = READ_ONCE(*ptep);
pte = huge_ptep_get(ptep);

if (!pte_access_permitted(pte, flags & FOLL_WRITE))
return 0;
Expand Down

0 comments on commit 55ca226

Please sign in to comment.