]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm: Add proper pte access check helper for other platforms
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 4 Dec 2017 02:19:12 +0000 (07:49 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 22 Dec 2017 11:28:40 +0000 (22:28 +1100)
commitc2c9e6911fc391e8b93d7c9973b1ddcc17e01e86
tree5dc22abcb02fe0b11de1df7ac56fd0e03ce0df49
parent1633ea8bf5423c27209d1d8abd71a2b8d6b1f5cb
powerpc/mm: Add proper pte access check helper for other platforms

pte_access_premitted get called in get_user_pages_fast path. If we
have marked the pte PROT_NONE, we should not allow a read access on
the address. With the current implementation we are not checking the
READ and only check for WRITE. This is needed on archs like ppc64 that
implement PROT_NONE using _PAGE_USER access instead of _PAGE_PRESENT.
Also add pte_user check just to make sure we are not accessing kernel
mapping.

Even though there is code duplication, keeping the low level pte
accessors different for different platforms helps in code readability.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/book3s/32/pgtable.h
arch/powerpc/include/asm/nohash/pgtable.h