mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sargun Dhillon <sargun@sargun.me>
To: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: james.l.morris@oracle.com, penguin-kernel@i-love.sakura.ne.jp,
	keescook@chromium.org, igor.stoppa@huawei.com,
	casey@schaufler-ca.com
Subject: [RFC PATCH v3 0/3] Safe, dynamically loadable LSM hooks
Date: Tue, 20 Feb 2018 02:13:58 +0000	[thread overview]
Message-ID: <cover.1519092378.git.sargun@sargun.me> (raw)

This patchset introduces safe dynamic LSM support. These are currently
not unloadable, until we figure out a use case that needs that. Adding
an unload hook is trivial given the way the patch is written.

This exposes a second mechanism of loading hooks which are in modules,
because they are behind static keys, and kept in a set of hooks which
is not marked as read only.

The point of this security feature is to resolve "unknown unknowns"
as well. Although, livepatch is excellent, sometimes, a surgical
LSM is simpler.

It includes an example LSM that prevents specific time travel.

Changes since v2:
  * inode get/set security is readded
  * xfrm singleton hook readded
  * Security hooks are turned into an array
  * Security hooks and dynamic hooks enum is collapsed

Changes since v1:
  * It no longer allows unloading of modules
  * prctl is fixed
  * inode get/set security is removed
  * xfrm singleton hook removed


Sargun Dhillon (3):
  security: Refactor LSM hooks into an array
  security: Expose a mechanism to load lsm hooks dynamically at runtime
  security: Add an example sample dynamic LSM

 include/linux/lsm_hooks.h | 454 ++++++++++++++++++++++++----------------------
 samples/Kconfig           |   6 +
 samples/Makefile          |   2 +-
 samples/lsm/Makefile      |   4 +
 samples/lsm/lsm_example.c |  33 ++++
 security/Kconfig          |   9 +
 security/inode.c          |  13 +-
 security/security.c       | 250 +++++++++++++++++++++++--
 8 files changed, 531 insertions(+), 240 deletions(-)
 create mode 100644 samples/lsm/Makefile
 create mode 100644 samples/lsm/lsm_example.c

-- 
2.14.1

             reply	other threads:[~2018-02-20  2:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20  2:13 Sargun Dhillon [this message]
2018-02-20  2:14 ` [RFC PATCH v3 1/3] security: Refactor LSM hooks into an array Sargun Dhillon
2018-02-20  2:14 ` [RFC PATCH v3 2/3] security: Expose a mechanism to load lsm hooks dynamically at runtime Sargun Dhillon
2018-02-20  2:14 ` [RFC PATCH v3 3/3] security: Add an example sample dynamic LSM Sargun Dhillon

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=cover.1519092378.git.sargun@sargun.me \
    --to=sargun@sargun.me \
    --cc=casey@schaufler-ca.com \
    --cc=igor.stoppa@huawei.com \
    --cc=james.l.morris@oracle.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    /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

all inboxes | Powered by JetHome®