Skip to contentSkip to conversation

fs/binfmt_elf_fdpic: fix error return code in load_elf_fdpic_binary()

PATCH New Zhen Lei 1 participant 2 messages Jul 15, 2021

Subsystems (2)
lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

v2 cover fs/binfmt_elf_fdpic: fix error return code in load_elf_fdpic_binary()

v1 --> v2:
Update the commit message.

Zhen Lei (1):
fs/binfmt_elf_fdpic: fix error return code in load_elf_fdpic_binary()

 fs/binfmt_elf_fdpic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v2 1/1 fs/binfmt_elf_fdpic: fix error return code in load_elf_fdpic_binary()

When the call to create_elf_fdpic_tables() fails, the returned error code should be propagated. However, we currently do not explicitly assign this error code to 'retval'. As a result, 0 was incorrectly returned.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
---
 fs/binfmt_elf_fdpic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/binfmt_elf_fdpic.c +3 -2
index cf4028487dcc..4efc1d6a5d22 100644
@@ -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);
Signature · 1 line
2.25.1