diff options
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 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 | */ |
1070 | static LIST_HEAD(tomoyo_policy_manager_list); | 1070 | LIST_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, | |||
2109 | static int tomoyo_close_control(struct file *file) | 2109 | static 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 | ||