Hello.
A problem was discovered in TOMOYO Linux 1.6.0 - 1.6.5 .
When only "allow_read/write" is given and no other permissions
(e.g. "allow_create") is given, opening for reading and writing
(i.e. open(O_RDWR)) is allowed but opening for reading (i.e. open(O_RDONLY))
and opening for writing (i.e. open(O_WRONLY)) are rejected.
Inside TOMOYO Linux 1.6 , permissions for files are stored using bitmap
(bit 0 for "allow open(O_RDWR)", bit 1 for "allow execve()",
bit 2 for "allow open(O_RDONLY)", bit 3 for "allow open(O_WRONLY)",
bit 4 for "allow create()", bit 5 for "allow unlink()" and so on).
Bit 0 is logical multiplication of bit 2 and bit 3.
However, due to a bug in initialization of the bitmap,
if "allow_read/write" is the only entry,
only bit 0 is turned on and bit 2 and bit 3 remain turned off.
I will release fixed version as version 1.6.6 .
If you built your kernel from source, please apply the below patch
and recompile the kernel.
A workaround for systems which are not permitted to reboot is to reload
the policy. Running
# ccs-savepolicy -d | ccs-loadpolicy -d
will turn on bit 2 and bit 3 if bit 0 is on.
Sincerely.
diff -urp 1.6.5/fs/tomoyo_file.c 1.6.5-hotfix/fs/tomoyo_file.c
--- 1.6.5/fs/tomoyo_file.c 2008-12-25 09:00:00.000000000 +0900
+++ 1.6.5-hotfix/fs/tomoyo_file.c 2009-01-28 14:09:47.157039688 +0900
@@ -1038,6 +1038,8 @@ static int update_single_path_acl(const
if (!acl)
goto out;
acl->perm = perm;
+ if (perm == (1 << TYPE_READ_WRITE_ACL))
+ acl->perm |= rw_mask;
acl->u_is_group = is_group;
acl->u.filename = saved_filename;
error = ccs_add_domain_acl(domain, &acl->head);
_______________________________________________
tomoyo-users-en mailing list
[email protected]
http://lists.sourceforge.jp/mailman/listinfo/tomoyo-users-en