mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: pageexec@freemail.hu
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ollie Wild <aaw@google.com>,
	bugme-daemon@bugzilla.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Roland McGrath <roland@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	stable@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Bug 11063][PATCH] exec: fix stack excutability without PT_GNU_STACK
Date: Fri, 11 Jul 2008 12:15:06 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0807111203140.19456@blonde.site> (raw)
In-Reply-To: <4876997B.15434.250C736@pageexec.freemail.hu>

On Thu, 10 Jul 2008, pageexec@freemail.hu wrote:
> On 10 Jul 2008 at 21:19, Hugh Dickins wrote:
> 
> > Therefore re-evaluate VM_STACK_FLAGS in setup_arg_pages, where stack
> > vm_flags used to be set, before the mprotect_fixup.  Checking through
> > our existing VM_flags, none would have changed since insert_vm_struct:
> > so this seems safer than finding a way through the personality labyrinth.
> 
> alternatively, if there's a concern of stack_vma->vm_flags manipulation
> during execve (maybe not now, but in the future or in non-ELF formats
> that also want to rely on personality bits), you could opt for a safer
> 
> 	vm_flags = vma->vm_flags | (VM_STACK_FLAGS & (VM_EXEC | VM_MAYEXEC));
> 
> to just recompute the exec rights related bits.

True.  It was a concern that crossed my mind (I was thinking particularly
of the VM_ACCOUNT flag, which gets added in once we deal with a writable
private mapping, but is set from the start here anyway), but I don't
think it's worth changing my

> > -	vm_flags = vma->vm_flags;
> > +	vm_flags = VM_STACK_FLAGS;

now that's already there in Linus' tree.  If a VM_flag gets added that
changes the picture, it might even need your line above to be changed.

Hugh

      reply	other threads:[~2008-07-11 11:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-11063-27@http.bugzilla.kernel.org/>
2008-07-09 22:28 ` [Bug 11063] New: lack of GNU_STACK header doesn't result in rwx stack on i386 Andrew Morton
     [not found] ` <20080709152716.99e9bbe7.akpm@linux-foundation.org>
2008-07-10 20:19   ` [Bug 11063][PATCH] exec: fix stack excutability without PT_GNU_STACK Hugh Dickins
2008-07-10 21:21     ` pageexec
2008-07-11 11:15       ` Hugh Dickins [this message]

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=Pine.LNX.4.64.0807111203140.19456@blonde.site \
    --to=hugh@veritas.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=aaw@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pageexec@freemail.hu \
    --cc=roland@redhat.com \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®