linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ELF: warn if process starts with executable stack
@ 2019-11-18 14:51 Alexey Dobriyan
  2019-11-18 17:13 ` Ben Dooks
  2019-11-18 20:54 ` Andrew Morton
  0 siblings, 2 replies; 10+ messages in thread
From: Alexey Dobriyan @ 2019-11-18 14:51 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, linux-arch, security

PT_GNU_STACK is fail open design, at least warn people that something
isn't right.

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

 fs/exec.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/fs/exec.c
+++ b/fs/exec.c
@@ -762,6 +762,13 @@ int setup_arg_pages(struct linux_binprm *bprm,
 		goto out_unlock;
 	BUG_ON(prev != vma);
 
+#ifdef CONFIG_MMU
+	if (vm_flags & VM_EXEC) {
+		pr_warn_once("process '%s'/%u started with executable stack\n",
+			     current->comm, current->pid);
+	}
+#endif
+
 	/* Move stack pages down in memory. */
 	if (stack_shift) {
 		ret = shift_arg_pages(vma, stack_shift);

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

end of thread, other threads:[~2019-12-08 16:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 14:51 [PATCH] ELF: warn if process starts with executable stack Alexey Dobriyan
2019-11-18 17:13 ` Ben Dooks
2019-11-18 20:54 ` Andrew Morton
2019-11-18 21:36   ` Alexey Dobriyan
2019-11-18 21:52   ` [PATCH] exec: " Alexey Dobriyan
2019-11-19  5:32     ` Dan Carpenter
2019-11-20 19:17     ` Will Deacon
2019-11-20 20:28       ` Eric W. Biederman
2019-11-21  9:38         ` Will Deacon
2019-12-08 16:43           ` Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).