Commit 26e15225 authored by Vineet Gupta's avatar Vineet Gupta Committed by Linus Torvalds

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.comSigned-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
Reviewed-by: default avatarAnthony Yznaga <anthony.yznaga@oracle.com>
Acked-by: default avatarOleg 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 67ceb1ec
...@@ -1944,15 +1944,10 @@ EXPORT_SYMBOL(set_binfmt); ...@@ -1944,15 +1944,10 @@ EXPORT_SYMBOL(set_binfmt);
*/ */
void set_dumpable(struct mm_struct *mm, int value) void set_dumpable(struct mm_struct *mm, int value)
{ {
unsigned long old, new;
if (WARN_ON((unsigned)value > SUID_DUMP_ROOT)) if (WARN_ON((unsigned)value > SUID_DUMP_ROOT))
return; return;
do { set_mask_bits(&mm->flags, MMF_DUMPABLE_MASK, value);
old = READ_ONCE(mm->flags);
new = (old & ~MMF_DUMPABLE_MASK) | value;
} while (cmpxchg(&mm->flags, old, new) != old);
} }
SYSCALL_DEFINE3(execve, SYSCALL_DEFINE3(execve,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment