]> git.baikalelectronics.ru Git - kernel.git/commit
s390/mm: fix write access check in gup_huge_pmd()
authorGerald Schaefer <gerald.schaefer@de.ibm.com>
Mon, 18 Sep 2017 14:51:51 +0000 (16:51 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 19 Sep 2017 06:36:20 +0000 (08:36 +0200)
commite1b9272dddc138c1892067b62c123d53a40e5078
treeda82a51857fa5ee45e492b945120889714d78840
parent52b10ec91a5b08a986392eabc6de5ddc059b4a19
s390/mm: fix write access check in gup_huge_pmd()

The check for the _SEGMENT_ENTRY_PROTECT bit in gup_huge_pmd() is the
wrong way around. It must not be set for write==1, and not be checked for
write==0. Fix this similar to how it was fixed for ptes long time ago in
commit 13f1e59ea943 ("[S390] fix get_user_pages_fast").

One impact of this bug would be unnecessarily using the gup slow path for
write==0 on r/w mappings. A potentially more severe impact would be that
gup_huge_pmd() will succeed for write==1 on r/o mappings.

Cc: <stable@vger.kernel.org>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/mm/gup.c