Skip to content

RFC security: mark LSM hooks with __ro_after_init

James Morris kernel-hardening selinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 RFC Latest2 patches 13 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2security: introduce CONFIG_SECURITY_WRITABLE_HOOKSinclude/linux/lsm_hooks.h security/Kconfig security/selinux/Kconfig+18 -010 replies
2/2security: mark LSM hooks as __ro_after_initsecurity/apparmor/lsm.c security/commoncap.c security/loadpin/loadpin.c +5 more+8 -82 replies
2/2security: mark LSM hooks as __ro_after_initsecurity/apparmor/lsm.c security/commoncap.c security/loadpin/loadpin.c +5 more+8 -80 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKees CookStephen SmalleyCasey Schaufler
SeriesA-b
1/2A-b
2/2A-b A-b
2/2A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [kernel-hardening] [RFC v2 PATCH 0/2] security: mark LSM hooks with __ro_after_init

Updated and simplified down to two patches.

Following feedback from the list, I've added a new config option to handle the case where SELinux still needs to disable its hooks at runtime (and thus the hooks must be writable in that case).

I've dropped the Netfilter hooks patch as I realized that the hook ops list structures could be modified after init by the core NF code.

The SELinux Netlink message patch has been merged, and Mimi is reviewing the IMA default policy patch (it's not affected by LSM hook requirements and can be merged separately).

---

James Morris (2):
security: introduce CONFIG_SECURITY_WRITABLE_HOOKS
security: mark LSM hooks as __ro_after_init

 include/linux/lsm_hooks.h  |    7 +++++++
 security/Kconfig           |    5 +++++
 security/apparmor/lsm.c    |    2 +-
 security/commoncap.c       |    2 +-
 security/loadpin/loadpin.c |    2 +-
 security/security.c        |    2 +-
 security/selinux/Kconfig   |    6 ++++++
 security/selinux/hooks.c   |    2 +-
 security/smack/smack_lsm.c |    2 +-
 security/tomoyo/tomoyo.c   |    2 +-
 security/yama/yama_lsm.c   |    2 +-
 11 files changed, 26 insertions(+), 8 deletions(-)