diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-04-28 01:17:42 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-05-05 10:50:43 -0400 |
commit | 4e5d6f7ec3833c0da9cf34fa5c53c6058c5908b6 (patch) | |
tree | 5c0db5bfcdcb1b07594f20054cc6eefe05161c9a /security/tomoyo/file.c | |
parent | a674fa46c79ffa37995bd1c8e4daa2b3be5a95ae (diff) |
TOMOYO: Use GFP_NOFS rather than GFP_KERNEL.
In Ubuntu, security_path_*() hooks are exported to Unionfs. Thus, prepare for
being called from inside VFS functions because I'm not sure whether it is safe
to use GFP_KERNEL or not.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/file.c')
-rw-r--r-- | security/tomoyo/file.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c index 1b24304edb7d..cf67e55a0d13 100644 --- a/security/tomoyo/file.c +++ b/security/tomoyo/file.c | |||
@@ -99,7 +99,7 @@ static struct tomoyo_path_info *tomoyo_get_path(struct path *path) | |||
99 | { | 99 | { |
100 | int error; | 100 | int error; |
101 | struct tomoyo_path_info_with_data *buf = kzalloc(sizeof(*buf), | 101 | struct tomoyo_path_info_with_data *buf = kzalloc(sizeof(*buf), |
102 | GFP_KERNEL); | 102 | GFP_NOFS); |
103 | 103 | ||
104 | if (!buf) | 104 | if (!buf) |
105 | return NULL; | 105 | return NULL; |
@@ -174,7 +174,7 @@ static int tomoyo_update_globally_readable_entry(const char *filename, | |||
174 | if (!saved_filename) | 174 | if (!saved_filename) |
175 | return -ENOMEM; | 175 | return -ENOMEM; |
176 | if (!is_delete) | 176 | if (!is_delete) |
177 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); | 177 | entry = kmalloc(sizeof(*entry), GFP_NOFS); |
178 | mutex_lock(&tomoyo_policy_lock); | 178 | mutex_lock(&tomoyo_policy_lock); |
179 | list_for_each_entry_rcu(ptr, &tomoyo_globally_readable_list, list) { | 179 | list_for_each_entry_rcu(ptr, &tomoyo_globally_readable_list, list) { |
180 | if (ptr->filename != saved_filename) | 180 | if (ptr->filename != saved_filename) |
@@ -321,7 +321,7 @@ static int tomoyo_update_file_pattern_entry(const char *pattern, | |||
321 | if (!saved_pattern->is_patterned) | 321 | if (!saved_pattern->is_patterned) |
322 | goto out; | 322 | goto out; |
323 | if (!is_delete) | 323 | if (!is_delete) |
324 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); | 324 | entry = kmalloc(sizeof(*entry), GFP_NOFS); |
325 | mutex_lock(&tomoyo_policy_lock); | 325 | mutex_lock(&tomoyo_policy_lock); |
326 | list_for_each_entry_rcu(ptr, &tomoyo_pattern_list, list) { | 326 | list_for_each_entry_rcu(ptr, &tomoyo_pattern_list, list) { |
327 | if (saved_pattern != ptr->pattern) | 327 | if (saved_pattern != ptr->pattern) |
@@ -474,7 +474,7 @@ static int tomoyo_update_no_rewrite_entry(const char *pattern, | |||
474 | if (!saved_pattern) | 474 | if (!saved_pattern) |
475 | return error; | 475 | return error; |
476 | if (!is_delete) | 476 | if (!is_delete) |
477 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); | 477 | entry = kmalloc(sizeof(*entry), GFP_NOFS); |
478 | mutex_lock(&tomoyo_policy_lock); | 478 | mutex_lock(&tomoyo_policy_lock); |
479 | list_for_each_entry_rcu(ptr, &tomoyo_no_rewrite_list, list) { | 479 | list_for_each_entry_rcu(ptr, &tomoyo_no_rewrite_list, list) { |
480 | if (ptr->pattern != saved_pattern) | 480 | if (ptr->pattern != saved_pattern) |
@@ -820,7 +820,7 @@ static int tomoyo_update_path_acl(const u8 type, const char *filename, | |||
820 | if (!saved_filename) | 820 | if (!saved_filename) |
821 | return -ENOMEM; | 821 | return -ENOMEM; |
822 | if (!is_delete) | 822 | if (!is_delete) |
823 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); | 823 | entry = kmalloc(sizeof(*entry), GFP_NOFS); |
824 | mutex_lock(&tomoyo_policy_lock); | 824 | mutex_lock(&tomoyo_policy_lock); |
825 | list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) { | 825 | list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) { |
826 | struct tomoyo_path_acl *acl = | 826 | struct tomoyo_path_acl *acl = |
@@ -906,7 +906,7 @@ static int tomoyo_update_path2_acl(const u8 type, const char *filename1, | |||
906 | if (!saved_filename1 || !saved_filename2) | 906 | if (!saved_filename1 || !saved_filename2) |
907 | goto out; | 907 | goto out; |
908 | if (!is_delete) | 908 | if (!is_delete) |
909 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); | 909 | entry = kmalloc(sizeof(*entry), GFP_NOFS); |
910 | mutex_lock(&tomoyo_policy_lock); | 910 | mutex_lock(&tomoyo_policy_lock); |
911 | list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) { | 911 | list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) { |
912 | struct tomoyo_path2_acl *acl = | 912 | struct tomoyo_path2_acl *acl = |