769 |
|
|
770 |
@ Allow reuse of memory allocated for domain policy. |
@ Allow reuse of memory allocated for domain policy. |
771 |
|
|
772 |
As with domain policy, unlike other policies, didn't have |
Regarding domain policy, unlike other policies, didn't have |
773 |
"is_deleted" flag and new memory were allocated |
"is_deleted" flag and new memory were allocated |
774 |
if the deleted entries are given again. |
if the deleted entries are given again. |
775 |
But to allow administrators switch domain policy periodically, |
But to allow administrators switch domain policy periodically, |
971 |
@ Move external policy loader from /.init to /sbin/ccs-init . |
@ Move external policy loader from /.init to /sbin/ccs-init . |
972 |
|
|
973 |
Installing programs in / directory is not good for packaging. |
Installing programs in / directory is not good for packaging. |
974 |
|
|
975 |
|
Fix 2007/08/13 |
976 |
|
|
977 |
|
@ Update external policy loader. |
978 |
|
|
979 |
|
It turned out that /sbin/ccs-init invoked via call_usermodehelper() |
980 |
|
can handle interactive operations by opening /dev/console . |
981 |
|
Now, there is no difference between init=/sbin/ccs-init and |
982 |
|
call_usermodehelper("/sbin/ccs-init"), and users no longer need to |
983 |
|
add init=/sbin/ccs-init parameter to load policy before /sbin/init starts. |
984 |
|
|
985 |
|
Fix 2007/08/14 |
986 |
|
|
987 |
|
@ Update recvmsg() hooks. |
988 |
|
|
989 |
|
Until now, it was impossible to apply network access control for |
990 |
|
incoming UDP and RAW packets if they are brought to userland using |
991 |
|
read() or recvmsg() with NULL address because address buffer is NULL. |
992 |
|
I moved hooks from sock_recvmsg() to skb_recv_datagram() so that |
993 |
|
network access control for incoming UDP and RAW packets always work. |
994 |
|
|
995 |
|
Fix 2007/08/16 |
996 |
|
|
997 |
|
@ Return appropriate error code for CheckMountPermission(). |
998 |
|
|
999 |
|
I was returning -EPERM if something is wrong with CheckMountPermission(). |
1000 |
|
But SELinux determines whether selinuxfs is supported by kernel |
1001 |
|
based on whether error code is -ENODEV or not. |
1002 |
|
So I stopped returning -EPERM unconditionally. |
1003 |
|
|
1004 |
|
Fix 2007/08/17 |
1005 |
|
|
1006 |
|
@ Remove initializer directive. |
1007 |
|
|
1008 |
|
Use "initialize_domain" instrad of "initializer". |
1009 |
|
|
1010 |
|
Fix 2007/08/21 |
1011 |
|
|
1012 |
|
@ Fix "allow_argv0 ... if if ..." bug. |
1013 |
|
|
1014 |
|
It was impossible to use a word "if" to the second argument of |
1015 |
|
allow_argv0 if condition part is used. |
1016 |
|
|
1017 |
|
Fix 2007/08/24 |
1018 |
|
|
1019 |
|
@ Move /proc/ccs/\*/\* to /proc/ccs/\* . |
1020 |
|
|
1021 |
|
Some pathnames for /proc/ccs/ interface were changed. |
1022 |
|
|
1023 |
|
Fix 2007/09/05 |
1024 |
|
|
1025 |
|
@ Drop MSG_PEEK'ed message before skb_free_datagram(). |
1026 |
|
|
1027 |
|
I need to remove head message from unwanted source |
1028 |
|
from socket's receive queue so that the caller can pick up |
1029 |
|
next message from wanted source with MSG_PEEK flags. |
1030 |
|
|
1031 |
|
Version 1.5.0 2007/09/20 Usability enhancement release. |
1032 |
|
|
1033 |
|
Fix 2007/09/27 |
1034 |
|
|
1035 |
|
@ Avoid eating memory after quota exceeded. |
1036 |
|
|
1037 |
|
Although ACL entries in a domain won't be added if the domain's quota |
1038 |
|
has exceeded, SaveName() in AddFileACL() is called anyway. |
1039 |
|
This caused unneeded memory consumption. |
1040 |
|
|
1041 |
|
Now, quota checking is done before getting domain_acl_lock lock. |
1042 |
|
This may exceed quota by one or two entries, but that won't matter. |
1043 |
|
|
1044 |
|
Fix 2007/10/16 |
1045 |
|
|
1046 |
|
@ Add environment variable check. |
1047 |
|
|
1048 |
|
There are environment variables that may cause dangerous behavior |
1049 |
|
like LD_\* . |
1050 |
|
So I introduced 'allow_env' directive that allows specified |
1051 |
|
environment variable inherited to next domain. |
1052 |
|
Unlike other permissions, this check is done at execve() time |
1053 |
|
using next domain's ACL information. |
1054 |
|
|
1055 |
|
To manage commonly inherited environments like PATH , |
1056 |
|
you can use 'allow_env' directive in exception policy |
1057 |
|
to globally grant specified environment variable. |
1058 |
|
|
1059 |
|
Fix 2007/11/05 |
1060 |
|
|
1061 |
|
@ Replace semaphore with mutex. |
1062 |
|
|
1063 |
|
I replaced semaphore with mutex. |
1064 |
|
|
1065 |
|
@ Add missing down() in AddReservedEntry(). |
1066 |
|
|
1067 |
|
Mutex debugging capability told me that I had forgotten to call down() |
1068 |
|
since TOMOYO version 1.3.2 . |
1069 |
|
This function is not called by learning mode, |
1070 |
|
so the semaphore's counter will not overflow for normal usage. |
1071 |
|
|
1072 |
|
Fix 2005/11/27 |
1073 |
|
|
1074 |
|
@ Fix ReadTable() truncation bug. |
1075 |
|
|
1076 |
|
"snprintf(str, size, format, ...) >= size" means truncated. |
1077 |
|
But I was checking for "snprintf(str, size, format, ...) > size". |
1078 |
|
As a result, some entries might be dumped without '\n'. |
1079 |
|
|
1080 |
|
@ Purge direct "->prev"/"->next" manipulation. |
1081 |
|
|
1082 |
|
All list manipulations use "struct list_head" or "struct list1_head". |
1083 |
|
"struct list1_head" doesn't have "->prev" member to save memory usage. |
1084 |
|
|
1085 |
|
Fix 2007/11/29 |
1086 |
|
|
1087 |
|
@ Add missing semaphore in GetEXE(). |
1088 |
|
|
1089 |
|
mm->mmap_sem was missing. |
1090 |
|
|
1091 |
|
Fix 2007/12/17 |
1092 |
|
|
1093 |
|
@ Remove unused EXPORT_SYMBOL(). |
1094 |
|
|
1095 |
|
Mark some functions static. |
1096 |
|
|
1097 |
|
Fix 2007/12/18 |
1098 |
|
|
1099 |
|
@ Fix AddMountACL() rejection bug. |
1100 |
|
|
1101 |
|
To my surprise, "mount --bind source dest" accepts |
1102 |
|
not only "both source and dest are directory" |
1103 |
|
but also "both source and dest are non-directory". |
1104 |
|
I was rejecting if dest is not a directory in AddMountACL(). |
1105 |
|
|
1106 |
|
@ Change log format. |
1107 |
|
|
1108 |
|
Profile number and mode is added in audit logs. |
1109 |
|
|
1110 |
|
Fix 2008/01/03 |
1111 |
|
|
1112 |
|
@ Change directive for file's read/write/execute permission. |
1113 |
|
|
1114 |
|
Directives for file's read/write/execute permissions were |
1115 |
|
4/2/1 respectively. But for easier understanding, they are now |
1116 |
|
replaced by read/write/execute (e.g. "allow_read" instead of "4"). |
1117 |
|
But for easier inputting, 4/2/1 are still accepted instead of |
1118 |
|
allow_read/allow_write/allow_execute respectively. |
1119 |
|
|
1120 |
|
@ Change internal data structure. |
1121 |
|
|
1122 |
|
Since I don't have more than 16 types of file permissions, |
1123 |
|
I combined them using bit-fields. |
1124 |
|
|
1125 |
|
Each entry had a field for conditional permission support. |
1126 |
|
But since this field is unlikely used, I separated the field from |
1127 |
|
common part. |
1128 |
|
|
1129 |
|
These changes will reduce memory used by policy. |
1130 |
|
|
1131 |
|
Fix 2008/01/15 |
1132 |
|
|
1133 |
|
@ Add ptrace() hook. |
1134 |
|
|
1135 |
|
To prevent attackers from controlling important processes using |
1136 |
|
ptrace(), I added a hook for ptrace(). |
1137 |
|
Most programs (except strace(1) and gdb(1)) won't use ptrace(2). |
1138 |
|
|
1139 |
|
@ Fix sleep condition check in CheckSocketRecvDatagramPermission(). |
1140 |
|
|
1141 |
|
It seems that correct method to use is in_atomic() |
1142 |
|
rather than in_interrupt() because in_atomic() returns nonzero |
1143 |
|
whenever scheduling is not allowed. |
1144 |
|
|
1145 |
|
Fix 2008/01/24 |
1146 |
|
|
1147 |
|
@ Support /proc/ccs/ access by non-root user. |
1148 |
|
|
1149 |
|
Until now, only root user can access /proc/ccs/ interface. |
1150 |
|
But to permit /proc/ccs/ access by non-root user so that |
1151 |
|
it won't require ssh login by root user when administrating |
1152 |
|
from remote host, I eased restrictions on this interface. |
1153 |
|
|
1154 |
|
(current->uid == 0 && current->euid == 0) || |
1155 |
|
(current->uid != 0 && current->uid == inode->i_uid) || |
1156 |
|
(current->gid != 0 && current->gid == inode->i_gid) |
1157 |
|
|
1158 |
|
The inode's uid and gid are set using chown/chgrp commands. |
1159 |
|
|
1160 |
|
Fix 2008/02/05 |
1161 |
|
|
1162 |
|
@ Use find_task_by_vpid() instead of find_task_pid(). |
1163 |
|
|
1164 |
|
Kernel 2.6.24 introduced PID namespace. |
1165 |
|
To search PID given from userland, the kernel needs to use |
1166 |
|
find_task_by_vpid() instead of find_task_pid(). |
1167 |
|
|
1168 |
|
Fix 2008/02/14 |
1169 |
|
|
1170 |
|
@ Add execve() parameter checking. |
1171 |
|
|
1172 |
|
Until now, it was impossible to check argv[] and envp[] parameters |
1173 |
|
passed to execve(). |
1174 |
|
I expanded conditional permission syntax so that |
1175 |
|
{ argc, envc, argv[] , envp[] } parameters can be checked if needed. |
1176 |
|
This will allow administrator permit execution of /bin/sh only when |
1177 |
|
/bin/sh is invoked in the form of "/bin/sh -c" and environment variable |
1178 |
|
HOME is set by specifying |
1179 |
|
|
1180 |
|
allow_execute /bin/sh if exec.argv[1]="-c" exec.envp["HOME"]!=NULL |
1181 |
|
|
1182 |
|
in the policy. |
1183 |
|
This extension will make exploit codes difficult to start /bin/sh because |
1184 |
|
they unlikely set up environment variables and unlikely specify "-c" |
1185 |
|
option when invoking /bin/sh , whereas proper functions likely set up |
1186 |
|
environment variables and likely specify "-c" option. |
1187 |
|
|
1188 |
|
Fix 2008/02/18 |
1189 |
|
|
1190 |
|
@ Add process state checking. |
1191 |
|
|
1192 |
|
Until now, it was impossible to change ACL without executing program. |
1193 |
|
I added three variables for performing stateful checking within a domain. |
1194 |
|
You can set current process's state like: |
1195 |
|
|
1196 |
|
allow_network TCP accept @TRUSTED_HOSTS 1024-65535 ; set task.state[0]=1 |
1197 |
|
allow_network TCP accept @UNTRUSTED_HOSTS 1024-65535 ; set task.state[0]=0 |
1198 |
|
|
1199 |
|
and you can use the state like |
1200 |
|
|
1201 |
|
allow_read /path/to/important/file if task.state[0]=1 |
1202 |
|
|
1203 |
|
in the policy. |
1204 |
|
The state changes when the request was granted by the MAC's policy, |
1205 |
|
so please be careful with situations where the state has changed successfully |
1206 |
|
but the request was not processed because of other reasons (e.g. out of memory). |