public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: LSM <linux-security-module@vger.kernel.org>,
	LKLM <linux-kernel@vger.kernel.org>,
	SE Linux <selinux@tycho.nsa.gov>,
	James Morris <jmorris@namei.org>
Cc: John Johansen <john.johansen@canonical.com>,
	Eric Paris <eparis@redhat.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Kees Cook <keescook@chromium.org>,
	Casey Schaufler <casey@schaufler-ca.com>
Subject: [PATCH v13 0/9] LSM: Multiple concurrent LSMs
Date: Tue, 23 Apr 2013 09:04:06 -0700	[thread overview]
Message-ID: <5176B0F6.7080506@schaufler-ca.com> (raw)
In-Reply-To: <5176ABB7.5080300@schaufler-ca.com>

Subject: [PATCH v13 0/9] LSM: Multiple concurrent LSMs

Change the infrastructure for Linux Security Modules (LSM)s from a
single vector of hook handlers to a list based method for handling
multiple concurrent modules.

The "security=" boot option takes a comma separated list of LSMs,
registering them in the order presented. The LSM hooks will be
executed in the order registered. Hooks that return errors are
not short circuited. All hooks are called even if one of the LSM
hooks fails. The result returned will be that of the last LSM
hook that failed.

All behavior from security/capability.c has been moved into
the hook handling.  The security/commoncap functions used
to get called from the LSM specific code. The handling of the
capability functions has been moved out of the LSMs and into the
hook handling.

A level of indirection has been introduced in the handling of
security blobs. LSMs no longer access ->security fields directly,
instead they use an abstraction provided by lsm_[gs]et field
functions.

The notion that "the security context" can be represented as a
single u32 "secid" does not scale to the case where multiple LSMs
want to provide "the security context".  There are two types of
use for secids, logging and networking. Logging is addressed by
replacing the secid with a set of secids. Networking is addressed
by allocating each scheme to a specific LSM.

The NetLabel, XFRM and secmark facilities are restricted to use
by one LSM at a time. This is due to limitations of the underlying
networking mechanisms. The good news is that viable configurations
can be created. The bad news is that the complexity of configuring
a system is necessarily increased.

The /proc/*/attr interfaces are given to one LSM. This can be
done by setting CONFIG_SECURITY_PRESENT. Additional interfaces
have been created in /proc/*/attr so that each LSM has its own
named interfaces.

A "security context" may now contrain information processed by
more than one LSM. The proper form of a security context identifies
the information it contains by LSM:

	smack='Pop'selinux='system_u:object_r:etc_r:s0'

A security context without the LSM identifying lsm='<text>' gets
passed through to all of the LSMs that use a security context. This
maintains compatability in the case where there is only one LSM
using the security context.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>

---
 Documentation/security/LSM.txt                     |   39 +-
 drivers/usb/core/devio.c                           |   10 +-
 fs/proc/base.c                                     |   29 +-
 fs/sysfs/dir.c                                     |    3 +-
 fs/sysfs/inode.c                                   |    5 +-
 fs/sysfs/sysfs.h                                   |    7 +-
 fs/xattr.c                                         |    8 +-
 include/linux/audit.h                              |    9 +-
 include/linux/cred.h                               |    3 +-
 include/linux/lsm.h                                |  167 ++
 include/linux/sched.h                              |    2 +-
 include/linux/security.h                           |  378 +++-
 include/net/af_unix.h                              |    3 +-
 include/net/netlabel.h                             |    3 +-
 include/net/scm.h                                  |    8 +-
 include/net/xfrm.h                                 |    4 +-
 kernel/audit.c                                     |   94 +-
 kernel/audit.h                                     |    4 +-
 kernel/auditfilter.c                               |   21 +-
 kernel/auditsc.c                                   |   80 +-
 kernel/cred.c                                      |    6 +-
 kernel/signal.c                                    |    6 +-
 net/ipv4/ip_sockglue.c                             |    8 +-
 .../netfilter/nf_conntrack_l3proto_ipv4_compat.c   |   11 +-
 net/netfilter/nf_conntrack_netlink.c               |   24 +-
 net/netfilter/nf_conntrack_standalone.c            |   11 +-
 net/netfilter/xt_SECMARK.c                         |    4 +-
 net/netlabel/netlabel_kapi.c                       |   37 +-
 net/netlabel/netlabel_unlabeled.c                  |   22 +-
 net/netlabel/netlabel_user.c                       |    4 +-
 net/netlabel/netlabel_user.h                       |   61 +-
 net/unix/af_unix.c                                 |   17 +-
 net/xfrm/xfrm_user.c                               |   16 +-
 security/Kconfig                                   |  176 +-
 security/Makefile                                  |    3 +-
 security/apparmor/context.c                        |   10 +-
 security/apparmor/domain.c                         |   19 +-
 security/apparmor/include/context.h                |   13 +-
 security/apparmor/lsm.c                            |   68 +-
 security/capability.c                              | 1105 -----------
 security/commoncap.c                               |    6 -
 security/inode.c                                   |   79 +-
 security/integrity/ima/ima_policy.c                |    7 +-
 security/security.c                                | 2014 ++++++++++++++++----
 security/selinux/hooks.c                           |  412 ++--
 security/selinux/include/objsec.h                  |    2 +
 security/selinux/include/xfrm.h                    |    2 +-
 security/selinux/netlabel.c                        |   17 +-
 security/selinux/selinuxfs.c                       |    6 +-
 security/selinux/xfrm.c                            |    9 +-
 security/smack/smack.h                             |   15 +-
 security/smack/smack_access.c                      |    2 +-
 security/smack/smack_lsm.c                         |  474 +++--
 security/smack/smackfs.c                           |   56 +-
 security/tomoyo/common.h                           |    6 +-
 security/tomoyo/domain.c                           |    2 +-
 security/tomoyo/securityfs_if.c                    |    9 +-
 security/tomoyo/tomoyo.c                           |   49 +-
 security/yama/Kconfig                              |    7 -
 security/yama/yama_lsm.c                           |   35 +-
 60 files changed, 3357 insertions(+), 2350 deletions(-)


       reply	other threads:[~2013-04-23 16:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5176ABB7.5080300@schaufler-ca.com>
2013-04-23 16:04 ` Casey Schaufler [this message]
2013-04-24 18:57   ` [PATCH v13 0/9] LSM: Multiple concurrent LSMs Paul Moore
2013-04-24 20:22     ` Casey Schaufler
2013-04-24 21:15       ` Paul Moore
2013-04-24 23:00         ` John Johansen
2013-04-25  0:43           ` Casey Schaufler
2013-04-25 14:16             ` Tetsuo Handa
2013-04-25 15:01             ` Paul Moore
2013-04-25 18:09               ` Casey Schaufler
2013-04-25 19:14                 ` Paul Moore
2013-04-25 20:21                   ` Casey Schaufler
2013-04-25 21:05                     ` Kees Cook
2013-04-25 21:26                     ` Paul Moore
2013-04-23 16:04 ` [PATCH v13 1/9] LSM: Security blob abstraction Casey Schaufler
2013-04-23 16:04 ` [PATCH v13 2/9] LSM: Complete conversion to kill_pid_info_as_cred Casey Schaufler
2013-04-23 16:04 ` [PATCH v13 3/9] LSM: Multiple concurrent secids Casey Schaufler
2013-04-23 16:04 ` [PATCH v13 4/9] LSM: Multiple security context maintenance Casey Schaufler
2013-04-23 16:04 ` [PATCH v13 5/9] LSM: Networking component isolation Casey Schaufler
2013-04-24 18:51   ` Paul Moore
2013-04-24 19:09     ` Casey Schaufler
2013-04-24 21:04       ` Paul Moore
2013-04-23 16:04 ` [PATCH v13 6/9] LSM: Additional interfaces in /proc/pid/attr Casey Schaufler
2013-04-23 16:04 ` [PATCH v13 7/9] LSM: remove Yama special case stacking Casey Schaufler
2013-04-23 20:12   ` Kees Cook
2013-04-23 16:04 ` [PATCH v13 8/9] LSM: Hook list management Casey Schaufler
2013-04-23 16:05 ` [PATCH v13 9/9] LSM: Documentation and cleanup Casey Schaufler
2013-04-23 19:02   ` Randy Dunlap

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=5176B0F6.7080506@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=eparis@redhat.com \
    --cc=jmorris@namei.org \
    --cc=john.johansen@canonical.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 \
    --cc=selinux@tycho.nsa.gov \
    /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