aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-04-28 01:17:42 -0400
committerJames Morris <jmorris@namei.org>2010-05-05 10:50:43 -0400
commit4e5d6f7ec3833c0da9cf34fa5c53c6058c5908b6 (patch)
tree5c0db5bfcdcb1b07594f20054cc6eefe05161c9a /security/tomoyo/common.c
parenta674fa46c79ffa37995bd1c8e4daa2b3be5a95ae (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/common.c')
-rw-r--r--security/tomoyo/common.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 588f36a9337e..b9f64ca5f150 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -883,7 +883,7 @@ static struct tomoyo_profile *tomoyo_find_or_assign_new_profile(const unsigned
883 ptr = tomoyo_profile_ptr[profile]; 883 ptr = tomoyo_profile_ptr[profile];
884 if (ptr) 884 if (ptr)
885 goto ok; 885 goto ok;
886 ptr = kmalloc(sizeof(*ptr), GFP_KERNEL); 886 ptr = kmalloc(sizeof(*ptr), GFP_NOFS);
887 if (!tomoyo_memory_ok(ptr)) { 887 if (!tomoyo_memory_ok(ptr)) {
888 kfree(ptr); 888 kfree(ptr);
889 ptr = NULL; 889 ptr = NULL;
@@ -1088,7 +1088,7 @@ static int tomoyo_update_manager_entry(const char *manager,
1088 if (!saved_manager) 1088 if (!saved_manager)
1089 return -ENOMEM; 1089 return -ENOMEM;
1090 if (!is_delete) 1090 if (!is_delete)
1091 entry = kmalloc(sizeof(*entry), GFP_KERNEL); 1091 entry = kmalloc(sizeof(*entry), GFP_NOFS);
1092 mutex_lock(&tomoyo_policy_lock); 1092 mutex_lock(&tomoyo_policy_lock);
1093 list_for_each_entry_rcu(ptr, &tomoyo_policy_manager_list, list) { 1093 list_for_each_entry_rcu(ptr, &tomoyo_policy_manager_list, list) {
1094 if (ptr->manager != saved_manager) 1094 if (ptr->manager != saved_manager)
@@ -1881,7 +1881,7 @@ static int tomoyo_read_self_domain(struct tomoyo_io_buffer *head)
1881 */ 1881 */
1882static int tomoyo_open_control(const u8 type, struct file *file) 1882static int tomoyo_open_control(const u8 type, struct file *file)
1883{ 1883{
1884 struct tomoyo_io_buffer *head = kzalloc(sizeof(*head), GFP_KERNEL); 1884 struct tomoyo_io_buffer *head = kzalloc(sizeof(*head), GFP_NOFS);
1885 1885
1886 if (!head) 1886 if (!head)
1887 return -ENOMEM; 1887 return -ENOMEM;
@@ -1942,7 +1942,7 @@ static int tomoyo_open_control(const u8 type, struct file *file)
1942 } else { 1942 } else {
1943 if (!head->readbuf_size) 1943 if (!head->readbuf_size)
1944 head->readbuf_size = 4096 * 2; 1944 head->readbuf_size = 4096 * 2;
1945 head->read_buf = kzalloc(head->readbuf_size, GFP_KERNEL); 1945 head->read_buf = kzalloc(head->readbuf_size, GFP_NOFS);
1946 if (!head->read_buf) { 1946 if (!head->read_buf) {
1947 kfree(head); 1947 kfree(head);
1948 return -ENOMEM; 1948 return -ENOMEM;
@@ -1956,7 +1956,7 @@ static int tomoyo_open_control(const u8 type, struct file *file)
1956 head->write = NULL; 1956 head->write = NULL;
1957 } else if (head->write) { 1957 } else if (head->write) {
1958 head->writebuf_size = 4096 * 2; 1958 head->writebuf_size = 4096 * 2;
1959 head->write_buf = kzalloc(head->writebuf_size, GFP_KERNEL); 1959 head->write_buf = kzalloc(head->writebuf_size, GFP_NOFS);
1960 if (!head->write_buf) { 1960 if (!head->write_buf) {
1961 kfree(head->read_buf); 1961 kfree(head->read_buf);
1962 kfree(head); 1962 kfree(head);