From 0806917cfafb02c0804d04c973410f17a8ed3e84 Mon Sep 17 00:00:00 2001 From: Casey Schaufler Date: Mon, 2 Jun 2008 10:04:32 -0700 Subject: [PATCH] --- yaml --- r: 97607 b: refs/heads/master c: e97dcb0eadbb821eccd549d4987b653cf61e2374 h: refs/heads/master i: 97605: b5780ca3224499804a299fbb75a5f516326a8014 97603: ccbf04802d8d2b2e4a911caf54d23a4802c11dce 97599: 51947494a9aa49b0bee0a46ece2879059adfb53c v: v3 --- [refs] | 2 +- trunk/security/smack/smack_lsm.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 66af2a308d0a..7cccdd3a8361 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 246dd412d31e4f5de1d43aa6422a325b785f36e4 +refs/heads/master: e97dcb0eadbb821eccd549d4987b653cf61e2374 diff --git a/trunk/security/smack/smack_lsm.c b/trunk/security/smack/smack_lsm.c index b5c8f9237008..4a09293efa00 100644 --- a/trunk/security/smack/smack_lsm.c +++ b/trunk/security/smack/smack_lsm.c @@ -1880,6 +1880,18 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode) */ final = sbsp->smk_default; + /* + * If this is the root inode the superblock + * may be in the process of initialization. + * If that is the case use the root value out + * of the superblock. + */ + if (opt_dentry->d_parent == opt_dentry) { + isp->smk_inode = sbsp->smk_root; + isp->smk_flags |= SMK_INODE_INSTANT; + goto unlockandout; + } + /* * This is pretty hackish. * Casey says that we shouldn't have to do