From: Daniel Micay <danielmicay@gmail.com>
To: Solar Designer <solar@openwall.com>, Greg KH <greg@kroah.com>
Cc: Matt Brown <matt@nmatt.com>, kernel-hardening@lists.openwall.com
Subject: Re: [kernel-hardening] [PATCH v1 1/1] Add Trusted Path Execution as a stackable LSM
Date: Sat, 03 Jun 2017 13:16:40 -0400 [thread overview]
Message-ID: <1496510200.29378.1.camel@gmail.com> (raw)
In-Reply-To: <20170603162231.GA20590@openwall.com>
On Sat, 2017-06-03 at 18:22 +0200, Solar Designer wrote:
> On Sat, Jun 03, 2017 at 05:59:20PM +0200, Greg KH wrote:
> > But for those systems, and this feature as well, can't a "simple"
> > apparmor policy do the exact same thing? Also, I'm sure the SELinux
> > can
> > do this as well, but I don't know the config language there as well.
> >
> > So I think this is already a feature that is supported, it just
> > takes a
> > bit more configuration work on the admin.
>
> Yes, that's "a bit" more effort up to the point where almost(?) no one
> would bother. Sometimes simple features can reasonably co-exist with
> more general frameworks that could also be used to achieve the effect.
> So I don't view this as a sufficiently good argument against TPE as a
> feature on its own.
>
> Alexander
Some thoughts on this, veering a bit into some loosely related topics:
SELinux can cover the same kind of stuff as PaX MPROTECT (execmem,
execheap, execstack, execmod) and grsecurity TPE (execute and
execute_no_trans). Android uses it to enforce comparable rules for most
of the SELinux domains in the base system, but the Android Runtime JIT
and Chromium JIT (particularly in the WebView) block the equivalent to
MPROTECT for much of the app layer and Play Services violates rules
comparable to TPE in the app layer too. In CopperheadOS, it's taken to
completion because the WebView sandbox is force enabled and the Android
Runtime is set to use full ahead-of-time compilation without the JIT.
Nothing violates the equivalent to the TPE rules in the Android Open
Source Project. The domain for the Chromium sandbox is the only one with
execmem and only the privileged base system really violates the TPE
style guarantees (system_server/installd can install an app and run it
in one of the app domains at the very least).
Beyond these features, there's also a distinction between code from
verified/trusted partitions (i.e. covered by dm-verity) and from
partitions that hold persistent state rather than being pristine
verified OS partitions. There's more to "trust" than just whether only
root or root / current user can write there. Android *mostly* forbids
the base system from executing code from outside of those verified
partitions too, but it falls a bit short and that's something else
that's finished off in CopperheadOS. I wouldn't go as far as to say it
makes verified boot work well for anything beyond the usual guarantees
for factory resets though. There's still a lot of trust in persistent
state, just not code executed from it by the base system. The SELinux
label usage also needs to be audited to make sure that an attacker can't
persist unverified SELinux labels that are not replaced. Verified boot
is really hard to do in a meaningful way. ChromeOS weakened it via
having an Android userspace in a container since the guarantees dropped
to those of Android there.
I see why people want lightweight, independent implementations of these
features but I don't have a use for it anymore. I'm used to having great
full system SELinux policies as a baseline from the Android Open Source
Project and being able to tweak those existing policies to accomplish
targeted goals like these. It provides much finer-grained control so it
can do a lot more and compatibility is easier. The one thing it isn't
capable of dealing with on Android is a dynamic toggle because Android
uses a static SELinux policy. It's not possible to have a toggle for
things like debugging features exposed via toggles over ADB that doesn't
at least require respawning processes to get them into a different debug
domain. That's why perf_event_paranoid=3 is needed for Android even if
an LSM hook is added there and why ptrace_scope=2 in CopperheadOS does
something that SELinux (on Android) and seccomp-bpf can't accomplish. On
the other hand, I don't really have any use for TPE since doing it with
SELinux doesn't interfere with debugging so a toggle isn't needed.
There's always the option of making a stub SELinux policy used for
little more than covering similar ground to MPROTECT and TPE if that is
really all someone wants. The policy would be tiny. There can be one
domain for nearly everything and one for an exception from the rules.
The labelling would be simple too. I'm curious how minimal that could
be, but focusing on only those specific micro issues is probably not
something people are going to do in practice.
next prev parent reply other threads:[~2017-06-03 17:16 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-03 5:53 [kernel-hardening] [PATCH v1 1/1] Add Trusted Path Execution as a stackable LSM Matt Brown
2017-06-03 5:53 ` Matt Brown
2017-06-03 5:53 ` Matt Brown
2017-06-03 6:33 ` [kernel-hardening] " Al Viro
2017-06-03 6:33 ` Al Viro
2017-06-03 6:33 ` Al Viro
2017-06-04 5:24 ` [kernel-hardening] " Matt Brown
2017-06-04 5:24 ` Matt Brown
2017-06-04 5:24 ` Matt Brown
2017-06-04 5:47 ` [kernel-hardening] " Eric Biggers
2017-06-04 5:47 ` Eric Biggers
2017-06-04 12:43 ` Matt Brown
2017-06-04 12:43 ` Matt Brown
2017-06-04 6:51 ` Al Viro
2017-06-04 6:51 ` Al Viro
2017-06-04 6:51 ` Al Viro
2017-06-03 10:39 ` [kernel-hardening] " Jann Horn
2017-06-03 10:39 ` Jann Horn
2017-06-03 22:30 ` Matt Brown
2017-06-03 22:30 ` Matt Brown
2017-06-03 15:47 ` Solar Designer
2017-06-03 15:59 ` Greg KH
2017-06-03 16:22 ` Solar Designer
2017-06-03 17:16 ` Daniel Micay [this message]
2017-06-03 22:02 ` Nicolas Belouin
2017-06-03 21:55 ` Corey Henderson
2017-06-03 16:13 ` Solar Designer
2017-06-05 14:41 ` Matt Brown
2017-06-05 15:23 ` Solar Designer
2017-06-04 16:43 ` Mickaël Salaün
2017-06-04 22:07 ` Mickaël Salaün
2017-06-05 15:30 ` [kernel-hardening] " Alan Cox
2017-06-05 15:30 ` Alan Cox
2017-06-05 15:30 ` Alan Cox
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=1496510200.29378.1.camel@gmail.com \
--to=danielmicay@gmail.com \
--cc=greg@kroah.com \
--cc=kernel-hardening@lists.openwall.com \
--cc=matt@nmatt.com \
--cc=solar@openwall.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 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.