diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-02-11 09:43:54 +0900 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-02-15 09:00:24 +1100 |
commit | 847b173ea3d6f50936823d07f2245059bf44713b (patch) | |
tree | b53c6d0536af73a078bcff0375f9f4d837f79bba /security/tomoyo/common.c | |
parent | ec8e6a4e062e2edebef91e930c20572c9f4c0dda (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.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index 634f7449e8b..3a36b56a2f5 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) * * # cat /sys/kernel/security/tomoyo/manager */ -static LIST_HEAD(tomoyo_policy_manager_list); +LIST_HEAD(tomoyo_policy_manager_list); /** * tomoyo_update_manager_entry - Add a manager entry. @@ -2109,6 +2109,7 @@ static int tomoyo_write_control(struct file *file, const char __user *buffer, static int tomoyo_close_control(struct file *file) { struct tomoyo_io_buffer *head = file->private_data; + const bool is_write = !!head->write_buf; tomoyo_read_unlock(head->reader_idx); /* Release memory used for policy I/O. */ @@ -2119,6 +2120,8 @@ static int tomoyo_close_control(struct file *file) kfree(head); head = NULL; file->private_data = NULL; + if (is_write) + tomoyo_run_gc(); return 0; } |