mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vishal Goel <vishal.goel@samsung.com>
To: casey@schaufler-ca.com, linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: a.sahrawat@samsung.com, v.narang@samsung.com,
	Vishal Goel <vishal.goel@samsung.com>
Subject: [PATCH 1/1] Smack:- Use overlay inode label in smack_inode_copy_up()
Date: Fri, 17 Sep 2021 13:08:14 +0530	[thread overview]
Message-ID: <1631864294-25794-1-git-send-email-vishal.goel@samsung.com> (raw)
In-Reply-To: <CGME20210917073827epcas5p11a811c82ba4c748de3923a62f51250ed@epcas5p1.samsung.com>

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>
---
 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;
-- 
2.17.1


       reply	other threads:[~2021-09-17  7:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210917073827epcas5p11a811c82ba4c748de3923a62f51250ed@epcas5p1.samsung.com>
2021-09-17  7:38 ` Vishal Goel [this message]
2021-09-17 16:32   ` Casey Schaufler
     [not found]   ` <CGME20210917073827epcas5p11a811c82ba4c748de3923a62f51250ed@epcms5p7>
     [not found]     ` <20210920080838epcms5p7c2fb342f36db245b350ebda639e4542a@epcms5p7>
2021-09-20 14:55       ` Casey Schaufler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1631864294-25794-1-git-send-email-vishal.goel@samsung.com \
    --to=vishal.goel@samsung.com \
    --cc=a.sahrawat@samsung.com \
    --cc=casey@schaufler-ca.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=v.narang@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®