Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1737534
| From | Oleg Nesterov <oleg@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/5] exec: binfmt_misc: remove the confusing e->interp_file != NULL checks |
| Date | 2017-09-22 16:40 +0200 |
| Message-ID | <usxhw-7bZ-19@gated-at.bofh.it> (permalink) |
| References | <usxhw-7bZ-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
fs/binfmt_misc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 040ed26..45809c6 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);
@@ -593,7 +593,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);
--
2.5.0
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 3/5] exec: binfmt_misc: remove the confusing e->interp_file != NULL checks Oleg Nesterov <oleg@redhat.com> - 2017-09-22 16:40 +0200
csiph-web