summaryrefslogtreecommitdiff
path: root/mm/mprotect.c
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2022-10-19 06:49:43 +0300
committerAndrew Morton <akpm@linux-foundation.org>2022-11-09 04:37:19 +0300
commite39ee675f42e993bbf1c04b1ad7526db820ccdce (patch)
treeac1a96d8c8b27611ade45bb7dd2a4e42ace9b833 /mm/mprotect.c
parent4f20566f5c0f42c451f6a43be9bfa6f0b3d142df (diff)
downloadlinux-e39ee675f42e993bbf1c04b1ad7526db820ccdce.tar.xz
mm: mprotect: use VM_ACCESS_FLAGS
Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS. Link: https://lkml.kernel.org/r/20221019034945.93081-4-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: David Airlie <airlied@gmail.com> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Jarkko Sakkinen <jarkko@kernel.org> Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/mprotect.c')
-rw-r--r--mm/mprotect.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 668bfaa6ed2a..99762403cc8f 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -756,8 +756,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
* If a permission is not passed to mprotect(), it must be
* cleared from the VMA.
*/
- mask_off_old_flags = VM_READ | VM_WRITE | VM_EXEC |
- VM_FLAGS_CLEAR;
+ mask_off_old_flags = VM_ACCESS_FLAGS | VM_FLAGS_CLEAR;
new_vma_pkey = arch_override_mprotect_pkey(vma, prot, pkey);
newflags = calc_vm_prot_bits(prot, new_vma_pkey);