From: Aurelien Degremont Date: Mon, 14 Nov 2011 15:25:57 +0000 (+0100) Subject: LU-857 security: Lustre client tolerates enforced SELinux. X-Git-Tag: 2.1.53~63 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=bf977ae5a02765f86b1920ae207cc1fe328011cb LU-857 security: Lustre client tolerates enforced SELinux. Fix a bug which prevents Lustre clients to access directoriess when SELinux is enforced, on RHEL 6. This patch does not add a real SELinux support for Lustre but ables to activate it for all other local filesystems, without Lustre misbehaving. Signed-off-by: Aurelien Degremont Change-Id: Ia6692c96a8439eb9239cb55ce32a1c54958241d1 Reviewed-on: http://review.whamcloud.com/1703 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Fan Yong Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index dbf6ee0..e5393a1 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -44,6 +44,7 @@ #include #include #include +#include #define DEBUG_SUBSYSTEM S_LLITE @@ -331,6 +332,9 @@ static void ll_d_add(struct dentry *de, struct inode *inode) if (inode) list_add(&de->d_alias, &inode->i_dentry); de->d_inode = inode; + /* d_instantiate() replacement code should initialize security + * context. */ + security_d_instantiate(de, inode); /* d_rehash */ if (!d_unhashed(de)) {