All of lore.kernel.org
 help / color / mirror / Atom feed
* [kernel-hardening] [PATCH v2 0/1]  Add Trusted Path Execution as a stackable LSM
@ 2017-06-08  3:43 ` Matt Brown
  0 siblings, 0 replies; 58+ messages in thread
From: Matt Brown @ 2017-06-08  3:43 UTC (permalink / raw)
  To: james.l.morris, serge
  Cc: linux-kernel, linux-security-module, kernel-hardening

Trusted Path Execution (TPE)

Patch Versions:

v1:
* initial patch introduction

v2:
* included copyright notice from Brad Spengler and Corey Henderson
* reversed the invert_gid logic. tpe.gid now defaults to being the
  trusted group rather than the untrusted group.
* fixed race condition by taking reference to the parent dentry
* added sysctl tpe.restrict_root that includes the root user in TPE checks
* added mprotect and mmap restrictions from Corey Henderson tpe-lkm
  project
* added documentation file

This patch was modified from Brad Spengler's Trusted Path Execution (TPE)
feature. It also adds features and config options that were found in Corey
Henderson's tpe-lkm project.

Modifications from Brad Spengler's implementation of TPE were made to
turn it into a stackable LSM using the existing LSM hook bprm_set_creds.
Also, a new denial logging function was used to simplify printing messages
to the kernel log. Additionally, mmap and mprotect restrictions were
taken from Corey Henderson's tpe-lkm project and implemented using the
LSM hooks mmap_file and file_mprotect.

Trusted Path Execution is not a new idea:

http://phrack.org/issues/52/6.html#article

| A trusted path is one that is inside a root owned directory that
| is not group or world writable.  /bin, /usr/bin, /usr/local/bin, are
| (under normal circumstances) considered trusted.  Any non-root
| users home directory is not trusted, nor is /tmp.

To be clear, Trusted Path Execution is no replacement for a MAC system
like SELinux, SMACK, or AppArmor. This LSM is designed to be good enough
without requiring a userland utility to configure policies. The fact
that TPE only requires the user to turn on a few sysctl options lowers
the barrier to implementing a security framework substantially.

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

*  This protection can be more effective when an attacker does not yet
   have an interactive shell on a system

*  Issues:
   *  Can be bypassed by interpreted languages such as python. You can run
      malicious code by doing: python -c 'evil code'

2. Attacker on system replaces binary used by a privileged user with a
   malicious one

*  This situation arises when the administrator of a system leaves a
   binary as world writable.

*  TPE is very effective against this threat model

Documentation/security/tpe.txt |  59 +++++++++++
 MAINTAINERS                    |   5 +
 include/linux/lsm_hooks.h      |   5 +
 security/Kconfig               |   1 +
 security/Makefile              |   2 +
 security/security.c            |   1 +
 security/tpe/Kconfig           |  64 ++++++++++++
 security/tpe/Makefile          |   3 +
 security/tpe/tpe_lsm.c         | 218 +++++++++++++++++++++++++++++++++++++++++

^ permalink raw reply	[flat|nested] 58+ messages in thread

end of thread, other threads:[~2017-06-16  2:26 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-08  3:43 [kernel-hardening] [PATCH v2 0/1] Add Trusted Path Execution as a stackable LSM Matt Brown
2017-06-08  3:43 ` Matt Brown
2017-06-08  3:43 ` Matt Brown
2017-06-08  3:43 ` [kernel-hardening] [PATCH v2 1/1] " Matt Brown
2017-06-08  3:43   ` Matt Brown
2017-06-08  3:43   ` Matt Brown
2017-06-08 13:05   ` [kernel-hardening] " Solar Designer
2017-06-08 13:16     ` Matt Brown
2017-06-09  2:38   ` [kernel-hardening] " Kees Cook
2017-06-09  2:38     ` Kees Cook
2017-06-09  2:38     ` Kees Cook
2017-06-09  3:50     ` [kernel-hardening] " Matt Brown
2017-06-09  3:50       ` Matt Brown
2017-06-09  3:50       ` Matt Brown
2017-06-09 10:18       ` [kernel-hardening] " Mimi Zohar
2017-06-09 10:18         ` Mimi Zohar
2017-06-09 10:18         ` Mimi Zohar
2017-06-09 12:55         ` [kernel-hardening] " Kees Cook
2017-06-09 12:55           ` Kees Cook
2017-06-09 12:55           ` Kees Cook
2017-06-09 13:15           ` [kernel-hardening] " Matt Brown
2017-06-09 13:15             ` Matt Brown
2017-06-09 13:15             ` Matt Brown
2017-06-09 13:16           ` [kernel-hardening] " Mimi Zohar
2017-06-09 13:16             ` Mimi Zohar
2017-06-09 13:16             ` Mimi Zohar
2017-06-09 13:18             ` [kernel-hardening] " Matt Brown
2017-06-09 13:18               ` Matt Brown
2017-06-09 13:44               ` Mimi Zohar
2017-06-09 13:44                 ` Mimi Zohar
2017-06-13 21:27       ` Solar Designer
2017-06-13 23:53         ` Mickaël Salaün
2017-06-14 12:36           ` Solar Designer
2017-06-14 13:15         ` Jann Horn
2017-06-14 14:28           ` Solar Designer
2017-06-14 14:33             ` Jann Horn
2017-06-14 14:34               ` Jann Horn
2017-06-14 16:24         ` Matt Brown
2017-06-16  2:25   ` [kernel-hardening] [RFC PATCH] print_tpe_error() can be static kbuild test robot
2017-06-16  2:25     ` kbuild test robot
2017-06-16  2:25     ` kbuild test robot
2017-06-16  2:25   ` [kernel-hardening] Re: [PATCH v2 1/1] Add Trusted Path Execution as a stackable LSM kbuild test robot
2017-06-16  2:25     ` kbuild test robot
2017-06-16  2:25     ` kbuild test robot
2017-06-08 18:37 ` [kernel-hardening] Re: [PATCH v2 0/1] " Alan Cox
2017-06-08 18:37   ` Alan Cox
2017-06-08 18:37   ` Alan Cox
2017-06-08 19:01   ` [kernel-hardening] " Matt Brown
2017-06-08 19:01     ` Matt Brown
2017-06-08 19:01     ` Matt Brown
2017-06-08 19:23     ` [kernel-hardening] " Alan Cox
2017-06-08 19:23       ` Alan Cox
2017-06-08 19:23       ` Alan Cox
2017-06-11 11:30     ` [kernel-hardening] " Mickaël Salaün
2017-06-11 11:30       ` Mickaël Salaün
2017-06-12  0:04       ` [kernel-hardening] " Matt Brown
2017-06-12  0:04         ` Matt Brown
2017-06-12  0:04         ` Matt Brown

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.