From afee0aebca68ee2cc759389eefd549776a2c5c6b Mon Sep 17 00:00:00 2001 From: Roman Kubiak Date: Mon, 5 Oct 2015 12:27:16 +0200 Subject: [PATCH] BACKPORT: Smack: pipefs fix in smack_d_instantiate This fix writes the task label when smack_d_instantiate is called, before the label of the superblock was written on the pipe's inode. Signed-off-by: Roman Kubiak Acked-by: Casey Schaufler (cherry-picked from upstream 8da4aba5bf9869f58d2a6bb30daaf54b2fa72569) --- security/smack/smack_lsm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 6405066d38a3..d8869a13d080 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -3369,6 +3369,9 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode) */ isp->smk_inode = smk_of_current(); break; + case PIPEFS_MAGIC: + isp->smk_inode = smk_of_current(); + break; default: isp->smk_inode = sbsp->smk_root; break; -- 2.34.1