[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20201116140644.2360816-1-chengzhihao1@huawei.com>
Date: Mon, 16 Nov 2020 22:06:44 +0800
From: Zhihao Cheng <chengzhihao1@...wei.com>
To: <viro@...iv.linux.org.uk>
CC: <linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-mm@...ck.org>
Subject: [PATCH v2] binfmt_elf_fdpic: return corresponding errcode if create_elf_fdpic_tables() fail
Function load_elf_fdpic_binary() may return 0 to caller if
create_elf_fdpic_tables() fail, which will misslead caller
to continue running without handling errors.
Fixes: 1da177e4c3f41524e886 ("Linux-2.6.12-rc2")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Zhihao Cheng <chengzhihao1@...wei.com>
---
fs/binfmt_elf_fdpic.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index be4062b8ba75..6243abf3f8f3 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -434,8 +434,9 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
current->mm->start_stack = current->mm->start_brk + stack_size;
#endif
- if (create_elf_fdpic_tables(bprm, current->mm,
- &exec_params, &interp_params) < 0)
+ retval = create_elf_fdpic_tables(bprm, current->mm,
+ &exec_params, &interp_params);
+ if (retval < 0)
goto error;
kdebug("- start_code %lx", current->mm->start_code);
--
2.25.4
Powered by blists - more mailing lists