aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-08-08 15:14:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-08-08 15:14:51 -0400
commit87302700402b2708c49f89970c295465cc8e5523 (patch)
tree94aa87d5219a04c49de0d9e212b858cad3ebf5ba
parent5c723ba5b7886909b2e430f2eae454c33f7fe5c6 (diff)
parent4d81897139ffb738ee14b6f84f63f93ecda1136b (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: TOMOYO: Fix incomplete read of /sys/kernel/security/tomoyo/profile
-rw-r--r--security/tomoyo/common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index c8439cf2a448..2e43aec1c36b 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -710,8 +710,10 @@ static void tomoyo_read_profile(struct tomoyo_io_buffer *head)
710 head->r.index++) 710 head->r.index++)
711 if (ns->profile_ptr[head->r.index]) 711 if (ns->profile_ptr[head->r.index])
712 break; 712 break;
713 if (head->r.index == TOMOYO_MAX_PROFILES) 713 if (head->r.index == TOMOYO_MAX_PROFILES) {
714 head->r.eof = true;
714 return; 715 return;
716 }
715 head->r.step++; 717 head->r.step++;
716 break; 718 break;
717 case 2: 719 case 2:
@@ -723,6 +725,7 @@ static void tomoyo_read_profile(struct tomoyo_io_buffer *head)
723 tomoyo_io_printf(head, "%u-COMMENT=", index); 725 tomoyo_io_printf(head, "%u-COMMENT=", index);
724 tomoyo_set_string(head, comment ? comment->name : ""); 726 tomoyo_set_string(head, comment ? comment->name : "");
725 tomoyo_set_lf(head); 727 tomoyo_set_lf(head);
728 tomoyo_print_namespace(head);
726 tomoyo_io_printf(head, "%u-PREFERENCE={ ", index); 729 tomoyo_io_printf(head, "%u-PREFERENCE={ ", index);
727 for (i = 0; i < TOMOYO_MAX_PREF; i++) 730 for (i = 0; i < TOMOYO_MAX_PREF; i++)
728 tomoyo_io_printf(head, "%s=%u ", 731 tomoyo_io_printf(head, "%s=%u ",