lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1303907657-18366-3-git-send-email-roberto.sassu@polito.it>
Date:	Wed, 27 Apr 2011 14:34:10 +0200
From:	Roberto Sassu <roberto.sassu@...ito.it>
To:	linux-security-module@...r.kernel.org
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	dhowells@...hat.com, jmorris@...ei.org, zohar@...ux.vnet.ibm.com,
	safford@...son.ibm.com, tyhicks@...ux.vnet.ibm.com,
	kirkland@...onical.com, ecryptfs-devel@...ts.launchpad.net,
	casey@...aufler-ca.com, eparis@...hat.com, sds@...ho.nsa.gov,
	selinux@...ho.nsa.gov, viro@...iv.linux.org.uk,
	Roberto Sassu <roberto.sassu@...ito.it>
Subject: [RFC][PATCH 2/7] selinux: label new file descriptors using file->f_cred

New file descriptors are labeled using the credentials set in the 'f_cred'
field of the same structure. This permits to distinguish objects directly
managed by a user process from those created by a kernel service acting
on behalf of the application.

Signed-off-by: Roberto Sassu <roberto.sassu@...ito.it>
---
 security/selinux/hooks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index f9c3764..6772687 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -232,7 +232,7 @@ static void inode_free_security(struct inode *inode)
 static int file_alloc_security(struct file *file)
 {
 	struct file_security_struct *fsec;
-	u32 sid = current_sid();
+	u32 sid = cred_sid(file->f_cred);
 
 	fsec = kzalloc(sizeof(struct file_security_struct), GFP_KERNEL);
 	if (!fsec)
-- 
1.7.4.4


Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (2061 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ