diff options
author | Casey Schaufler <casey@schaufler-ca.com> | 2024-10-09 10:32:11 -0700 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2024-10-11 14:34:12 -0400 |
commit | 6f2f724f0e116d9ea960ff3dd645add12e60e176 (patch) | |
tree | 8f9ed2193bbc3eabb023168cc07cc4ba74db7a78 /include/linux/security.h | |
parent | 870b7fdc660b38c4e1bd8bf48e62aa352ddf8f42 (diff) | |
download | lwn-6f2f724f0e116d9ea960ff3dd645add12e60e176.tar.gz lwn-6f2f724f0e116d9ea960ff3dd645add12e60e176.zip |
lsm: add lsmprop_to_secctx hook
Add a new hook security_lsmprop_to_secctx() and its LSM specific
implementations. The LSM specific code will use the lsm_prop element
allocated for that module. This allows for the possibility that more
than one module may be called upon to translate a secid to a string,
as can occur in the audit code.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
[PM: subject line tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'include/linux/security.h')
-rw-r--r-- | include/linux/security.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index a4f020491e7c..f1c68e38b15d 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -535,6 +535,7 @@ int security_setprocattr(int lsmid, const char *name, void *value, size_t size); int security_netlink_send(struct sock *sk, struct sk_buff *skb); int security_ismaclabel(const char *name); int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); +int security_lsmprop_to_secctx(struct lsm_prop *prop, char **secdata, u32 *seclen); int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); void security_release_secctx(char *secdata, u32 seclen); void security_inode_invalidate_secctx(struct inode *inode); @@ -1488,7 +1489,14 @@ static inline int security_ismaclabel(const char *name) return 0; } -static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) +static inline int security_secid_to_secctx(u32 secid, char **secdata, + u32 *seclen) +{ + return -EOPNOTSUPP; +} + +static inline int security_lsmprop_to_secctx(struct lsm_prop *prop, + char **secdata, u32 *seclen) { return -EOPNOTSUPP; } |