Skip to content

Commit e7f703f

Browse files
wangyufen316kees
authored andcommitted
binfmt: Fix error return code in load_elf_fdpic_binary()
Fix to return a negative error code from create_elf_fdpic_tables() instead of 0. Fixes: 1da177e ("Linux-2.6.12-rc2") Cc: [email protected] Signed-off-by: Wang Yufen <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent cd57e44 commit e7f703f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/binfmt_elf_fdpic.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,9 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
434434
current->mm->start_stack = current->mm->start_brk + stack_size;
435435
#endif
436436

437-
if (create_elf_fdpic_tables(bprm, current->mm,
438-
&exec_params, &interp_params) < 0)
437+
retval = create_elf_fdpic_tables(bprm, current->mm, &exec_params,
438+
&interp_params);
439+
if (retval < 0)
439440
goto error;
440441

441442
kdebug("- start_code %lx", current->mm->start_code);

0 commit comments

Comments
 (0)