lkml.org 
[lkml]   [2021]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] Smack:- Use overlay inode label in smack_inode_copy_up()
From
Date
On 9/17/2021 12:38 AM, Vishal Goel wrote:
> 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.

Do you have a test case for this change?

>
> Signed-off-by: Vishal Goel <vishal.goel@samsung.com>
> ---
> security/smack/smack_lsm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
> index cacbe7518..91e50e5cb 100644
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -4634,7 +4634,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;

\
 
 \ /
  Last update: 2021-09-17 18:33    [W:0.099 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site