summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorVishal Goel <vishal.goel@samsung.com>2021-09-17 10:38:14 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-10 22:53:34 +0300
commit14443223e08c8bf4f2bf535e9551505143ced256 (patch)
treecaf0f761ae54d1914b6e8d3738cc316373ce9a40 /security
parent297c51c63fe156ef75eff20ec39b6a0b6c42d758 (diff)
downloadlinux-14443223e08c8bf4f2bf535e9551505143ced256.tar.xz
Smack:- Use overlay inode label in smack_inode_copy_up()
[ Upstream commit 387ef964460f14fe1c1ea29aba70e22731ea7cf7 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'security')
-rw-r--r--security/smack/smack_lsm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 6bfc3c8d9310..814518ad4402 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -4663,7 +4663,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;