From: Andrew Morton <akpm@linux-foundation.org>
Date: Thu, 28 May 2015 22:44:24 +0000 (-0700)
Subject: fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2b1d3ae940acd11be44c6eced5873d47c2e00ffa;p=linux.git

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

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>
---

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 241ef68d28930..cd46e41588309 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -918,7 +918,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;
 			}
 		}