Smack: pipefs fix in smack_d_instantiate
authorRoman Kubiak <r.kubiak@samsung.com>
Mon, 5 Oct 2015 10:27:16 +0000 (12:27 +0200)
committerSooyoung Ha <yoosah.ha@samsung.com>
Tue, 23 Feb 2016 09:27:50 +0000 (18:27 +0900)
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.

Change-Id: I3d4fcf5b8e652d6f2abfe5ef0dfd96306f2c8219
Signed-off-by: Roman Kubiak <r.kubiak@samsung.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
(cherry picked from commit ad52be06a2cf0dc547008c811577d0a5a1b3053b)
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
security/smack/smack_lsm.c

index c3db9d3..ea4ae19 100644 (file)
@@ -3088,6 +3088,9 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
                         */
                        isp->smk_inode = smk_of_current()->smk_known;
                        break;
+               case PIPEFS_MAGIC:
+                       isp->smk_inode = smk_of_current()->smk_known;
+                       break;
                default:
                        isp->smk_inode = sbsp->smk_root;
                        break;