Skip to content

Commit

Permalink
mm: mprotect: use VM_ACCESS_FLAGS
Browse files Browse the repository at this point in the history
Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Kefeng Wang <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Jarkko Sakkinen <[email protected]>
Cc: "Pan, Xinhui" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Kefeng Wang authored and akpm00 committed Nov 9, 2022
1 parent 4f20566 commit e39ee67
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/mprotect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e39ee67

Please sign in to comment.