Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.cz>2017-10-11 11:04:14 +0200
committerJiri Kosina <jkosina@suse.cz>2017-10-11 14:30:40 +0200
commit294ccfe108a81dbedc6419f3587e67fe6eac8b49 (patch)
treedf9927067d5b6abb6f3ab44e878ed9c188f6d44b
parent924c4824ff97cfa2ee49ec0ff1ca3154bded7865 (diff)
fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-lengthrpm-3.0.101-108.13
mappings (bnc#1059525).
-rw-r--r--patches.fixes/fs-binfmt_elf.c-load_elf_binary-return-EINVAL-on-zer.patch38
-rw-r--r--series.conf1
2 files changed, 39 insertions, 0 deletions
diff --git a/patches.fixes/fs-binfmt_elf.c-load_elf_binary-return-EINVAL-on-zer.patch b/patches.fixes/fs-binfmt_elf.c-load_elf_binary-return-EINVAL-on-zer.patch
new file mode 100644
index 0000000000..4a0b75895f
--- /dev/null
+++ b/patches.fixes/fs-binfmt_elf.c-load_elf_binary-return-EINVAL-on-zer.patch
@@ -0,0 +1,38 @@
+From 2b1d3ae940acd11be44c6eced5873d47c2e00ffa Mon Sep 17 00:00:00 2001
+From: Andrew Morton <akpm@linux-foundation.org>
+Date: Thu, 28 May 2015 15:44:24 -0700
+Subject: [PATCH] fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on
+ zero-length mappings
+Git-commit: 2b1d3ae940acd11be44c6eced5873d47c2e00ffa
+Patch-mainline: 4.1-rc6
+References: bnc#1059525
+
+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>
+Acked-by: Michal Hocko <mhocko@suse.com>
+
+---
+ fs/binfmt_elf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
+index 241ef68d2893..cd46e4158830 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;
+ }
+ }
+--
+1.8.5.6
+
diff --git a/series.conf b/series.conf
index 3abce89814..6ac30ae0f4 100644
--- a/series.conf
+++ b/series.conf
@@ -1953,6 +1953,7 @@
patches.fixes/fs-exec.c-account-for-argv-envp-pointers.patch
patches.fixes/fs-binfmt_elf.c-fix-bug-in-loading-of-PIE-binaries.patch
+ patches.fixes/fs-binfmt_elf.c-load_elf_binary-return-EINVAL-on-zer.patch
# Please put all VM/FS patches which are not tmpfs/shmem related
# above