diff mbox series

[1/2] coredump: use READ_ONCE to read mm->flags

Message ID 20190301035550.1124-2-aarcange@redhat.com (mailing list archive)
State New, archived
Headers show
Series RFC: READ/WRITE_ONCE vma/mm cleanups | expand

Commit Message

Andrea Arcangeli March 1, 2019, 3:55 a.m. UTC
mm->flags can still change freely under the coredump using atomic
bitops in proc_coredump_filter_write(). So read the mm->flags with
READ_ONCE for correctness.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---
 fs/coredump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/coredump.c b/fs/coredump.c
index e42e17e55bfd..cc175d52090a 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -560,7 +560,7 @@  void do_coredump(const kernel_siginfo_t *siginfo)
 		 * inconsistency of bit flags, since this flag is not protected
 		 * by any locks.
 		 */
-		.mm_flags = mm->flags,
+		.mm_flags = READ_ONCE(mm->flags),
 	};
 
 	audit_core_dumps(siginfo->si_signo);