aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVineet Gupta <[email protected]>2019-03-07 16:29:23 -0800
committerLinus Torvalds <[email protected]>2019-03-07 18:32:01 -0800
commit26e152252e92999b975fe935c666a090c46905f7 (patch)
treef44d3ee0263e5a82c1f3db147ae66a4a28bdeb51
parent67ceb1eca0acc045c9ef170a05f58fd710063967 (diff)
fs/exec.c: replace opencoded set_mask_bits()
Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/g/[email protected] Signed-off-by: Vineet Gupta <[email protected]> Reviewed-by: Anthony Yznaga <[email protected]> Acked-by: Oleg Nesterov <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Peter Zijlstra (Intel) <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Miklos Szeredi <[email protected]> Cc: Theodore Ts'o <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--fs/exec.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 74f3672146a7..bf0ace3841ad 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1944,15 +1944,10 @@ EXPORT_SYMBOL(set_binfmt);
*/
void set_dumpable(struct mm_struct *mm, int value)
{
- unsigned long old, new;
-
if (WARN_ON((unsigned)value > SUID_DUMP_ROOT))
return;
- do {
- old = READ_ONCE(mm->flags);
- new = (old & ~MMF_DUMPABLE_MASK) | value;
- } while (cmpxchg(&mm->flags, old, new) != old);
+ set_mask_bits(&mm->flags, MMF_DUMPABLE_MASK, value);
}
SYSCALL_DEFINE3(execve,