]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.14.44/fs-binfmt_elf.c-load_elf_binary-return-einval-on-zero-length-mappings.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 3.14.44 / fs-binfmt_elf.c-load_elf_binary-return-einval-on-zero-length-mappings.patch
CommitLineData
c5ac8acd
GKH
1From 2b1d3ae940acd11be44c6eced5873d47c2e00ffa Mon Sep 17 00:00:00 2001
2From: Andrew Morton <akpm@linux-foundation.org>
3Date: Thu, 28 May 2015 15:44:24 -0700
4Subject: fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings
5
6From: Andrew Morton <akpm@linux-foundation.org>
7
8commit 2b1d3ae940acd11be44c6eced5873d47c2e00ffa upstream.
9
10load_elf_binary() returns `retval', not `error'.
11
12Fixes: a87938b2e246b81b4fb ("fs/binfmt_elf.c: fix bug in loading of PIE binaries")
13Reported-by: James Hogan <james.hogan@imgtec.com>
14Cc: Michael Davidson <md@google.com>
15Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
16Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19---
20 fs/binfmt_elf.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23--- a/fs/binfmt_elf.c
24+++ b/fs/binfmt_elf.c
25@@ -819,7 +819,7 @@ static int load_elf_binary(struct linux_
26 total_size = total_mapping_size(elf_phdata,
27 loc->elf_ex.e_phnum);
28 if (!total_size) {
29- error = -EINVAL;
30+ retval = -EINVAL;
31 goto out_free_dentry;
32 }
33 }