--- trunk/1.6.x/ccs-patch/README.ccs 2008/03/24 03:50:04 1052 +++ trunk/1.6.x/ccs-patch/README.ccs 2008/06/12 01:38:25 1286 @@ -1,7 +1,7 @@ Notes for TOMOYO Linux project This is a handy Mandatory Access Control patch for Linux kernels. -This patch is released under the GPL. +This patch is released under the GPLv2. Project URL: http://tomoyo.sourceforge.jp/ @@ -1146,11 +1146,11 @@ Fix 2008/02/05 - @ Use find_task_by_vpid() instead of find_task_pid(). + @ Use find_task_by_vpid() instead of find_task_by_pid(). Kernel 2.6.24 introduced PID namespace. To search PID given from userland, the kernel needs to use - find_task_by_vpid() instead of find_task_pid(). + find_task_by_vpid() instead of find_task_by_pid(). Fix 2008/02/14 @@ -1247,8 +1247,8 @@ By default, this handler does nothing (i.e. merely reject execve() request). You can specify any program to start what you want to do. - You can redirect attackers to somewhere else (e.g. honeypot). - This makes it possible to act your Linux box as an on-demand honeypot + You can redirect attackers to somewhere else (e.g. honey pot). + This makes it possible to act your Linux box as an on-demand honey pot while keeping regular services for your usage. You can collect information of the attacker (e.g. IP address) and @@ -1301,28 +1301,28 @@ Fix 2008/03/10 - @ Rename "force_alt_exec" keyword to "preferred_execute_handler". + @ Rename "force_alt_exec" keyword to "execute_handler". To be able to use different programs for validating execve() parameters, I moved the location to specify the program's pathname from profile to domain policy. - The "preferred_execute_handler" keyword takes one pathname which is + The "execute_handler" keyword takes one pathname which is invoked whenever execve() request is issued. Thus, any "allow_execute" - keywords in a domain with "preferred_execute_handler" are ignored. + keywords in a domain with "execute_handler" are ignored. This keyword is designed for validating expected/desirable execve() requests in userspace, although there is no way to tell the caller that the execve() request was rejected. - @ Rename "alt_exec" keyword to "default_execute_handler". + @ Rename "alt_exec" keyword to "denied_execute_handler". - The "default_execute_handler" keyword takes one pathname which is + The "denied_execute_handler" keyword takes one pathname which is invoked only when execve() request was rejected. In other words, this program is invoked only when the following conditions are met. - (1) None of "allow_execute" keywords in the domain didn't match. + (1) None of "allow_execute" keywords in the domain matched. (2) The execve() request was rejected in enforcing mode. - (3) "preferred_execute_handler" keyword is not used by the domain. + (3) "execute_handler" keyword is not used by the domain. This keyword is designed for handling unexpected/undesirable execve() requests, to redirect the process issuing such requests to somewhere. @@ -1336,3 +1336,161 @@ Locking order in pre_vfs_link() and pre_vfs_unlink() for 2.4 kernels after 2.4.33 were different from before 2.4.32 . + +Fix 2008/03/28 + + @ Disable execute handler loop. + + To be able to use "execute_handler" in a "keep_domain" domain, + ignore "execute_handler" and "denied_execute_handler" keywords + if the current process is executing programs specified by + "execute_handler" or "denied_execute_handler" keyword. + + This exception is needed to avoid infinite execute handler loop. + If a domain has both "keep_domain" and "execute_handler", + any execute request by that domain is handled by an execute handler, + and the execute handler attempts to process original execute request. + But the original execute request is handled by the same execute handler + unless the execute handler ignores "execute_handler". + + @ Update coding style. + + I rewrote the code to pass scripts/checkpatch.pl as much as possible. + Function names were changed to use only lower letters. + +Version 1.6.0 2008/04/01 Feature enhancement release. + +Fix 2008/04/14 + + @ Fix "Compilation failures" and "Initialization ordering bugs" + with kernels before 2.4.30/2.6.11 . + + 2.6 kernels before 2.6.9 didn't have include/linux/hardirq.h , + resulting compilation error at #include . + I added #elif condition. + + CentOS 4.6's 2.6.9 kernel calls do_execve() before initialization of + ccs_alloc(), resulting NULL pointer dereference. + I changed __initcall to core_initcall. + + CentOS 4.6's 2.6.9 kernel backported kzalloc() from 2.6.14 , + resulting compilation error at kzalloc(). + I modified prototype of kzalloc(). + +Fix 2008/04/20 + + @ Fix "Compilation failures" with kernels before 2.4.30/2.6.11 . + + Turbolinux 10 Server's 2.6.8 kernel backported kzalloc() as an inlined + function, resulting compilation error at kzalloc(). + I converted kzalloc() from an inlined function into a macro. + +Fix 2008/04/21 + + @ Add workaround for gcc 3.2.2's inline bug. + + RedHat Linux 9's gcc 3.2.2 generated a bad code + if ((var_of_u8 & 0x000000BF) & 0x80000000) { } + where the expected code is + if ((var_of_u8 & 0xBF) & 0x80) { } + when embedding ccs_acl_type2() into print_entry(), + resulting runtime BUG(). + I added the expected code explicitly as a workaround. + +Fix 2008/05/06 + + @ Add memory quota. + + 1.5.x returns -ENOMEM when FindNextDomain() failed to create a new + domain, but I forgot to return -ENOMEM when find_next_domain() failed to + create a new domain. + + A domain is automatically created by find_next_domain() only if + the domain for the requested program doesn't exist. + This behavior is for the administrator's convenience. + The administrator needn't to know how many domains are needed for running + the whole programs in the system beforehand when developing the policy. + But the administrator does not want the kernel to reject execution of the + requested program when developing the policy. + + So, I think it is better to grant execution of programs even if + find_next_domain() failed to create a new domain than reject execution. + Thus, I decided not to return -ENOMEM when find_next_domain() failed to + create a new domain. This exception breaks the domain transition rules, + so I print "transition_failed" warning in /proc/ccs/domain_policy + when this exception happened. + + Also, to prevent the system from being halted by unexpectedly allocating + all kernel memory for the policy, I added memory quota. + This quota is configurable via /proc/ccs/meminfo like + + echo Shared: 1048576 > /proc/ccs/meminfo + echo Private: 1048576 > /proc/ccs/meminfo + +Version 1.6.1 2008/05/10 Bug fix release. + +Fix 2008/06/04 + + @ Check open mode of /proc/ccs/ interface. + + It turned out that I can avoid allocating memory for reading if + FMODE_READ is not set and memory for writing if FMODE_WRITE is not set. + + @ Wait for completion of /sbin/ccs-init . + + Since 2.4 kernel's call_usermodehelper() can't wait for termination of + the executed program, I was using the close() request of + /proc/ccs/meminfo to indicate that loading policy has finished. + But since /proc/ccs/meminfo could be accessed for setting memory quota + by /etc/ccs/ccs-post-init , I stopped using the close() request. + The policy loader no longer need to access /proc/ccs/meminfo to notify + the kernel that loading policy has finished. + +Fix 2008/06/05 + + @ Fix realpath for pipes and sockets. + + Kernel 2.6.22 and later use different method for calculating d_path(). + Since fs/realpath.c didn't notice the change, the realpath of pipes + appeared as "pipe:" rather than "pipe:[\$]" when they are opened via + /proc/PID/fd/ directory. + + @ Add process's information into /proc/ccs/query . + + While /proc/ccs/grant_log and /proc/ccs/reject_log contain process's + information, /proc/ccs/query doesn't contain it. + To be able to utilize ccs-queryd and ccs-notifyd more, I added it into + /proc/ccs/query . + +Fix 2008/06/10 + + @ Allow using patterns for globally readable files. + + To allow users specify locale specific files to globally readable files, + I relaxed checking in update_globally_readable_entry(). + + @ Move ALLOW_ENFORCE_GRACE=enabled checking to write_answer(). + + To allow users use ccs-notifyd without turning ALLOW_ENFORCE_GRACE on, + I moved it from ccs_check_supervisor() to write_answer(). + +Fix 2008/06/11 + + @ Remove ALLOW_ENFORCE_GRACE parameter. + + Since unexpected requests caused by doing software updates can happen + in all profiles, users likely have to write ALLOW_ENFORCE_GRACE=enabled + to all profiles. And it makes meaningless to allow users to selectively + enable specific profile's ALLOW_ENFORCE_GRACE parameter. + So, I removed ALLOW_ENFORCE_GRACE parameter. + Now, the system behaves as if ALLOW_ENFORCE_GRACE=enabled is specified. + The behavior of "delayed enforcing" mode is defined in the following + order. + + (1) The requests are rejected immediately if nobody is opening + /proc/ccs/query interface. + (2) The requests will be rejected in 10 seconds if somebody other than + ccs-queryd (such as less(1)) is opening /proc/ccs/query interface, + for such process doesn't write dummy decisions. + +Version 1.6.2 2008/??/?? Usability enhancement release.