diff options
author | Vishal Goel <vishal.goel@samsung.com> | 2021-09-17 13:08:14 +0530 |
---|---|---|
committer | Casey Schaufler <casey@schaufler-ca.com> | 2021-09-28 13:29:40 -0700 |
commit | 387ef964460f14fe1c1ea29aba70e22731ea7cf7 (patch) | |
tree | c8ac30f327637b4605dededfe9bf65b974cfabde /security/smack | |
parent | 222a96b31c242d6736868da679d8c733719a3716 (diff) | |
download | lwn-387ef964460f14fe1c1ea29aba70e22731ea7cf7.tar.gz lwn-387ef964460f14fe1c1ea29aba70e22731ea7cf7.zip |
Smack:- Use overlay inode label in smack_inode_copy_up()
Currently in "smack_inode_copy_up()" function, process label is
changed with the label on parent inode. Due to which,
process is assigned directory label and whatever file or directory
created by the process are also getting directory label
which is wrong label.
Changes has been done to use label of overlay inode instead
of parent inode.
Signed-off-by: Vishal Goel <vishal.goel@samsung.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security/smack')
-rw-r--r-- | security/smack/smack_lsm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 95bd604c3819..5ea4815a0242 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -4637,7 +4637,7 @@ static int smack_inode_copy_up(struct dentry *dentry, struct cred **new) /* * Get label from overlay inode and set it in create_sid */ - isp = smack_inode(d_inode(dentry->d_parent)); + isp = smack_inode(d_inode(dentry)); skp = isp->smk_inode; tsp->smk_task = skp; *new = new_creds; |