aboutsummaryrefslogtreecommitdiffstats
path: root/security/smack
diff options
context:
space:
mode:
Diffstat (limited to 'security/smack')
-rw-r--r--security/smack/smack_lsm.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 969f5fee1906..0b3bb646f90e 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -3057,6 +3057,27 @@ static void smack_release_secctx(char *secdata, u32 seclen)
3057{ 3057{
3058} 3058}
3059 3059
3060static int smack_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen)
3061{
3062 return smack_inode_setsecurity(inode, XATTR_SMACK_SUFFIX, ctx, ctxlen, 0);
3063}
3064
3065static int smack_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen)
3066{
3067 return __vfs_setxattr_noperm(dentry, XATTR_NAME_SMACK, ctx, ctxlen, 0);
3068}
3069
3070static int smack_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen)
3071{
3072 int len = 0;
3073 len = smack_inode_getsecurity(inode, XATTR_SMACK_SUFFIX, ctx, true);
3074
3075 if (len < 0)
3076 return len;
3077 *ctxlen = len;
3078 return 0;
3079}
3080
3060struct security_operations smack_ops = { 3081struct security_operations smack_ops = {
3061 .name = "smack", 3082 .name = "smack",
3062 3083
@@ -3185,6 +3206,9 @@ struct security_operations smack_ops = {
3185 .secid_to_secctx = smack_secid_to_secctx, 3206 .secid_to_secctx = smack_secid_to_secctx,
3186 .secctx_to_secid = smack_secctx_to_secid, 3207 .secctx_to_secid = smack_secctx_to_secid,
3187 .release_secctx = smack_release_secctx, 3208 .release_secctx = smack_release_secctx,
3209 .inode_notifysecctx = smack_inode_notifysecctx,
3210 .inode_setsecctx = smack_inode_setsecctx,
3211 .inode_getsecctx = smack_inode_getsecctx,
3188}; 3212};
3189 3213
3190 3214