linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] integrity: Move hooks into LSM
@ 2022-10-13 22:36 Kees Cook
  2022-10-13 22:36 ` [PATCH 1/9] integrity: Prepare for having "ima" and "evm" available in "integrity" LSM Kees Cook
                   ` (11 more replies)
  0 siblings, 12 replies; 44+ messages in thread
From: Kees Cook @ 2022-10-13 22:36 UTC (permalink / raw)
  To: Mimi Zohar
  Cc: Kees Cook, Paul Moore, Mickaël Salaün, KP Singh,
	Casey Schaufler, John Johansen, James Morris, linux-kernel,
	linux-security-module, linux-integrity, linux-hardening

Hi,

It's been over 4 years since LSM stack was introduced. The integrity
subsystem is long overdue for moving to this infrastructure. Here's my
first pass at converting integrity and ima (and some of evm) into LSM
hooks. This should be enough of an example to finish evm, and introduce
the missing hooks for both. For example, after this, it looks like ima
only has a couple places it's still doing things outside of the LSM. At
least these stood out:

fs/namei.c:     ima_post_create_tmpfile(mnt_userns, inode);
fs/namei.c:                             ima_post_path_mknod(mnt_userns, dentry);

Mimi, can you please take this series and finish the conversion for
what's missing in ima and evm?

I would also call attention to "175 insertions(+), 240 deletions(-)" --
as expected, this is a net reduction in code.

Thanks!

-Kees

Kees Cook (9):
  integrity: Prepare for having "ima" and "evm" available in "integrity"
    LSM
  security: Move trivial IMA hooks into LSM
  ima: Move xattr hooks into LSM
  ima: Move ima_file_free() into LSM
  LSM: Introduce inode_post_setattr hook
  fs: Introduce file_to_perms() helper
  ima: Move ima_file_check() into LSM
  integrity: Move trivial hooks into LSM
  integrity: Move integrity_inode_get() out of global header

 fs/attr.c                             |  3 +-
 fs/file_table.c                       |  1 -
 fs/namei.c                            |  2 -
 fs/nfsd/vfs.c                         |  6 --
 include/linux/evm.h                   |  6 --
 include/linux/fs.h                    | 22 +++++++
 include/linux/ima.h                   | 87 ---------------------------
 include/linux/integrity.h             | 30 +--------
 include/linux/lsm_hook_defs.h         |  3 +
 security/Kconfig                      | 10 +--
 security/apparmor/include/file.h      | 18 ++----
 security/integrity/evm/evm_main.c     | 14 ++++-
 security/integrity/iint.c             | 28 +++++++--
 security/integrity/ima/ima.h          | 12 ++++
 security/integrity/ima/ima_appraise.c | 21 +++++--
 security/integrity/ima/ima_main.c     | 66 ++++++++++++++------
 security/integrity/integrity.h        |  8 +++
 security/security.c                   | 78 ++++++------------------
 18 files changed, 175 insertions(+), 240 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2022-10-21 16:35 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-13 22:36 [PATCH 0/9] integrity: Move hooks into LSM Kees Cook
2022-10-13 22:36 ` [PATCH 1/9] integrity: Prepare for having "ima" and "evm" available in "integrity" LSM Kees Cook
2022-10-14 14:40   ` Mickaël Salaün
2022-10-14 17:59     ` Kees Cook
2022-10-17  9:26       ` Mickaël Salaün
2022-10-17 18:11         ` Kees Cook
2022-10-19 18:33         ` Kees Cook
2022-10-19 19:13           ` Mimi Zohar
2022-10-19 22:37             ` Kees Cook
2022-10-19 14:34   ` Mimi Zohar
2022-10-19 18:28     ` Kees Cook
2022-10-13 22:36 ` [PATCH 2/9] security: Move trivial IMA hooks into LSM Kees Cook
2022-10-19 14:34   ` Mimi Zohar
2022-10-19 18:59     ` Kees Cook
2022-10-19 20:45       ` Mimi Zohar
2022-10-19 23:41         ` Kees Cook
2022-10-20 12:17           ` Mimi Zohar
2022-10-21 14:53       ` Dr. Greg
2022-10-21 15:09         ` Casey Schaufler
2022-10-13 22:36 ` [PATCH 3/9] ima: Move xattr " Kees Cook
2022-10-18 15:07   ` Christian Brauner
2022-10-19 13:24     ` Mimi Zohar
2022-10-13 22:36 ` [PATCH 4/9] ima: Move ima_file_free() " Kees Cook
2022-10-18 15:02   ` Christian Brauner
2022-10-18 15:32     ` Roberto Sassu
2022-10-18 18:29       ` Kees Cook
2022-10-19  6:55         ` Roberto Sassu
2022-10-20 15:47           ` Paul Moore
2022-10-13 22:36 ` [PATCH 5/9] LSM: Introduce inode_post_setattr hook Kees Cook
2022-10-18 14:50   ` Christian Brauner
2022-10-13 22:36 ` [PATCH 6/9] fs: Introduce file_to_perms() helper Kees Cook
2022-10-18 14:10   ` Christian Brauner
2022-10-18 18:25     ` Kees Cook
2022-10-20 17:29   ` Casey Schaufler
2022-10-20 23:04     ` Kees Cook
2022-10-13 22:36 ` [PATCH 7/9] ima: Move ima_file_check() into LSM Kees Cook
2022-10-13 22:36 ` [PATCH 8/9] integrity: Move trivial hooks " Kees Cook
2022-10-13 22:36 ` [PATCH 9/9] integrity: Move integrity_inode_get() out of global header Kees Cook
2022-10-13 22:47 ` [PATCH 0/9] integrity: Move hooks into LSM Paul Moore
2022-10-14  1:16   ` Mimi Zohar
2022-10-18 15:31 ` Mickaël Salaün
2022-10-18 15:38   ` Roberto Sassu
2022-10-18 18:31   ` Kees Cook
2022-10-20 17:36 ` Casey Schaufler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).