All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 31/51] exec: binfmt_misc: remove the confusing e->interp_file != NULL checks
@ 2017-10-03 23:15 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-10-03 23:15 UTC (permalink / raw)
  To: torvalds, mm-commits, akpm, oleg, foraker1, James.Bottomley,
	keescook, tdhooge, tgummels, viro, woodard

From: Oleg Nesterov <oleg@redhat.com>
Subject: exec: binfmt_misc: remove the confusing e->interp_file != NULL checks

If MISC_FMT_OPEN_FILE flag is set e->interp_file must be valid or we have
a bug which should not be silently ignored.

Link: http://lkml.kernel.org/r/20170922143647.GA17222@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Ben Woodard <woodard@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jim Foraker <foraker1@llnl.gov>
Cc: <tdhooge@llnl.gov>
Cc: Travis Gummels <tgummels@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/binfmt_misc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN fs/binfmt_misc.c~exec-binfmt_misc-remove-the-confusing-e-interp_file-=-null-checks fs/binfmt_misc.c
--- a/fs/binfmt_misc.c~exec-binfmt_misc-remove-the-confusing-e-interp_file-=-null-checks
+++ a/fs/binfmt_misc.c
@@ -205,7 +205,7 @@ static int load_misc_binary(struct linux
 	if (retval < 0)
 		goto error;
 
-	if (fmt->flags & MISC_FMT_OPEN_FILE && fmt->interp_file) {
+	if (fmt->flags & MISC_FMT_OPEN_FILE) {
 		interp_file = filp_clone_open(fmt->interp_file);
 		if (!IS_ERR(interp_file))
 			deny_write_access(interp_file);
@@ -596,7 +596,7 @@ static void bm_evict_inode(struct inode
 {
 	Node *e = inode->i_private;
 
-	if ((e->flags & MISC_FMT_OPEN_FILE) && e->interp_file)
+	if (e->flags & MISC_FMT_OPEN_FILE)
 		filp_close(e->interp_file, NULL);
 
 	clear_inode(inode);
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-03 23:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-03 23:15 [patch 31/51] exec: binfmt_misc: remove the confusing e->interp_file != NULL checks akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.