diff options
Diffstat (limited to 'security/tomoyo/domain.c')
-rw-r--r-- | security/tomoyo/domain.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c index ee43631f049b..aa119ca5a782 100644 --- a/security/tomoyo/domain.c +++ b/security/tomoyo/domain.c | |||
@@ -67,14 +67,12 @@ void tomoyo_set_domain_flag(struct tomoyo_domain_info *domain, | |||
67 | { | 67 | { |
68 | /* We need to serialize because this is bitfield operation. */ | 68 | /* We need to serialize because this is bitfield operation. */ |
69 | static DEFINE_SPINLOCK(lock); | 69 | static DEFINE_SPINLOCK(lock); |
70 | /***** CRITICAL SECTION START *****/ | ||
71 | spin_lock(&lock); | 70 | spin_lock(&lock); |
72 | if (!is_delete) | 71 | if (!is_delete) |
73 | domain->flags |= flags; | 72 | domain->flags |= flags; |
74 | else | 73 | else |
75 | domain->flags &= ~flags; | 74 | domain->flags &= ~flags; |
76 | spin_unlock(&lock); | 75 | spin_unlock(&lock); |
77 | /***** CRITICAL SECTION END *****/ | ||
78 | } | 76 | } |
79 | 77 | ||
80 | /** | 78 | /** |
@@ -135,7 +133,6 @@ static int tomoyo_update_domain_initializer_entry(const char *domainname, | |||
135 | saved_program = tomoyo_save_name(program); | 133 | saved_program = tomoyo_save_name(program); |
136 | if (!saved_program) | 134 | if (!saved_program) |
137 | return -ENOMEM; | 135 | return -ENOMEM; |
138 | /***** EXCLUSIVE SECTION START *****/ | ||
139 | down_write(&tomoyo_domain_initializer_list_lock); | 136 | down_write(&tomoyo_domain_initializer_list_lock); |
140 | list_for_each_entry(ptr, &tomoyo_domain_initializer_list, list) { | 137 | list_for_each_entry(ptr, &tomoyo_domain_initializer_list, list) { |
141 | if (ptr->is_not != is_not || | 138 | if (ptr->is_not != is_not || |
@@ -161,7 +158,6 @@ static int tomoyo_update_domain_initializer_entry(const char *domainname, | |||
161 | error = 0; | 158 | error = 0; |
162 | out: | 159 | out: |
163 | up_write(&tomoyo_domain_initializer_list_lock); | 160 | up_write(&tomoyo_domain_initializer_list_lock); |
164 | /***** EXCLUSIVE SECTION END *****/ | ||
165 | return error; | 161 | return error; |
166 | } | 162 | } |
167 | 163 | ||
@@ -314,7 +310,6 @@ static int tomoyo_update_domain_keeper_entry(const char *domainname, | |||
314 | saved_domainname = tomoyo_save_name(domainname); | 310 | saved_domainname = tomoyo_save_name(domainname); |
315 | if (!saved_domainname) | 311 | if (!saved_domainname) |
316 | return -ENOMEM; | 312 | return -ENOMEM; |
317 | /***** EXCLUSIVE SECTION START *****/ | ||
318 | down_write(&tomoyo_domain_keeper_list_lock); | 313 | down_write(&tomoyo_domain_keeper_list_lock); |
319 | list_for_each_entry(ptr, &tomoyo_domain_keeper_list, list) { | 314 | list_for_each_entry(ptr, &tomoyo_domain_keeper_list, list) { |
320 | if (ptr->is_not != is_not || | 315 | if (ptr->is_not != is_not || |
@@ -340,7 +335,6 @@ static int tomoyo_update_domain_keeper_entry(const char *domainname, | |||
340 | error = 0; | 335 | error = 0; |
341 | out: | 336 | out: |
342 | up_write(&tomoyo_domain_keeper_list_lock); | 337 | up_write(&tomoyo_domain_keeper_list_lock); |
343 | /***** EXCLUSIVE SECTION END *****/ | ||
344 | return error; | 338 | return error; |
345 | } | 339 | } |
346 | 340 | ||
@@ -475,7 +469,6 @@ static int tomoyo_update_alias_entry(const char *original_name, | |||
475 | saved_aliased_name = tomoyo_save_name(aliased_name); | 469 | saved_aliased_name = tomoyo_save_name(aliased_name); |
476 | if (!saved_original_name || !saved_aliased_name) | 470 | if (!saved_original_name || !saved_aliased_name) |
477 | return -ENOMEM; | 471 | return -ENOMEM; |
478 | /***** EXCLUSIVE SECTION START *****/ | ||
479 | down_write(&tomoyo_alias_list_lock); | 472 | down_write(&tomoyo_alias_list_lock); |
480 | list_for_each_entry(ptr, &tomoyo_alias_list, list) { | 473 | list_for_each_entry(ptr, &tomoyo_alias_list, list) { |
481 | if (ptr->original_name != saved_original_name || | 474 | if (ptr->original_name != saved_original_name || |
@@ -498,7 +491,6 @@ static int tomoyo_update_alias_entry(const char *original_name, | |||
498 | error = 0; | 491 | error = 0; |
499 | out: | 492 | out: |
500 | up_write(&tomoyo_alias_list_lock); | 493 | up_write(&tomoyo_alias_list_lock); |
501 | /***** EXCLUSIVE SECTION END *****/ | ||
502 | return error; | 494 | return error; |
503 | } | 495 | } |
504 | 496 | ||
@@ -566,7 +558,6 @@ int tomoyo_delete_domain(char *domainname) | |||
566 | 558 | ||
567 | name.name = domainname; | 559 | name.name = domainname; |
568 | tomoyo_fill_path_info(&name); | 560 | tomoyo_fill_path_info(&name); |
569 | /***** EXCLUSIVE SECTION START *****/ | ||
570 | down_write(&tomoyo_domain_list_lock); | 561 | down_write(&tomoyo_domain_list_lock); |
571 | /* Is there an active domain? */ | 562 | /* Is there an active domain? */ |
572 | list_for_each_entry(domain, &tomoyo_domain_list, list) { | 563 | list_for_each_entry(domain, &tomoyo_domain_list, list) { |
@@ -580,7 +571,6 @@ int tomoyo_delete_domain(char *domainname) | |||
580 | break; | 571 | break; |
581 | } | 572 | } |
582 | up_write(&tomoyo_domain_list_lock); | 573 | up_write(&tomoyo_domain_list_lock); |
583 | /***** EXCLUSIVE SECTION END *****/ | ||
584 | return 0; | 574 | return 0; |
585 | } | 575 | } |
586 | 576 | ||
@@ -599,7 +589,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char * | |||
599 | struct tomoyo_domain_info *domain = NULL; | 589 | struct tomoyo_domain_info *domain = NULL; |
600 | const struct tomoyo_path_info *saved_domainname; | 590 | const struct tomoyo_path_info *saved_domainname; |
601 | 591 | ||
602 | /***** EXCLUSIVE SECTION START *****/ | ||
603 | down_write(&tomoyo_domain_list_lock); | 592 | down_write(&tomoyo_domain_list_lock); |
604 | domain = tomoyo_find_domain(domainname); | 593 | domain = tomoyo_find_domain(domainname); |
605 | if (domain) | 594 | if (domain) |
@@ -618,7 +607,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char * | |||
618 | domain->domainname != saved_domainname) | 607 | domain->domainname != saved_domainname) |
619 | continue; | 608 | continue; |
620 | flag = false; | 609 | flag = false; |
621 | /***** CRITICAL SECTION START *****/ | ||
622 | read_lock(&tasklist_lock); | 610 | read_lock(&tasklist_lock); |
623 | for_each_process(p) { | 611 | for_each_process(p) { |
624 | if (tomoyo_real_domain(p) != domain) | 612 | if (tomoyo_real_domain(p) != domain) |
@@ -627,7 +615,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char * | |||
627 | break; | 615 | break; |
628 | } | 616 | } |
629 | read_unlock(&tasklist_lock); | 617 | read_unlock(&tasklist_lock); |
630 | /***** CRITICAL SECTION END *****/ | ||
631 | if (flag) | 618 | if (flag) |
632 | continue; | 619 | continue; |
633 | list_for_each_entry(ptr, &domain->acl_info_list, list) { | 620 | list_for_each_entry(ptr, &domain->acl_info_list, list) { |
@@ -650,7 +637,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char * | |||
650 | } | 637 | } |
651 | out: | 638 | out: |
652 | up_write(&tomoyo_domain_list_lock); | 639 | up_write(&tomoyo_domain_list_lock); |
653 | /***** EXCLUSIVE SECTION END *****/ | ||
654 | return domain; | 640 | return domain; |
655 | } | 641 | } |
656 | 642 | ||