All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jann Horn <jann@thejh.net>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: Daniel Micay <danielmicay@gmail.com>,
	Kees Cook <keescook@chromium.org>,
	kernel-hardening@lists.openwall.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.com>, Ingo Molnar <mingo@kernel.org>,
	Andy Lutomirski <luto@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [kernel-hardening] Re: [PATCH] fork: make whole stack_canary random
Date: Mon, 31 Oct 2016 22:22:51 +0100	[thread overview]
Message-ID: <20161031212251.GB3286@pc.thejh.net> (raw)
In-Reply-To: <87ins8rzqm.fsf@mid.deneb.enyo.de>

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]

On Mon, Oct 31, 2016 at 10:10:41PM +0100, Florian Weimer wrote:
> * Daniel Micay:
> 
> >> It makes a lot of sense on x86_64 where it means the canary is
> >> still 56 bits. Also, you want -fstack-check for protecting again
> >> stack overflows rather than stack *buffer* overflow. SSP won't
> >> really help you in that regard. Sadly, while -fstack-check now
> >> works well in GCC 6 with little performance cost, it's not really a
> 
> I think GCC still does not treat the return address push on
> architectures which have such a CALL instruction as an implicit stack
> probe.
> 
> >> complete feature (and Clang impls it as a no-op!).
> 
> How many guard pages at the end of the stack does the kernel
> guarantee?  I saw some -fstack-check-generated code which seemed to
> jump over a single guard page.

Until recently: Zero, no guard pages below stacks, stack overflow
goes straight into some other allocation.
Now: One guard page, thanks to a lot of work by Andy Lutomirski.
(I think that change is in the current 4.9-rc3 kernel, but not in
any stable kernel yet.)


> The other thing I've seen which could impact the effectiveness of
> -fstack-check: mmap *without* MAP_FIXED and a hint within stack
> allocation can create a mapping inside the stack.  That's rather
> surprising, and I'm not sure if the net result is that there actually
> is a guard page in all cases.
> 
> > Note: talking about userspace after the entropy bit. The kernel doesn't
> > really -fstack-check, at least in even slightly sane code...
> 
> There used to be lots of discussions about kernel stack sizes ...

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-10-31 21:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-31 14:04 [PATCH] fork: make whole stack_canary random Jann Horn
2016-10-31 14:04 ` [kernel-hardening] " Jann Horn
2016-10-31 16:04 ` Kees Cook
2016-10-31 16:04   ` [kernel-hardening] " Kees Cook
2016-10-31 16:29   ` Jann Horn
2016-10-31 16:29     ` Jann Horn
2016-10-31 20:45     ` Florian Weimer
2016-10-31 20:55       ` Jann Horn
2016-10-31 20:56       ` Daniel Micay
2016-10-31 21:01         ` Daniel Micay
2016-10-31 21:10           ` Florian Weimer
2016-10-31 21:21             ` Daniel Micay
2016-10-31 21:38               ` Florian Weimer
2016-10-31 22:02                 ` Daniel Micay
2016-10-31 22:11                   ` Florian Weimer
2016-10-31 21:22             ` Jann Horn [this message]
2016-10-31 21:26               ` Daniel Micay
2016-10-31 21:26               ` Florian Weimer

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=20161031212251.GB3286@pc.thejh.net \
    --to=jann@thejh.net \
    --cc=akpm@linux-foundation.org \
    --cc=danielmicay@gmail.com \
    --cc=fw@deneb.enyo.de \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mhocko@suse.com \
    --cc=mingo@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.