diff options
author | Yan, Zheng <zyan@redhat.com> | 2019-05-26 10:27:56 +0200 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2019-07-08 14:01:42 +0200 |
commit | ac6713ccb5a6d13b59a2e3fda4fb049a2c4e0af2 (patch) | |
tree | b97e61e509a3771db80edf64c3b211079faf4cc7 /fs/ceph/super.h | |
parent | ceph: rename struct ceph_acls_info to ceph_acl_sec_ctx (diff) | |
download | linux-ac6713ccb5a6d13b59a2e3fda4fb049a2c4e0af2.tar.xz linux-ac6713ccb5a6d13b59a2e3fda4fb049a2c4e0af2.zip |
ceph: add selinux support
When creating new file/directory, use security_dentry_init_security() to
prepare selinux context for the new inode, then send openc/mkdir request
to MDS, together with selinux xattr.
security_dentry_init_security() only supports single security module and
only selinux has dentry_init_security hook. So only selinux is supported
for now. We can add support for other security modules once kernel has a
generic version of dentry_init_security()
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r-- | fs/ceph/super.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index f82fd186eb8a..81bbb197fc3c 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -934,6 +934,10 @@ struct ceph_acl_sec_ctx { void *default_acl; void *acl; #endif +#ifdef CONFIG_CEPH_FS_SECURITY_LABEL + void *sec_ctx; + u32 sec_ctxlen; +#endif struct ceph_pagelist *pagelist; }; @@ -951,6 +955,21 @@ static inline bool ceph_security_xattr_wanted(struct inode *in) } #endif +#ifdef CONFIG_CEPH_FS_SECURITY_LABEL +extern int ceph_security_init_secctx(struct dentry *dentry, umode_t mode, + struct ceph_acl_sec_ctx *ctx); +extern void ceph_security_invalidate_secctx(struct inode *inode); +#else +static inline int ceph_security_init_secctx(struct dentry *dentry, umode_t mode, + struct ceph_acl_sec_ctx *ctx) +{ + return 0; +} +static inline void ceph_security_invalidate_secctx(struct inode *inode) +{ +} +#endif + void ceph_release_acl_sec_ctx(struct ceph_acl_sec_ctx *as_ctx); /* acl.c */ |