diff options
Diffstat (limited to 'security/tomoyo/common.c')
-rw-r--r-- | security/tomoyo/common.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index 975c45d88baa..3c86bbc33aeb 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c | |||
@@ -884,7 +884,7 @@ static struct tomoyo_profile *tomoyo_find_or_assign_new_profile(const unsigned | |||
884 | ptr = tomoyo_profile_ptr[profile]; | 884 | ptr = tomoyo_profile_ptr[profile]; |
885 | if (ptr) | 885 | if (ptr) |
886 | goto ok; | 886 | goto ok; |
887 | ptr = kmalloc(sizeof(*ptr), GFP_KERNEL); | 887 | ptr = kmalloc(sizeof(*ptr), GFP_NOFS); |
888 | if (!tomoyo_memory_ok(ptr)) { | 888 | if (!tomoyo_memory_ok(ptr)) { |
889 | kfree(ptr); | 889 | kfree(ptr); |
890 | ptr = NULL; | 890 | ptr = NULL; |
@@ -1089,7 +1089,7 @@ static int tomoyo_update_manager_entry(const char *manager, | |||
1089 | if (!saved_manager) | 1089 | if (!saved_manager) |
1090 | return -ENOMEM; | 1090 | return -ENOMEM; |
1091 | if (!is_delete) | 1091 | if (!is_delete) |
1092 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); | 1092 | entry = kmalloc(sizeof(*entry), GFP_NOFS); |
1093 | mutex_lock(&tomoyo_policy_lock); | 1093 | mutex_lock(&tomoyo_policy_lock); |
1094 | list_for_each_entry_rcu(ptr, &tomoyo_policy_manager_list, list) { | 1094 | list_for_each_entry_rcu(ptr, &tomoyo_policy_manager_list, list) { |
1095 | if (ptr->manager != saved_manager) | 1095 | if (ptr->manager != saved_manager) |
@@ -1369,7 +1369,6 @@ static bool tomoyo_print_path_acl(struct tomoyo_io_buffer *head, | |||
1369 | { | 1369 | { |
1370 | int pos; | 1370 | int pos; |
1371 | u8 bit; | 1371 | u8 bit; |
1372 | const char *atmark = ""; | ||
1373 | const char *filename; | 1372 | const char *filename; |
1374 | const u32 perm = ptr->perm | (((u32) ptr->perm_high) << 16); | 1373 | const u32 perm = ptr->perm | (((u32) ptr->perm_high) << 16); |
1375 | 1374 | ||
@@ -1384,8 +1383,7 @@ static bool tomoyo_print_path_acl(struct tomoyo_io_buffer *head, | |||
1384 | continue; | 1383 | continue; |
1385 | msg = tomoyo_path2keyword(bit); | 1384 | msg = tomoyo_path2keyword(bit); |
1386 | pos = head->read_avail; | 1385 | pos = head->read_avail; |
1387 | if (!tomoyo_io_printf(head, "allow_%s %s%s\n", msg, | 1386 | if (!tomoyo_io_printf(head, "allow_%s %s\n", msg, filename)) |
1388 | atmark, filename)) | ||
1389 | goto out; | 1387 | goto out; |
1390 | } | 1388 | } |
1391 | head->read_bit = 0; | 1389 | head->read_bit = 0; |
@@ -1408,8 +1406,6 @@ static bool tomoyo_print_path2_acl(struct tomoyo_io_buffer *head, | |||
1408 | struct tomoyo_path2_acl *ptr) | 1406 | struct tomoyo_path2_acl *ptr) |
1409 | { | 1407 | { |
1410 | int pos; | 1408 | int pos; |
1411 | const char *atmark1 = ""; | ||
1412 | const char *atmark2 = ""; | ||
1413 | const char *filename1; | 1409 | const char *filename1; |
1414 | const char *filename2; | 1410 | const char *filename2; |
1415 | const u8 perm = ptr->perm; | 1411 | const u8 perm = ptr->perm; |
@@ -1423,8 +1419,8 @@ static bool tomoyo_print_path2_acl(struct tomoyo_io_buffer *head, | |||
1423 | continue; | 1419 | continue; |
1424 | msg = tomoyo_path22keyword(bit); | 1420 | msg = tomoyo_path22keyword(bit); |
1425 | pos = head->read_avail; | 1421 | pos = head->read_avail; |
1426 | if (!tomoyo_io_printf(head, "allow_%s %s%s %s%s\n", msg, | 1422 | if (!tomoyo_io_printf(head, "allow_%s %s %s\n", msg, |
1427 | atmark1, filename1, atmark2, filename2)) | 1423 | filename1, filename2)) |
1428 | goto out; | 1424 | goto out; |
1429 | } | 1425 | } |
1430 | head->read_bit = 0; | 1426 | head->read_bit = 0; |
@@ -1886,7 +1882,7 @@ static int tomoyo_read_self_domain(struct tomoyo_io_buffer *head) | |||
1886 | */ | 1882 | */ |
1887 | static int tomoyo_open_control(const u8 type, struct file *file) | 1883 | static int tomoyo_open_control(const u8 type, struct file *file) |
1888 | { | 1884 | { |
1889 | struct tomoyo_io_buffer *head = kzalloc(sizeof(*head), GFP_KERNEL); | 1885 | struct tomoyo_io_buffer *head = kzalloc(sizeof(*head), GFP_NOFS); |
1890 | 1886 | ||
1891 | if (!head) | 1887 | if (!head) |
1892 | return -ENOMEM; | 1888 | return -ENOMEM; |
@@ -1947,7 +1943,7 @@ static int tomoyo_open_control(const u8 type, struct file *file) | |||
1947 | } else { | 1943 | } else { |
1948 | if (!head->readbuf_size) | 1944 | if (!head->readbuf_size) |
1949 | head->readbuf_size = 4096 * 2; | 1945 | head->readbuf_size = 4096 * 2; |
1950 | head->read_buf = kzalloc(head->readbuf_size, GFP_KERNEL); | 1946 | head->read_buf = kzalloc(head->readbuf_size, GFP_NOFS); |
1951 | if (!head->read_buf) { | 1947 | if (!head->read_buf) { |
1952 | kfree(head); | 1948 | kfree(head); |
1953 | return -ENOMEM; | 1949 | return -ENOMEM; |
@@ -1961,7 +1957,7 @@ static int tomoyo_open_control(const u8 type, struct file *file) | |||
1961 | head->write = NULL; | 1957 | head->write = NULL; |
1962 | } else if (head->write) { | 1958 | } else if (head->write) { |
1963 | head->writebuf_size = 4096 * 2; | 1959 | head->writebuf_size = 4096 * 2; |
1964 | head->write_buf = kzalloc(head->writebuf_size, GFP_KERNEL); | 1960 | head->write_buf = kzalloc(head->writebuf_size, GFP_NOFS); |
1965 | if (!head->write_buf) { | 1961 | if (!head->write_buf) { |
1966 | kfree(head->read_buf); | 1962 | kfree(head->read_buf); |
1967 | kfree(head); | 1963 | kfree(head); |