aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/condition.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-02-07 19:34:10 -0500
committerEric W. Biederman <ebiederm@xmission.com>2012-09-21 06:13:22 -0400
commit609fcd1b3a55f99667c61609895c83019b21baad (patch)
treef90cec33d1f1e0922c28d5528cd0f535dc235b92 /security/tomoyo/condition.c
parent2db81452931eb51cc739d6e495cf1bd4860c3c99 (diff)
userns: Convert tomoyo to use kuid and kgid where appropriate
Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'security/tomoyo/condition.c')
-rw-r--r--security/tomoyo/condition.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/security/tomoyo/condition.c b/security/tomoyo/condition.c
index 986330b8c73e..63681e8be628 100644
--- a/security/tomoyo/condition.c
+++ b/security/tomoyo/condition.c
@@ -813,28 +813,28 @@ bool tomoyo_condition(struct tomoyo_request_info *r,
813 unsigned long value = 0; 813 unsigned long value = 0;
814 switch (index) { 814 switch (index) {
815 case TOMOYO_TASK_UID: 815 case TOMOYO_TASK_UID:
816 value = current_uid(); 816 value = from_kuid(&init_user_ns, current_uid());
817 break; 817 break;
818 case TOMOYO_TASK_EUID: 818 case TOMOYO_TASK_EUID:
819 value = current_euid(); 819 value = from_kuid(&init_user_ns, current_euid());
820 break; 820 break;
821 case TOMOYO_TASK_SUID: 821 case TOMOYO_TASK_SUID:
822 value = current_suid(); 822 value = from_kuid(&init_user_ns, current_suid());
823 break; 823 break;
824 case TOMOYO_TASK_FSUID: 824 case TOMOYO_TASK_FSUID:
825 value = current_fsuid(); 825 value = from_kuid(&init_user_ns, current_fsuid());
826 break; 826 break;
827 case TOMOYO_TASK_GID: 827 case TOMOYO_TASK_GID:
828 value = current_gid(); 828 value = from_kgid(&init_user_ns, current_gid());
829 break; 829 break;
830 case TOMOYO_TASK_EGID: 830 case TOMOYO_TASK_EGID:
831 value = current_egid(); 831 value = from_kgid(&init_user_ns, current_egid());
832 break; 832 break;
833 case TOMOYO_TASK_SGID: 833 case TOMOYO_TASK_SGID:
834 value = current_sgid(); 834 value = from_kgid(&init_user_ns, current_sgid());
835 break; 835 break;
836 case TOMOYO_TASK_FSGID: 836 case TOMOYO_TASK_FSGID:
837 value = current_fsgid(); 837 value = from_kgid(&init_user_ns, current_fsgid());
838 break; 838 break;
839 case TOMOYO_TASK_PID: 839 case TOMOYO_TASK_PID:
840 value = tomoyo_sys_getpid(); 840 value = tomoyo_sys_getpid();
@@ -970,13 +970,13 @@ bool tomoyo_condition(struct tomoyo_request_info *r,
970 case TOMOYO_PATH2_UID: 970 case TOMOYO_PATH2_UID:
971 case TOMOYO_PATH1_PARENT_UID: 971 case TOMOYO_PATH1_PARENT_UID:
972 case TOMOYO_PATH2_PARENT_UID: 972 case TOMOYO_PATH2_PARENT_UID:
973 value = stat->uid; 973 value = from_kuid(&init_user_ns, stat->uid);
974 break; 974 break;
975 case TOMOYO_PATH1_GID: 975 case TOMOYO_PATH1_GID:
976 case TOMOYO_PATH2_GID: 976 case TOMOYO_PATH2_GID:
977 case TOMOYO_PATH1_PARENT_GID: 977 case TOMOYO_PATH1_PARENT_GID:
978 case TOMOYO_PATH2_PARENT_GID: 978 case TOMOYO_PATH2_PARENT_GID:
979 value = stat->gid; 979 value = from_kgid(&init_user_ns, stat->gid);
980 break; 980 break;
981 case TOMOYO_PATH1_INO: 981 case TOMOYO_PATH1_INO:
982 case TOMOYO_PATH2_INO: 982 case TOMOYO_PATH2_INO: