diff mbox series

[1/3] coredump: Replace opencoded set_mask_bits()

Message ID 1547166387-19785-2-git-send-email-vgupta@synopsys.com (mailing list archive)
State New, archived
Headers show
Series [1/3] coredump: Replace opencoded set_mask_bits() | expand

Commit Message

Vineet Gupta Jan. 11, 2019, 12:26 a.m. UTC
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/g/20150807115710.GA16897@redhat.com
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
 fs/exec.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Anthony Yznaga Jan. 11, 2019, 4:24 a.m. UTC | #1
On 1/10/19 4:26 PM, Vineet Gupta wrote:
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: linux-fsdevel@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Link: http://lkml.kernel.org/g/20150807115710.GA16897@redhat.com
> Acked-by: Oleg Nesterov <oleg@redhat.com>
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

Reviewed-by: Anthony Yznaga <anthony.yznaga@oracle.com>
diff mbox series

Patch

diff --git a/fs/exec.c b/fs/exec.c
index fb72d36f7823..df7f05362283 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,