linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][SELINUX] Defer inode security initialization
@ 2004-08-16 16:28 Stephen Smalley
  0 siblings, 0 replies; only message in thread
From: Stephen Smalley @ 2004-08-16 16:28 UTC (permalink / raw)
  To: Andrew Morton, James Morris, lkml, Chris Wright

This patch defers setting the inode security state for newly created inodes
until after policy has been loaded.  Please apply.

Signed-off-by:  Stephen Smalley <sds@epoch.ncsc.mil>

 security/selinux/hooks.c |    6 ++++++
 1 files changed, 6 insertions(+)

diff -X /home/sds/dontdiff -ru linux-2.6.8.old/security/selinux/hooks.c linux-2.6.8/security/selinux/hooks.c
--- linux-2.6.8.old/security/selinux/hooks.c	2004-08-06 12:52:26.000000000 -0400
+++ linux-2.6.8/security/selinux/hooks.c	2004-08-06 12:54:11.356171296 -0400
@@ -1266,6 +1266,12 @@
 int inode_security_set_sid(struct inode *inode, u32 sid)
 {
 	struct inode_security_struct *isec = inode->i_security;
+	struct superblock_security_struct *sbsec = inode->i_sb->s_security;
+
+	if (!sbsec->initialized) {
+		/* Defer initialization to selinux_complete_init. */
+		return 0;
+	}
 
 	down(&isec->sem);
 	isec->sclass = inode_mode_to_security_class(inode->i_mode);

-- 
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-16 16:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-16 16:28 [PATCH][SELINUX] Defer inode security initialization Stephen Smalley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).