Skip to content

Commit

Permalink
binfmt: Fix error return code in load_elf_fdpic_binary()
Browse files Browse the repository at this point in the history
Fix to return a negative error code from create_elf_fdpic_tables()
instead of 0.

Fixes: 1da177e4c3f4 ("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]
  • Loading branch information
wangyufen316 authored and kees committed Dec 2, 2022
1 parent cd57e44 commit e7f703f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/binfmt_elf_fdpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e7f703f

Please sign in to comment.