BACKPORT: Smack: pipefs fix in smack_d_instantiate
authorRoman Kubiak <r.kubiak@samsung.com>
Mon, 5 Oct 2015 10:27:16 +0000 (12:27 +0200)
committerRafal Krypa <r.krypa@samsung.com>
Tue, 22 Mar 2016 11:49:23 +0000 (12:49 +0100)
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 <r.kubiak@samsung.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
(cherry-picked from upstream 8da4aba5bf9869f58d2a6bb30daaf54b2fa72569)

security/smack/smack_lsm.c

index 1bc8be6e23d20f181d9d70c53046ad8d955018a1..a4ed76460c50a2e16b0988d8dbb967cbf64593f5 100644 (file)
@@ -3357,6 +3357,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;