login
Header Space

 
 

[TOMOYO #8 (2.6.25-mm1) 5/7] Domain transition handler.

Previous thread: [TOMOYO #8 (2.6.25-mm1) 3/7] Memory and pathname management functions. by Toshiharu Harada on Thursday, May 1, 2008 - 1:54 am. (1 message)

Next thread: [TOMOYO #8 (2.6.25-mm1) 4/7] Common functions for TOMOYO Linux. by Toshiharu Harada on Thursday, May 1, 2008 - 1:54 am. (1 message)
To: <akpm@...>, <chrisw@...>, <viro@...>
Cc: <linux-security-module@...>, <linux-fsdevel@...>, <linux-kernel@...>, Kentaro Takeda <takedakn@...>, Tetsuo Handa <penguin-kernel@...>, Toshiharu Harada <haradats@...>
Date: Thursday, May 1, 2008 - 1:54 am

This file controls domain creation/deletion/transition.

Every process belongs to a domain in TOMOYO Linux.
Domain transition occurs when execve(2) is called
and the domain is expressed as 'process invocation history',
such as '&lt;kernel&gt; /sbin/init /etc/init.d/rc'.
Domain information is stored in task_struct-&gt;security field.

Signed-off-by: Kentaro Takeda &lt;takedakn@nttdata.co.jp&gt;
Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Toshiharu Harada &lt;haradats@nttdata.co.jp&gt;
---
 security/tomoyo/domain.c |  856 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 856 insertions(+)

--- /dev/null
+++ mm/security/tomoyo/domain.c
@@ -0,0 +1,856 @@
+/*
+ * security/tomoyo/domain.c
+ *
+ * Implementation of the Domain-Based Mandatory Access Control.
+ *
+ * Copyright (C) 2005-2008  NTT DATA CORPORATION
+ *
+ * Version: 2.2.0-pre   2008/04/30
+ *
+ */
+
+#include "common.h"
+#include "tomoyo.h"
+#include "realpath.h"
+#include &lt;linux/binfmts.h&gt;
+
+/* Variables definitions.*/
+
+/* The initial domain. */
+struct domain_info KERNEL_DOMAIN;
+
+/* The list for "struct domain_info". */
+LIST1_HEAD(domain_list);
+
+/* Lock for appending domain's ACL. */
+DEFINE_MUTEX(domain_acl_lock);
+
+/* Domain creation lock. */
+static DEFINE_MUTEX(new_domain_assign_lock);
+
+/* Structure for "initialize_domain" and "no_initialize_domain" keyword. */
+struct domain_initializer_entry {
+	struct list1_head list;
+	const struct path_info *domainname;    /* This may be NULL */
+	const struct path_info *program;
+	bool is_deleted;
+	bool is_not;       /* True if this entry is "no_initialize_domain".  */
+	bool is_last_name; /* True if the domainname is tmy_get_last_name(). */
+};
+
+/* Structure for "keep_domain" and "no_keep_domain" keyword. */
+struct domain_keeper_entry {
+	struct list1_head list;
+	const struct path_info *domainname;
+	const struct path_info *program;       /* This may be NULL */
+	bool is_de...
Previous thread: [TOMOYO #8 (2.6.25-mm1) 3/7] Memory and pathname management functions. by Toshiharu Harada on Thursday, May 1, 2008 - 1:54 am. (1 message)

Next thread: [TOMOYO #8 (2.6.25-mm1) 4/7] Common functions for TOMOYO Linux. by Toshiharu Harada on Thursday, May 1, 2008 - 1:54 am. (1 message)
speck-geostationary