lkml.org 
[lkml]   [2019]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ELF: fix ->start_code calculation
Only executable segments should be accounted to ->start_code
just like they do to ->end_code (correctly).

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

fs/binfmt_elf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -997,7 +997,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
}
}
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;
\
 
 \ /
  Last update: 2019-12-08 18:15    [W:0.020 / U:3.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site