diff options
author | Vineet Gupta <vineet.gupta1@synopsys.com> | 2019-03-07 19:29:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-07 21:32:01 -0500 |
commit | 26e152252e92999b975fe935c666a090c46905f7 (patch) | |
tree | f44d3ee0263e5a82c1f3db147ae66a4a28bdeb51 | |
parent | 67ceb1eca0acc045c9ef170a05f58fd710063967 (diff) |
fs/exec.c: replace opencoded set_mask_bits()
Link: http://lkml.kernel.org/r/1548275584-18096-2-git-send-email-vgupta@synopsys.com
Link: http://lkml.kernel.org/g/20150807115710.GA16897@redhat.com
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Reviewed-by: Anthony Yznaga <anthony.yznaga@oracle.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Miklos Szeredi <mszeredi@redhat.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/exec.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -1944,15 +1944,10 @@ EXPORT_SYMBOL(set_binfmt); | |||
1944 | */ | 1944 | */ |
1945 | void set_dumpable(struct mm_struct *mm, int value) | 1945 | void set_dumpable(struct mm_struct *mm, int value) |
1946 | { | 1946 | { |
1947 | unsigned long old, new; | ||
1948 | |||
1949 | if (WARN_ON((unsigned)value > SUID_DUMP_ROOT)) | 1947 | if (WARN_ON((unsigned)value > SUID_DUMP_ROOT)) |
1950 | return; | 1948 | return; |
1951 | 1949 | ||
1952 | do { | 1950 | set_mask_bits(&mm->flags, MMF_DUMPABLE_MASK, value); |
1953 | old = READ_ONCE(mm->flags); | ||
1954 | new = (old & ~MMF_DUMPABLE_MASK) | value; | ||
1955 | } while (cmpxchg(&mm->flags, old, new) != old); | ||
1956 | } | 1951 | } |
1957 | 1952 | ||
1958 | SYSCALL_DEFINE3(execve, | 1953 | SYSCALL_DEFINE3(execve, |