summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2015-05-28 15:44:24 -0700
committerLuis Henriques <luis.henriques@canonical.com>2015-06-03 14:30:08 +0100
commitf06ca7b48865e51bb1e5491621da558136f11d8a (patch)
tree904677dc21adbc5e68363949fc2b1732b7026160
parentba55aba5bd7b051884e5ae85ada247f41695e262 (diff)
downloadlinux-stable-f06ca7b48865e51bb1e5491621da558136f11d8a.tar.gz
linux-stable-f06ca7b48865e51bb1e5491621da558136f11d8a.tar.bz2
linux-stable-f06ca7b48865e51bb1e5491621da558136f11d8a.zip
fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings
commit 2b1d3ae940acd11be44c6eced5873d47c2e00ffa upstream. load_elf_binary() returns `retval', not `error'. Fixes: a87938b2e246b81b4fb ("fs/binfmt_elf.c: fix bug in loading of PIE binaries") Reported-by: James Hogan <james.hogan@imgtec.com> Cc: Michael Davidson <md@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
-rw-r--r--fs/binfmt_elf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 44bdf7b200c3..c13a138c1016 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -820,7 +820,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
total_size = total_mapping_size(elf_phdata,
loc->elf_ex.e_phnum);
if (!total_size) {
- error = -EINVAL;
+ retval = -EINVAL;
goto out_free_dentry;
}
}