Commit f06ca7b4 authored by Andrew Morton's avatar Andrew Morton Committed by Luis Henriques

fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings

commit 2b1d3ae9 upstream.

load_elf_binary() returns `retval', not `error'.

Fixes: a87938b2 ("fs/binfmt_elf.c: fix bug in loading of PIE binaries")
Reported-by: default avatarJames Hogan <james.hogan@imgtec.com>
Cc: Michael Davidson <md@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent ba55aba5
...@@ -820,7 +820,7 @@ static int load_elf_binary(struct linux_binprm *bprm) ...@@ -820,7 +820,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
total_size = total_mapping_size(elf_phdata, total_size = total_mapping_size(elf_phdata,
loc->elf_ex.e_phnum); loc->elf_ex.e_phnum);
if (!total_size) { if (!total_size) {
error = -EINVAL; retval = -EINVAL;
goto out_free_dentry; goto out_free_dentry;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment