fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 28 May 2015 22:44:24 +0000 (15:44 -0700)
committerJiri Slaby <jslaby@suse.cz>
Wed, 3 Jun 2015 09:33:16 +0000 (11:33 +0200)
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: Jiri Slaby <jslaby@suse.cz>
fs/binfmt_elf.c

index ec6d0de1969464e561e4dc66a1121e559896c69c..d872fda155394100e76145339fae0f3388e244e8 100644 (file)
@@ -822,7 +822,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;
                        }
                }