aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-02-10 19:43:54 -0500
committerJames Morris <jmorris@namei.org>2010-02-14 17:00:24 -0500
commit847b173ea3d6f50936823d07f2245059bf44713b (patch)
treeb53c6d0536af73a078bcff0375f9f4d837f79bba /security/tomoyo/common.c
parentec8e6a4e062e2edebef91e930c20572c9f4c0dda (diff)
TOMOYO: Add garbage collector.
This patch adds garbage collector support to TOMOYO. Elements are protected by "struct srcu_struct tomoyo_ss". Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/common.c')
-rw-r--r--security/tomoyo/common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 634f7449e8ba..3a36b56a2f5c 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -1067,7 +1067,7 @@ static int tomoyo_read_profile(struct tomoyo_io_buffer *head)
1067 * 1067 *
1068 * # cat /sys/kernel/security/tomoyo/manager 1068 * # cat /sys/kernel/security/tomoyo/manager
1069 */ 1069 */
1070static LIST_HEAD(tomoyo_policy_manager_list); 1070LIST_HEAD(tomoyo_policy_manager_list);
1071 1071
1072/** 1072/**
1073 * tomoyo_update_manager_entry - Add a manager entry. 1073 * tomoyo_update_manager_entry - Add a manager entry.
@@ -2109,6 +2109,7 @@ static int tomoyo_write_control(struct file *file, const char __user *buffer,
2109static int tomoyo_close_control(struct file *file) 2109static int tomoyo_close_control(struct file *file)
2110{ 2110{
2111 struct tomoyo_io_buffer *head = file->private_data; 2111 struct tomoyo_io_buffer *head = file->private_data;
2112 const bool is_write = !!head->write_buf;
2112 2113
2113 tomoyo_read_unlock(head->reader_idx); 2114 tomoyo_read_unlock(head->reader_idx);
2114 /* Release memory used for policy I/O. */ 2115 /* Release memory used for policy I/O. */
@@ -2119,6 +2120,8 @@ static int tomoyo_close_control(struct file *file)
2119 kfree(head); 2120 kfree(head);
2120 head = NULL; 2121 head = NULL;
2121 file->private_data = NULL; 2122 file->private_data = NULL;
2123 if (is_write)
2124 tomoyo_run_gc();
2122 return 0; 2125 return 0;
2123} 2126}
2124 2127