ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Kees Cook <keescook@chromium.org>
Cc: Emily Ratliff <eratliff@linuxfoundation.org>,
	"ksummit-discuss@lists.linuxfoundation.org"
	<ksummit-discuss@lists.linuxfoundation.org>
Subject: Re: [Ksummit-discuss] [TECH TOPIC] Kernel Hardening
Date: Mon, 24 Aug 2015 13:09:01 -0700	[thread overview]
Message-ID: <1440446941.2201.32.camel@HansenPartnership.com> (raw)
In-Reply-To: <CAGXu5j+XR7TJSgbTNYhCP0YhvvNwA5HtEL=xKCR9GUttzb06Uw@mail.gmail.com>

On Mon, 2015-08-24 at 09:35 -0700, Kees Cook wrote:
> On Mon, Aug 24, 2015 at 5:29 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Mon, Aug 24, 2015 at 6:20 AM, James Morris <jmorris@namei.org> wrote:
> >
> >> There are also potentially promising approaches to mitigation with other
> >> technologies such as KASan and gcc plugins, as well as evolving hardware
> >> features.
> >
> > What I've discovered when running KASan the last few weeks is that
> > this points back to the question of tests ... I've been using Trinity
> > to find bugs, but it is more likely to kill itself or cause OOM than
> > trigger any boundary overrun bugs.
> >
> > Kselftest may be helpful, but basically any loads that heavily
> > exercise the kernel internals are helpful to harden the kernel.
> > Some of these are custom test suites I suspect. Any good hints
> > for a simple embedded developer like me?
> 
> I agree with the sentiment here, but not with the language. Finding
> flaws (which is what selftests, KASan, Trinity, etc do) isn't
> hardening. Hardening is stopping the exploitation of flaws.

Um, forgive me for being dense, but doesn't fixing the flaws stop their
exploitation?  In any event, Hardening means "reducing the attack
surface" and that encompasses both active and passive means (including
actual bug fixing).

>  The
> hardening the kernel needs is about taking away exploitation tools,
> not killing bugs. (Though killing bugs is still great.)

It's both.  One of the old standards for attacking C code was buffer
overruns.  Remove those via detection tools and you reduce the attack
surface.

> As an example, making the kernel code memory read-only means an
> attacker cannot just directly change the kernel's execution path when
> they use an arbitrary memory-writing flaw. (This feature is mostly
> enabled via CONFIG_DEBUG_RODATA, and was very recently added to ARM,
> though isn't at 100% coverage for all the physical memory aliases.)

Yes, I like this one a lot.  Adding mechanisms that don't increase
complexity like this are good active means.  However, I become less
enamoured of things like selinux and grsecurity which add complexity in
the name of active attack surface reduction.  That's not to say never do
it, it's just to say that attack surface is directly related to
complexity.

James

  reply	other threads:[~2015-08-24 20:09 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24  4:20 James Morris
2015-08-24 11:46 ` Jiri Kosina
2015-08-24 11:56   ` James Morris
2015-08-24 17:17     ` Kees Cook
2015-08-24 17:28       ` Andy Lutomirski
2015-08-24 17:39         ` Julia Lawall
2015-08-24 18:01         ` Kees Cook
2015-08-24 18:19           ` Andy Lutomirski
2015-08-24 18:57             ` Kees Cook
2015-08-24 18:52       ` Thomas Gleixner
2015-08-24 18:59         ` Thomas Gleixner
2015-08-24 19:00         ` Kees Cook
2015-08-24 22:05           ` Greg KH
2015-08-25  0:51             ` Rafael J. Wysocki
2015-08-31 20:10             ` Eric W. Biederman
2015-08-31 20:22               ` josh
2015-08-26 20:51       ` Kees Cook
2015-08-26 21:10         ` Matthew Garrett
2015-08-30  0:41           ` [Ksummit-discuss] Self nomination Matthew Garrett
2015-08-24 11:48 ` [Ksummit-discuss] [TECH TOPIC] Kernel Hardening Jiri Kosina
2015-08-24 12:29 ` Linus Walleij
2015-08-24 12:51   ` Jason Cooper
2015-08-24 16:35   ` Kees Cook
2015-08-24 20:09     ` James Bottomley [this message]
2015-08-24 20:17       ` James Morris
2015-08-24 20:46         ` Thomas Gleixner
2015-08-24 22:22           ` James Morris
2015-08-24 23:20             ` Kees Cook
2015-08-24 23:54               ` Theodore Ts'o
2015-08-25  0:06                 ` James Morris
2015-08-25  0:06                 ` Kees Cook
2015-08-27 22:08                   ` [Ksummit-discuss] grsecurity and kernel hardening Stephen Hemminger
2015-08-27 22:49                     ` James Bottomley
2015-08-27 23:03                       ` Stephen Hemminger
2015-08-24 23:04           ` [Ksummit-discuss] [TECH TOPIC] Kernel Hardening Kees Cook
2015-08-25 16:45           ` Luis R. Rodriguez
2015-08-24 22:57         ` Kees Cook
2015-08-24 23:25           ` Kees Cook
2015-08-24 20:28       ` josh
2015-08-24 22:55       ` Kees Cook
2015-08-24 23:13         ` Andy Lutomirski
2015-08-31 20:58         ` Eric W. Biederman
2015-09-01  9:03           ` Jiri Kosina
2015-09-01 16:52             ` Kees Cook
2015-09-01 16:50           ` Kees Cook
2015-08-25 15:15     ` Shuah Khan
2015-08-25 16:15       ` Kees Cook
2015-08-25 16:30       ` Mark Brown
2015-08-25 16:33         ` Kees Cook
2015-08-25 16:58         ` Shuah Khan
2015-09-22 12:24     ` Dan Carpenter
2015-09-22 12:55       ` Yves-Alexis Perez
2015-09-22 12:59       ` Julia Lawall
2015-09-22 18:02         ` Andy Lutomirski
2015-08-24 16:20 ` Aneesh Kumar K.V
2015-08-24 17:19   ` Kees Cook
2015-08-24 18:50     ` James Morris

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=1440446941.2201.32.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=eratliff@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=ksummit-discuss@lists.linuxfoundation.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