LSM: General module stacking
Get series with b4
b4 am [email protected]Versions newest first
- v39 Latest42 patches 29 repliesIn review
Patches in v39 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/42 | integrity: disassociate ima_filter_rule from security_audit_ruleinclude/ security/ security/ | +45 | 17 replies | |
| 2/42 | SM: Infrastructure management of the sock securityinclude/ security/ security/ +8 more | +131 | 4 replies | |
| 3/42 | LSM: Add the lsmblob data structure.include/ include/ include/ +2 more | +86 | 0 replies | |
| 4/42 | IMA: avoid label collisions with stacked LSMsDocumentation/ include/ include/ +7 more | +192 | 4 replies | |
| 5/42 | LSM: Use lsmblob in security_audit_rule_matchinclude/ include/ kernel/ +8 more | +72 | 0 replies | |
| 6/42 | LSM: Add lsmblob_to_secctx hookinclude/ include/ kernel/ +6 more | +121 | 0 replies | |
| 7/42 | Audit: maintain an lsmblob in audit_contextinclude/ kernel/ kernel/ | +23 | 0 replies | |
| 8/42 | LSM: Use lsmblob in security_ipc_getsecidinclude/ include/ kernel/ +3 more | +41 | 0 replies | |
| 9/42 | Audit: Update shutdown LSM datakernel/ | +8 | 0 replies | |
| 10/42 | LSM: Use lsmblob in security_current_getsecidinclude/ include/ kernel/ +13 more | +138 | 0 replies | |
| 11/42 | LSM: Use lsmblob in security_inode_getsecidinclude/ include/ kernel/ +4 more | +33 | 0 replies | |
| 12/42 | Audit: use an lsmblob in audit_nameskernel/ kernel/ | +6 | 0 replies | |
| 13/42 | LSM: Create new security_cred_getlsmblob LSM hookinclude/ include/ security/ +3 more | +52 | 0 replies | |
| 14/42 | Audit: Change context data from secid to lsmblobkernel/ kernel/ kernel/ | +13 | 0 replies | |
| 15/42 | Netlabel: Use lsmblob for audit datainclude/ net/ net/ +2 more | +7 | 0 replies | |
| 16/42 | LSM: Ensure the correct LSM context releaserdrivers/ fs/ fs/ +16 more | +170 | 0 replies | |
| 17/42 | LSM: Use lsmcontext in security_secid_to_secctxdrivers/ include/ include/ +11 more | +72 | 0 replies | |
| 18/42 | LSM: Use lsmcontext in security_lsmblob_to_secctxinclude/ include/ kernel/ +7 more | +59 | 0 replies | |
| 19/42 | LSM: Use lsmcontext in security_inode_getsecctxfs/ include/ include/ +3 more | +30 | 0 replies | |
| 20/42 | LSM: Use lsmcontext in security_dentry_init_securityfs/ fs/ fs/ +11 more | +80 | 2 replies | |
| 21/42 | LSM: security_lsmblob_to_secctx module selectioninclude/ kernel/ kernel/ +2 more | +18 | 0 replies | |
| 22/42 | Audit: Create audit_stamp structurekernel/ kernel/ kernel/ | +27 | 0 replies | |
| 23/42 | Audit: Allow multiple records in an audit_bufferkernel/ | +89 | 0 replies | |
| 24/42 | Audit: Add record for multiple task security contextsinclude/ include/ include/ +6 more | +49 | 0 replies | |
| 25/42 | audit: multiple subject lsm values for netlabelinclude/ kernel/ net/ | +23 | 0 replies | |
| 26/42 | Audit: Add record for multiple object contextsinclude/ include/ kernel/ +1 more | +82 | 0 replies | |
| 27/42 | LSM: Remove unused lsmcontext_init()include/ | +0 | 0 replies | |
| 28/42 | LSM: Improve logic in security_getprocattrsecurity/ | +4 | 0 replies | |
| 29/42 | LSM: secctx provider check on releasesecurity/ security/ | +4 | 0 replies | |
| 30/42 | LSM: Single calls in socket_getpeersec hookssecurity/ | +15 | 0 replies | |
| 31/42 | LSM: Exclusive secmark usageinclude/ security/ security/ +5 more | +34 | 0 replies | |
| 32/42 | LSM: Identify which LSM handles the context stringsecurity/ | +6 | 0 replies | |
| 33/42 | AppArmor: Remove the exclusive flagsecurity/ | +1 | 0 replies | |
| 34/42 | LSM: Add mount opts blob size trackinginclude/ security/ security/ +1 more | +5 | 0 replies | |
| 35/42 | LSM: allocate mnt_opts blobs instead of module specific datainclude/ security/ security/ +1 more | +22 | 0 replies | |
| 36/42 | LSM: Infrastructure management of the key security blobinclude/ security/ security/ +3 more | +75 | 0 replies | |
| 37/42 | LSM: Infrastructure management of the mnt_opts security blobsecurity/ security/ security/ | +85 | 0 replies | |
| 38/42 | LSM: Correct handling of ENOSYS in inode_setxattrsecurity/ security/ security/ | +22 | 0 replies | |
| 39/42 | LSM: Remove lsmblob scaffoldinginclude/ security/ security/ +4 more | +6 | 0 replies | |
| 40/42 | LSM: Allow reservation of netlabelinclude/ security/ security/ +5 more | +68 | 0 replies | |
| 41/42 | LSM: restrict security_cred_getsecid() to a single LSMsecurity/ | +10 | 0 replies | |
| 42/42 | Smack: Remove LSM_FLAG_EXCLUSIVEsecurity/ | +1 | 1 reply |
Reviews trailers per patch
14 of 42 patches have a Reviewed-by or Acked-by.
| Patch | Paul Moore | John Johansen | Kees Cook | Stephen Smalley | Chuck Lever | Roberto Sassu |
|---|---|---|---|---|---|---|
| 1/42 | A-b | R-b | A-b | |||
| 2/42 | A-b | R-b | R-b | A-b | ||
| 3/42 | ||||||
| 4/42 | ||||||
| 5/42 | A-b | R-b | ||||
| 6/42 | ||||||
| 7/42 | ||||||
| 8/42 | A-b | R-b | R-b | A-b | ||
| 9/42 | ||||||
| 10/42 | A-b | R-b | R-b | A-b | ||
| 11/42 | A-b | R-b | R-b | A-b | ||
| 12/42 | ||||||
| 13/42 | A-b | R-b | R-b | A-b | ||
| 14/42 | ||||||
| 15/42 | ||||||
| 16/42 | A-b | R-b | R-b | A-b | A-b | |
| 17/42 | ||||||
| 18/42 | ||||||
| 19/42 | A-b | R-b | R-b | A-b | A-b | |
| 20/42 | ||||||
| 21/42 | ||||||
| 22/42 | A-b | |||||
| 23/42 | ||||||
| 24/42 | A-b | |||||
| 25/42 | A-b | |||||
| 26/42 | A-b | |||||
| 27/42 | ||||||
| 28/42 | ||||||
| 29/42 | ||||||
| 30/42 | ||||||
| 31/42 | ||||||
| 32/42 | ||||||
| 33/42 | A-b | R-b | A-b | |||
| 34/42 | ||||||
| 35/42 | ||||||
| 36/42 | ||||||
| 37/42 | ||||||
| 38/42 | ||||||
| 39/42 | ||||||
| 40/42 | ||||||
| 41/42 | ||||||
| 42/42 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.
Cover letter [PATCH v39 00/42] LSM: General module stacking
This patchset provides the changes required to allow arbitrary combination of all the existing Linux Security Modules (LSM). It does not provide for all possible configurations of all of co-existing modules. It does not ensure that the enforcement of policy provided by one module does not interfere with the behavior of another module.
The bulk of the code change is in support of the audit system. Because subjects and objects may have multiple LSM specific attributes that are used to make access control decisions it was necessary to enhance the audit system to report these security attributes. Separate audit records have been added to include the additional information for each of the audit event subject and object. Providing the required security information using 32-bit secids was no longer sufficient. A new structure, lsmblob, has been introduced to include the data for all relevant modules.
The lsmblob structure has an entry for each of the modules that has used secids. Each module provides a structure of its own which contains the information it uses. For SELinux this is a u32 secid. Smack provides a pointer into the label list. Modules that are not configured use conditional compilation to have empty structures.
Because audit records may need to include the text representation of more than one module's security attributes (commonly referred to as the "security context") the interfaces that convert the lsmblob into a text representation need to identify which module provided the text. An structure lsmcontext has been added that contains the text, its length and the identifier of the module than created it.
Security attributes for network facilities have provided certain challenges. The security information allowed in socket buffers and secmarks is limited to a single u32 secid, and there is no indication that this will ever be allowed to change. The netlabel subsystem, which provides CIPSO and CALIPSO labeling on internet packets, supports only one IP packet option at a time. Labeled NFS3 also supports only one security module. The existing modules have been updated to accept that they may not have access to these networking security attributes. The first module to register that uses them is given exclusive access.
The issue of multiple modules using the /proc/.../attr interfaces has been largely addressed for some time by the inclusion of module specific sub-directories. Applications should be using these except for the case of SELinux.
Patch 0001 removes an interface dependency on audit from IMA. Patch 0002 moves management of socket security blobs out of the
modules and into the LSM infrastructure.
Patch 0003 introduces the lsmblob structure.
Patch 0004 introduces mechanism for the IMA mechanisms to handle
the possibility of multiple modules that use attributes.
Patches 0005-0015 add new interfaces and change existing interfaces
to use the lsmblob to represent security data.
Patches 0016-0021 replace a the use of string and length pairs to
use a "security context" with an lsmcontext structure.
Patches 0022-0026 implement audit records describing the multiple
security attributes on subjects and objects.
Patch 0027 removes scaffolding code used in support on lsmcontext. Patches 0028-0030 optimize LSM hooks for the networking single
module user case.
Patch 0031 implements mechanism to reserve use of network secmarks. Patch 0032 limits security_secctx_to_secid() to a single module. Patch 0033 removes the exclusive tag from AppArmor. Patches 0034-0035 adds mount operation security blobs. Patch 0036 moves management of key security blobs out of the
modules and into the LSM infrastructure.
Patch 0037 enables management of mount operation security blobs
in the modules.
Patches 0038-0039 remove scaffolding for lsmblobs.
Patch 0040 implements mechanism to reserve use of netlabel. Patch 0041 restricts a hook used only by binder to a single module. Patch 0042 removes the exclusive tag from Smack.
https://github.com:cschaufler/lsm-stacking.git#stack-6.7-rc1-pcmoore-dev-v39-b
Casey Schaufler (42):
integrity: disassociate ima_filter_rule from security_audit_rule
SM: Infrastructure management of the sock security
LSM: Add the lsmblob data structure.
IMA: avoid label collisions with stacked LSMs
LSM: Use lsmblob in security_audit_rule_match
LSM: Add lsmblob_to_secctx hook
Audit: maintain an lsmblob in audit_context
LSM: Use lsmblob in security_ipc_getsecid
Audit: Update shutdown LSM data
LSM: Use lsmblob in security_current_getsecid
LSM: Use lsmblob in security_inode_getsecid
Audit: use an lsmblob in audit_names
LSM: Create new security_cred_getlsmblob LSM hook
Audit: Change context data from secid to lsmblob
Netlabel: Use lsmblob for audit data
LSM: Ensure the correct LSM context releaser
LSM: Use lsmcontext in security_secid_to_secctx
LSM: Use lsmcontext in security_lsmblob_to_secctx
LSM: Use lsmcontext in security_inode_getsecctx
LSM: Use lsmcontext in security_dentry_init_security
LSM: security_lsmblob_to_secctx module selection
Audit: Create audit_stamp structure
Audit: Allow multiple records in an audit_buffer
Audit: Add record for multiple task security contexts
audit: multiple subject lsm values for netlabel
Audit: Add record for multiple object contexts
LSM: Remove unused lsmcontext_init()
LSM: Improve logic in security_getprocattr
LSM: secctx provider check on release
LSM: Single calls in socket_getpeersec hooks
LSM: Exclusive secmark usage
LSM: Identify which LSM handles the context string
AppArmor: Remove the exclusive flag
LSM: Add mount opts blob size tracking
LSM: allocate mnt_opts blobs instead of module specific data
LSM: Infrastructure management of the key security blob
LSM: Infrastructure management of the mnt_opts security blob
LSM: Correct handling of ENOSYS in inode_setxattr
LSM: Remove lsmblob scaffolding
LSM: Allow reservation of netlabel
LSM: restrict security_cred_getsecid() to a single LSM
Smack: Remove LSM_FLAG_EXCLUSIVE
Documentation/ABI/testing/ima_policy | 8 +- drivers/android/binder.c | 25 +- fs/ceph/super.h | 3 +- fs/ceph/xattr.c | 15 +- fs/fuse/dir.c | 35 +- fs/nfs/dir.c | 2 +- fs/nfs/inode.c | 17 +- fs/nfs/internal.h | 8 +- fs/nfs/nfs4proc.c | 16 +- fs/nfs/nfs4xdr.c | 22 +- fs/nfsd/nfs4xdr.c | 21 +- include/linux/audit.h | 13 + include/linux/lsm/apparmor.h | 17 + include/linux/lsm/bpf.h | 16 + include/linux/lsm/selinux.h | 16 + include/linux/lsm/smack.h | 17 + include/linux/lsm_hook_defs.h | 35 +- include/linux/lsm_hooks.h | 8 + include/linux/nfs4.h | 8 +- include/linux/nfs_fs.h | 2 +- include/linux/security.h | 158 +++++++-- include/net/netlabel.h | 2 +- include/net/scm.h | 12 +- include/uapi/linux/audit.h | 2 + kernel/audit.c | 269 +++++++++++---- kernel/audit.h | 20 +- kernel/auditfilter.c | 9 +- kernel/auditsc.c | 142 +++----- net/ipv4/ip_sockglue.c | 12 +- net/netfilter/nf_conntrack_netlink.c | 16 +- net/netfilter/nf_conntrack_standalone.c | 11 +- net/netfilter/nfnetlink_queue.c | 22 +- net/netlabel/netlabel_unlabeled.c | 46 ++- net/netlabel/netlabel_user.c | 10 +- net/netlabel/netlabel_user.h | 2 +- security/apparmor/audit.c | 19 +- security/apparmor/include/audit.h | 8 +- security/apparmor/include/net.h | 8 +- security/apparmor/include/secid.h | 5 +- security/apparmor/lsm.c | 65 +--- security/apparmor/net.c | 2 +- security/apparmor/secid.c | 52 ++- security/bpf/hooks.c | 1 + security/integrity/ima/ima.h | 32 +- security/integrity/ima/ima_api.c | 6 +- security/integrity/ima/ima_appraise.c | 6 +- security/integrity/ima/ima_main.c | 60 ++-- security/integrity/ima/ima_policy.c | 91 +++++- security/security.c | 415 ++++++++++++++++++------ security/selinux/hooks.c | 285 +++++++++------- security/selinux/include/audit.h | 13 +- security/selinux/include/netlabel.h | 5 + security/selinux/include/objsec.h | 12 + security/selinux/netlabel.c | 27 +- security/selinux/ss/services.c | 20 +- security/smack/smack.h | 22 ++ security/smack/smack_lsm.c | 347 ++++++++++++-------- security/smack/smack_netfilter.c | 12 +- security/smack/smackfs.c | 24 +- 59 files changed, 1691 insertions(+), 883 deletions(-) create mode 100644 include/linux/lsm/apparmor.h create mode 100644 include/linux/lsm/bpf.h create mode 100644 include/linux/lsm/selinux.h create mode 100644 include/linux/lsm/smack.h
Signature · 1 line
2.41.0