From: Hongchao Zhang Date: Thu, 23 Apr 2015 21:04:04 +0000 (+0800) Subject: LU-6455 mdt: disable IMA support X-Git-Tag: 2.7.59~67 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=259c1ec0cfb76b2645efa2be6ec7ad48229eb658;p=fs%2Flustre-release.git LU-6455 mdt: disable IMA support in IMA (Integrity Measurement Architecture), there are two xattr "security.ima" and "security.evm" to protect the file to be modified accidentally or maliciously, the two xattr are not compatible with VBR, then disable it to workaround the problem currently and enable it when the conditions are ready. Change-Id: Ie3e30dcb0d4d605a17d301c6cda14818af40d7b0 Signed-off-by: Hongchao Zhang Reviewed-on: http://review.whamcloud.com/14928 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c index 9cb21b8..8a365b4 100644 --- a/lustre/llite/xattr.c +++ b/lustre/llite/xattr.c @@ -102,6 +102,12 @@ int xattr_type_filter(struct ll_sb_info *sbi, int xattr_type) return 0; } +/* xattr related to IMA(Integrity Measurement Architecture) */ +#ifndef XATTR_NAME_IMA +#define XATTR_NAME_IMA "security.ima" +#define XATTR_NAME_EVM "security.evm" +#endif + static int ll_setxattr_common(struct inode *inode, const char *name, const void *value, size_t size, @@ -116,6 +122,13 @@ int ll_setxattr_common(struct inode *inode, const char *name, const char *pv = value; ENTRY; + /*FIXME: enable IMA when the conditions are ready */ + if (strncmp(name, XATTR_NAME_IMA, + sizeof(XATTR_NAME_IMA)) == 0 || + strncmp(name, XATTR_NAME_EVM, + sizeof(XATTR_NAME_EVM)) == 0) + return -EOPNOTSUPP; + xattr_type = get_xattr_type(name); rc = xattr_type_filter(sbi, xattr_type); if (rc)