binfmt: Fix error return code in load_elf_fdpic_binary()

[ Upstream commit e7f703ff2507f4e9f496da96cd4b78fd3026120c ]

Fix to return a negative error code from create_elf_fdpic_tables()
instead of 0.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/1669945261-30271-1-git-send-email-wangyufen@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Wang Yufen 2022-12-02 09:41:01 +08:00 committed by Greg Kroah-Hartman
parent 33933af45d
commit 52ba5b87a3

View File

@ -435,8 +435,9 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
current->mm->start_stack = current->mm->start_brk + stack_size; current->mm->start_stack = current->mm->start_brk + stack_size;
#endif #endif
if (create_elf_fdpic_tables(bprm, current->mm, retval = create_elf_fdpic_tables(bprm, current->mm, &exec_params,
&exec_params, &interp_params) < 0) &interp_params);
if (retval < 0)
goto error; goto error;
kdebug("- start_code %lx", current->mm->start_code); kdebug("- start_code %lx", current->mm->start_code);