Thread (7 messages) 7 messages, 2 authors, 2014-02-25

[PATCH 3/3] exec: kill the unnecessary mm->def_flags setting in load_elf_binary()

STALE4603d

From: Alex Thorlton <hidden>
Date: 2014-02-25 20:54:27
Also in: linux-mm, lkml
Subsystem: exec & binfmt api, elf, filesystems (vfs and infrastructure), the rest · Maintainers: Kees Cook, Alexander Viro, Christian Brauner, Linus Torvalds

load_elf_binary() sets current->mm->def_flags = def_flags and
def_flags is always zero. Not only this looks strange, this is
unnecessary because mm_init() has already set ->def_flags = 0. 

Signed-off-by: Alex Thorlton <redacted>
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Cc: Gerald Schaefer <redacted>
Cc: Martin Schwidefsky <redacted>
Cc: Heiko Carstens <redacted>
Cc: Christian Borntraeger <redacted>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Kirill A. Shutemov" <redacted>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <redacted>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "Aneesh Kumar K.V" <redacted>
Cc: Bob Liu <redacted>
Cc: Jiang Liu <redacted>
Cc: Andrea Arcangeli <redacted>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <redacted>
Cc: Daeseok Youn <redacted>
Cc: Kent Overstreet <redacted>
Cc: Dario Faggioli <redacted>
Cc: John Stultz <redacted>
Cc: Stephen Rothwell <redacted>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: linux-api@vger.kernel.org

---
 fs/binfmt_elf.c | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 67be295..d09bd9c 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -579,7 +579,6 @@ static int load_elf_binary(struct linux_binprm *bprm)
 	unsigned long start_code, end_code, start_data, end_data;
 	unsigned long reloc_func_desc __maybe_unused = 0;
 	int executable_stack = EXSTACK_DEFAULT;
-	unsigned long def_flags = 0;
 	struct pt_regs *regs = current_pt_regs();
 	struct {
 		struct elfhdr elf_ex;
@@ -719,9 +718,6 @@ static int load_elf_binary(struct linux_binprm *bprm)
 	if (retval)
 		goto out_free_dentry;
 
-	/* OK, This is the point of no return */
-	current->mm->def_flags = def_flags;
-
 	/* Do this immediately, since STACK_TOP as used in setup_arg_pages
 	   may depend on the personality.  */
 	SET_PERSONALITY(loc->elf_ex);
-- 
1.7.12.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help