summaryrefslogtreecommitdiffstats
path: root/mm/mprotect.c
diff options
context:
space:
mode:
authorKhalid Aziz <khalid.aziz@oracle.com>2018-02-21 18:15:50 +0100
committerDavid S. Miller <davem@davemloft.net>2018-03-18 15:38:47 +0100
commit2c2d57b5e769956fb36581e0d3cccdb5ea68038f (patch)
tree339cc77f5489da03b12eb478315429f2c60bcf9d /mm/mprotect.c
parentmm: Add address parameter to arch_validate_prot() (diff)
downloadlinux-2c2d57b5e769956fb36581e0d3cccdb5ea68038f.tar.xz
linux-2c2d57b5e769956fb36581e0d3cccdb5ea68038f.zip
mm: Clear arch specific VM flags on protection change
When protection bits are changed on a VMA, some of the architecture specific flags should be cleared as well. An examples of this are the PKEY flags on x86. This patch expands the current code that clears PKEY flags for x86, to support similar functionality for other architectures as well. Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com> Cc: Khalid Aziz <khalid@gonehiking.org> Reviewed-by: Anthony Yznaga <anthony.yznaga@oracle.com> Acked-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'mm/mprotect.c')
-rw-r--r--mm/mprotect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 088ea9c08678..c1d6af7455da 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -475,7 +475,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
* cleared from the VMA.
*/
mask_off_old_flags = VM_READ | VM_WRITE | VM_EXEC |
- ARCH_VM_PKEY_FLAGS;
+ VM_FLAGS_CLEAR;
new_vma_pkey = arch_override_mprotect_pkey(vma, prot, pkey);
newflags = calc_vm_prot_bits(prot, new_vma_pkey);