summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2020-01-31 07:16:52 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2020-01-31 19:30:41 +0100
commitf67ef446291a09114f979a129fa42a859c5eb595 (patch)
tree9b41db11024f2a88cae7a9beefd9d88157340c85 /fs/binfmt_elf.c
parentfs/binfmt_elf.c: smaller code generation around auxv vector fill (diff)
downloadlinux-f67ef446291a09114f979a129fa42a859c5eb595.tar.xz
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 '')
-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;