mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: John Richard Moser <nigelenki@comcast.net>
Cc: Brandon Hale <brandon@smarterits.com>,
	ubuntu-hardened@lists.ubuntu.com, linux-kernel@vger.kernel.org
Subject: Re: [ubuntu-hardened] Re: Collecting NX information
Date: Tue, 29 Mar 2005 21:34:49 +0200	[thread overview]
Message-ID: <1112124890.6282.99.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <4249A78A.1040407@comcast.net>

On Tue, 2005-03-29 at 14:07 -0500, John Richard Moser wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> 
> Arjan van de Ven wrote:
> >>>Hmmmm you either need an executable stack or you don't. Can you explain
> >>>why you think there is a strong advantage for a "neutral" setting on
> >>>this one?
> >>>
> >>
> >>As I said, compatibility mode.  The toolchain should not emit
> >>*everything* PT_GNU_STACK and leave it up to you to de-mark it; instead,
> >>everything should be emitted without PT_GNU_STACK set, in which case
> >>violating code would die.
> > 
> > 
> > actually right now the toolchain marks things automatically correct.
> > If gcc emits a stack trampoline, it gets marked needing executable
> > stack, if gcc can prove it doesn't need executable stack, it gets marked
> > as such as well. 
> > 
> 
> And the toolchain emits a -E library with PT_PAX_FLAGS if there's a
> stack trampoline :)  But it's defficient right now, doesn't inherit when
> you link to a library with -E. . . you can fix that right?  :)

it's inherited for PT_GNU_STACK though.
Not sure how you implemented PT_PAX_FLAGS, but for PT_GNU_STACK it's
inherited.

> > I *really* don't understand why you want to get away from automatic
> > marking to something manual, which *has* to be more fragile.
> > 
> 
> /me shrugs.  It's a security blanket for him mostly; he fears automagic
> security maintainence.

who is "him" ?

> 
> > 
> >>Remember also I'm very much against "let the compiler guess if you need
> >>an executable stack"
> > 
> > 
> > it's not guessing. the *compiler* emits the stack trampoline. So the
> > *compiler* knows that it needs that stack.
> > 
> 
> With a trampoline, things like Grub and a few libs need PT_GNU_STACK.

sure they do. There's about a handful in an entire distro.

> 
> Of course you can't just suddenly say "OH!  Well PT_GNU_STACK should do
> this instead!" because you'll break everything.

I'm not a fan of any kind of emutrampoline. At all. But I am open to
others making a different tradeoff; for me the option to have a
trampoline at all is just a bypass of the non-exec stack... legit bypass
one hopes but a bypass regardless. Some time ago we did an eval of how
much stuff would need the emutramp (well or something equivalent) and
the list was so small that I decided that the added risk and complexity
were not worth it and that I rather had those 5 or so apps run with exec
stack.

> > again what does tristate mean.. "I don't know" ? But gcc does know, with
> > very very very few exceptions. Eg old mono is the exception because it
> > didn't do a proper mprotect. Saying "I don't know" doesn't solve you
> > anything, since in the end there needs to be a policy enforced anyway,
> > it's just postponing the inevitable to a point with less knowledge.
> > 
> 
> Remember I'm also thinking of restricted mprotect() situations as well,
> because I'm trying to get it to the point where one set of markings has
> a predictable effect on any kernel, be it vanilla, pax, or ES.

well that is an entirely independent thing again. Really.
I think mixing all these into one big flag is a mistake. 
(And thats a lesson I learned the hard way, but Linus was right; don't
mix independent things into one flag artificially. Extra flags are
cheap. Don't complicate the world for a dozen bytes.)





  parent reply	other threads:[~2005-03-29 19:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-28 18:21 John Richard Moser
2005-03-28 18:37 ` Arjan van de Ven
2005-03-28 18:50   ` John Richard Moser
2005-03-28 18:55     ` Arjan van de Ven
2005-03-28 19:14       ` John Richard Moser
2005-03-28 20:54         ` [ubuntu-hardened] " Brandon Hale
2005-03-28 22:17           ` John Richard Moser
2005-03-29  7:16             ` Arjan van de Ven
2005-03-29  7:53               ` John Richard Moser
2005-03-29  8:09                 ` Arjan van de Ven
     [not found]                   ` <424911FF.1080702@comcast.net>
2005-03-29  8:46                     ` Arjan van de Ven
     [not found]                       ` <42499C40.5030202@comcast.net>
     [not found]                         ` <1112121756.6282.88.camel@laptopd505.fenrus.org>
     [not found]                           ` <4249A78A.1040407@comcast.net>
2005-03-29 19:34                             ` Arjan van de Ven [this message]
2005-03-29 20:41                               ` John Richard Moser
2005-03-29  8:45                 ` John Richard Moser
2005-03-29  8:15               ` John Richard Moser

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=1112124890.6282.99.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=brandon@smarterits.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nigelenki@comcast.net \
    --cc=ubuntu-hardened@lists.ubuntu.com \
    /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®