Merge tag 'kconfig-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-2.6-block.git] / fs / exec.c
index 74f3672146a7e208b75488f0a8861a6ee0c05b5d..2e0033348d8e10c02a5c3928caec876798edb1fd 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1563,7 +1563,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm)
 
 /*
  * Fill the binprm structure from the inode.
- * Check permissions, then read the first 128 (BINPRM_BUF_SIZE) bytes
+ * Check permissions, then read the first BINPRM_BUF_SIZE bytes
  *
  * This may be called multiple times for binary chains (scripts for example).
  */
@@ -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,