All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	security@kernel.org, ben.dooks@codethink.co.uk
Subject: Re: [PATCH] ELF: warn if process starts with executable stack
Date: Tue, 19 Nov 2019 00:36:03 +0300	[thread overview]
Message-ID: <20191118213603.GA24086@avx2> (raw)
In-Reply-To: <20191118125457.778e44dfd4740d24795484c7@linux-foundation.org>

On Mon, Nov 18, 2019 at 12:54:57PM -0800, Andrew Morton wrote:
> On Mon, 18 Nov 2019 17:51:15 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:
> 
> > PT_GNU_STACK is fail open design,
> 
> Not sure what this means.  Please expand on the motivation for this
> change.
> 
> > at least warn people that something
> > isn't right.
> 
> People who use an executable stack get a kernel splat.  How is that
> useful?

There were two stories about silent downgrade to an executable stack:

1)
compiling .S file and linking it to normal code:

	$ cat f.S
	.intel_syntax noprefix
	.text
	.globl f
	f:
	        ret

will silently add PT_GNU_STACK segment with RWE permissions

2)
closures with nested functions will require executable stack
https://nullprogram.com/blog/2019/11/15/

> > --- 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

This code is already under CONFIG_MMU. I'll resend.

  reply	other threads:[~2019-11-18 21:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191118213603.GA24086@avx2 \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=ben.dooks@codethink.co.uk \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=security@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.