| From: |
| Casey Schaufler <casey@schaufler-ca.com> |
| To: |
| LSM <linux-security-module@vger.kernel.org> |
| Subject: |
| [PATCH v16 0/4] LSM: Generalize existing module stacking |
| Date: |
| Fri, 08 Aug 2014 12:23:23 -0700 |
| Message-ID: |
| <53E523AB.90006@schaufler-ca.com> |
| Cc: |
| James Morris <jmorris@namei.org>, Stephen Smalley <sds@tycho.nsa.gov>, Eric Paris <eparis@redhat.com>, Paul Moore <paul.moore@hp.com>, Paul Moore <pmoore@redhat.com>, John Johansen <john.johansen@canonical.com>, Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>, Kees Cook <keescook@chromium.org>, Casey Schaufler <casey@schaufler-ca.com> |
Subject: [PATCH v15 0/3] LSM: Generalize existing module stacking
There are currently two different mechanisms used to
stack security modules. The capability module is set
up as the "default" module. The other modules that
replace it call the functions it contains directly.
The Yama module is stacked using ifdefs in the security
infrastructure.
This patch set changes the existing module stacking so that
all stacking gets done the same way. There is no
"default" module, instead there is a list of modules
for each hook. The capability module is now on the
list first. If Yama stacking is configured, that is
added to the list next. Finally, if another module is
configured it gets added to the lists. The capability
calls duplicated within existing LSMs have been
removed. Not all capability calls in other modules can
be treated this way, and the individual cases are
noted.
The fourth patch is motivated by a discussion I had
with Linus about LSM performance. We can get significant
performance improvement if we put the LSM inode data
into the inode rather than maintaining a pointer to
data that is allocated and freed separately. Rather
than having an i_security entry there is now a structure
for each LSM that needs one, i_selinux and i_smack for
the time being.
The downside is that there are more LSM configuration
ifdefs in header files. There are tricks that could
be used to reduce them, but they really make the code
ugly. Uglier than the ifdefs, by quite a margin. If you
configure LSMs that you're not using, the structures
get slightly bigger. That is more than offset by the
performance improvement gained by the inode change.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
---
fs/nfs/inode.c | 14 +-
include/linux/fs.h | 13 +-
include/linux/security.h | 17 +-
include/linux/selinux.h | 13 +
include/linux/smack.h | 38 +
security/Makefile | 2 +-
security/apparmor/domain.c | 4 +-
security/apparmor/lsm.c | 20 +-
security/capability.c | 1131 ------------------------------
security/commoncap.c | 34 +
security/security.c | 1592 +++++++++++++++++++++++++++++++++++-------
security/selinux/hooks.c | 184 ++---
security/selinux/selinuxfs.c | 8 +-
security/smack/smack.h | 22 +-
security/smack/smack_lsm.c | 103 +--
security/tomoyo/tomoyo.c | 6 -
security/yama/yama_lsm.c | 36 +-
17 files changed, 1571 insertions(+), 1666 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html