All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Solar Designer <solar@openwall.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, 3 Jun 2017 17:59:20 +0200	[thread overview]
Message-ID: <20170603155920.GA25740@kroah.com> (raw)
In-Reply-To: <20170603154707.GA19161@openwall.com>

On Sat, Jun 03, 2017 at 05:47:07PM +0200, Solar Designer wrote:
> On Sat, Jun 03, 2017 at 01:53:51AM -0400, Matt Brown wrote:
> > This patch was modified from Brad Spengler's Trusted Path Execution (TPE)
> > feature in Grsecurity and also incorporates logging ideas from
> > cormander's tpe-lkm.
> > 
> > Modifications from the Grsecurity implementation of TPE were made to
> > turn it into a stackable LSM using the existing LSM hook bprm_set_creds.
> > Also, denial messages were improved by including the full path of the
> > disallowed program. (This idea was taken from cormander's tpe-lkm)
> > 
> > Trusted Path Execution is not a new idea:
> > 
> > http://phrack.org/issues/52/6.html#article
> 
> FWIW, I think this is mostly a misfeature, which I deliberately didn't
> merge into -ow patches back then.

I agree with this :)

> > This option enables Trusted Path Execution. TPE blocks *untrusted*
> > users from executing files that meet the following conditions:
> > 
> > * file is not in a root-owned directory
> > * file is writable by a user other than root
> > 
> > NOTE: root is never restricted by TPE
> 
> > Threat Models:
> > 
> > 1. Attacker on system executing exploit on system vulnerability
> > 
> > *  If attacker uses a binary as a part of their system exploit, TPE can
> >    frustrate their efforts
> > 
> > *  Issues:
> >    *  Can be bypassed by interpreted languages such as python. You can run
> >       malicious code by doing: python -c 'evil code'
> 
> Yes, and not only that: a local attacker may also bypass TPE by what
> would have been non-security bugs in many other programs - e.g., a
> buffer overflow by a command-line argument in any of the allowed
> programs suddenly becomes security-relevant.
> 
> A variation of your threat model 1, which makes more sense to me than
> what's traditionally implied, is when the attacker does not yet use an
> interactive shell.  TPE can in fact frustrate automated remote exploits
> that don't specifically target (nor support) TPE-enabled systems.

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.

thanks,

greg k-h

  reply	other threads:[~2017-06-03 15:59 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 [this message]
2017-06-03 16:22     ` Solar Designer
2017-06-03 17:16       ` Daniel Micay
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=20170603155920.GA25740@kroah.com \
    --to=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.