diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2020-06-15 14:57:57 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-06-20 14:14:53 +0200 |
commit | 55ca22633a9faa34c6a61d99433f9cc8e28dd7cc (patch) | |
tree | 29d1d4b264dfef7461e611240fabcf18d7261ec4 | |
parent | powerpc/syscalls: Use the number when building SPU syscall table (diff) | |
download | linux-55ca22633a9faa34c6a61d99433f9cc8e28dd7cc.tar.xz linux-55ca22633a9faa34c6a61d99433f9cc8e28dd7cc.zip |
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: 9e343b467c70 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/ffc3714334c3bfaca6f13788ad039e8759ae413f.1592225558.git.christophe.leroy@csgroup.eu
-rw-r--r-- | mm/gup.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |