lsm: use lsm_prop in security_inode_getsecid

Change the security_inode_getsecid() interface to fill in a
lsm_prop structure instead of a u32 secid. This allows for its
callers to gather data from all registered LSMs. Data is provided
for IMA and audit. Change the name to security_inode_getlsmprop().

Cc: linux-integrity@vger.kernel.org
Cc: selinux@vger.kernel.org
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
[PM: subj line tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
Casey Schaufler
2024-10-09 10:32:16 -07:00
committed by Paul Moore
parent 37f670aacd
commit 07f9d2c113
7 changed files with 33 additions and 24 deletions

View File

@@ -2724,16 +2724,15 @@ int security_inode_listsecurity(struct inode *inode,
EXPORT_SYMBOL(security_inode_listsecurity);
/**
* security_inode_getsecid() - Get an inode's secid
* security_inode_getlsmprop() - Get an inode's LSM data
* @inode: inode
* @secid: secid to return
* @prop: lsm specific information to return
*
* Get the secid associated with the node. In case of failure, @secid will be
* set to zero.
* Get the lsm specific information associated with the node.
*/
void security_inode_getsecid(struct inode *inode, u32 *secid)
void security_inode_getlsmprop(struct inode *inode, struct lsm_prop *prop)
{
call_void_hook(inode_getsecid, inode, secid);
call_void_hook(inode_getlsmprop, inode, prop);
}
/**