summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2020-01-30 22:16:52 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-01-31 10:30:41 -0800
commitf67ef446291a09114f979a129fa42a859c5eb595 (patch)
tree9b41db11024f2a88cae7a9beefd9d88157340c85 /fs/binfmt_elf.c
parent1f83d80677a24ae737fe0ab4008e7c72b8a33b35 (diff)
downloadlinux-f67ef446291a09114f979a129fa42a859c5eb595.tar.gz
linux-f67ef446291a09114f979a129fa42a859c5eb595.tar.bz2
linux-f67ef446291a09114f979a129fa42a859c5eb595.zip
fs/binfmt_elf.c: fix ->start_code calculation
Only executable segments should be accounted to ->start_code just like they do to ->end_code (correctly). Link: http://lkml.kernel.org/r/20191208171410.GB19716@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/binfmt_elf.c')
-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 7bb0deb5bf3b..59013f319f54 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -999,7 +999,7 @@ out_free_interp:
}
}
k = elf_ppnt->p_vaddr;
- if (k < start_code)
+ if ((elf_ppnt->p_flags & PF_X) && k < start_code)
start_code = k;
if (start_data < k)
start_data = k;