Skip to content

Commit

Permalink
Smack:- Use overlay inode label in smack_inode_copy_up()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vishal Goel authored and cschaufler committed Sep 28, 2021
1 parent 222a96b commit 387ef96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/smack/smack_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 387ef96

Please sign in to comment.