diff options
author | Jeff Layton <jlayton@kernel.org> | 2019-08-06 16:41:40 +0200 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2019-09-16 12:06:25 +0200 |
commit | 026105ebb0364fb2155ef3eba65f250efc7aeb45 (patch) | |
tree | a8d94b014838106656557a719d5d3f078510dbf8 /fs/ceph | |
parent | ceph: turn ceph_security_invalidate_secctx into static inline (diff) | |
download | linux-026105ebb0364fb2155ef3eba65f250efc7aeb45.tar.xz linux-026105ebb0364fb2155ef3eba65f250efc7aeb45.zip |
ceph: only set CEPH_I_SEC_INITED if we got a MAC label
__ceph_getxattr will set the CEPH_I_SEC_INITED flag whenever it gets
any xattr that starts with "security.". We only want to set that flag
when fetching the MAC label for the currently-active LSM, however.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/xattr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index 5c608caf0190..410eaf1ba211 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -892,7 +892,8 @@ ssize_t __ceph_getxattr(struct inode *inode, const char *name, void *value, memcpy(value, xattr->val, xattr->val_len); if (current->journal_info && - !strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN)) + !strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) && + security_ismaclabel(name + XATTR_SECURITY_PREFIX_LEN)) ci->i_ceph_flags |= CEPH_I_SEC_INITED; out: spin_unlock(&ci->i_ceph_lock); |