summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_misc.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2017-10-03 16:15:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-10-03 17:54:25 -0700
commiteb23aa0317eb1f08e8d9d36b8753d42f03b32764 (patch)
tree92eb799dc3666380cd217f8bc240177c5c02a537 /fs/binfmt_misc.c
parent83f918274e4b841d6fb817861ea0c896fba0c179 (diff)
downloadlinux-stable-eb23aa0317eb1f08e8d9d36b8753d42f03b32764.tar.gz
linux-stable-eb23aa0317eb1f08e8d9d36b8753d42f03b32764.tar.bz2
linux-stable-eb23aa0317eb1f08e8d9d36b8753d42f03b32764.zip
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/binfmt_misc.c')
-rw-r--r--fs/binfmt_misc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 203598ccb40a..babfe7bd56f0 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -205,7 +205,7 @@ static int load_misc_binary(struct linux_binprm *bprm)
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 *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);