All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] elf: fix "start_code" evaluation
@ 2019-05-23 17:57 Alexey Dobriyan
  2019-05-23 18:44 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2019-05-23 17:57 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

Only executable ELF program headers should change ->start_code.

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
@@ -1026,7 +1026,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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-23 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 17:57 [PATCH] elf: fix "start_code" evaluation Alexey Dobriyan
2019-05-23 18:44 ` Andrew Morton
2019-05-23 19:35   ` Alexey Dobriyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.