Discussion:
[tomoyo-users 891] kernel-2.6.39
早間義博
2011-08-29 01:35:09 UTC
Permalink
$BAa4V$G$9!#(B
tomoyo-tools-2.3.0_p20110511 $B$r;HMQ$7$F$$$^$9!#(B
2.6.39(linux-2.6.39-gentoo-r3) $B$K$J$C$F$+$i(B

<kernel> /usr/bin/xterm /etc/init.d/\* /sbin/start-stop-daemon

$B$NDI2C!&3X=,$,=PMh$^$;$s!#(B
$BF1$8(Btomoyo-tools-2.3.0_p20110511 $B$r;HMQ$7$F$$$k(B
2.6.38(linux-2.6.38-gentoo-r6)$B$G$O2DG=$G$9!#(B

2.6.39(linux-2.6.39-gentoo-r3)$B$G(B
TOMOYO-ERROR: Domain '<kernel> /usr/bin/xterm /etc/init.d/\* /sbin/start-stop-daemon' not defined.
$B$H8@$&%(%i!<$,=P$^$9$,Ev3:%I%a%$%s$NDI2C$,=PMh$^$;$s!#(B

Exception Policy $B$K$O<!$N$h$&$K;XDj$7$F$"$j$^$9!#(B
1868: initialize_domain /usr/bin/xterm
1932: no_keep_domain /etc/init.d/\* from <kernel> /usr/bin/xterm

Domain Policy $B$G$O<!$N$h$&$K;XDj$7$F$"$j$^$9!#(B
998: 2 #* /usr/bin/xterm
/bin/mount ( -> 1 )
/bin/umount ( -> 3 )
999: 1 /etc/init.d/\*
/etc/init.d/cupsd ( -> 48 )
/sbin/modprobe ( -> 800 )

/etc/init.d/\* $B$G$O(B
0: allow_execute /bin/sh
1: allow_ioctl /dev/pts/\$ 0x5401
2: allow_ioctl /dev/pts/\$ 0x5413
3: allow_read /etc/conf.d/rc
4: allow_execute /etc/init.d/cupsd
5: allow_read /etc/profile.env
6: allow_read /etc/rc.conf
7: allow_read /etc/terminfo/x/xterm
8: allow_rmdir /lib64/rc/init.d/daemons/\*/
9: allow_truncate /lib64/rc/init.d/depconfig
10: allow_write /lib64/rc/init.d/depconfig
11: allow_truncate /lib64/rc/init.d/deptree
12: allow_write /lib64/rc/init.d/deptree
13: allow_unlink /lib64/rc/init.d/exclusive/\*
14: allow_write /lib64/rc/init.d/exclusive/\*
15: allow_create /lib64/rc/init.d/exclusive/\* 0644
16: allow_create /lib64/rc/init.d/exclusive/alsasound 0664
17: allow_create /lib64/rc/init.d/exclusive/cupsd 0664
18: allow_create /lib64/rc/init.d/exclusive/dbus 0664
19: allow_create /lib64/rc/init.d/exclusive/hald 0664
20: allow_create /lib64/rc/init.d/exclusive/ntpd 0664
21: allow_create /lib64/rc/init.d/exclusive/vmware 0664
22: allow_symlink /lib64/rc/init.d/started/\*
23: allow_unlink /lib64/rc/init.d/started/\*
24: allow_symlink /lib64/rc/init.d/starting/\*
25: allow_unlink /lib64/rc/init.d/starting/\*
26: allow_symlink /lib64/rc/init.d/stopping/\*
27: allow_unlink /lib64/rc/init.d/stopping/\*
28: allow_execute /lib64/rc/sh/runscript.sh
29: allow_read /proc/\$/status
30: allow_read /proc/cpuinfo
31: allow_read /sbin/rc
32: allow_execute /sbin/start-stop-daemon

32: allow_execute /sbin/start-stop-daemon $B$O:#2s$N>u67$r4U$_DI2C(B
$B$7$F$_$^$7$?$,JQ$o$j$"$j$^$;$s$G$7$?!#(B

-- $BAa4V(B
Tetsuo Handa
2011-08-29 02:06:57 UTC
Permalink
$BAa4V5AGn(B $B$5$s$O=q$-$^$7$?!'(B
Post by 早間義博
tomoyo-tools-2.3.0_p20110511 $B$r;HMQ$7$F$$$^$9!#(B
2.6.39(linux-2.6.39-gentoo-r3) $B$K$J$C$F$+$i(B
<kernel> /usr/bin/xterm /etc/init.d/\* /sbin/start-stop-daemon
$B$NDI2C!&3X=,$,=PMh$^$;$s!#(B
$BF1$8(Btomoyo-tools-2.3.0_p20110511 $B$r;HMQ$7$F$$$k(B
2.6.38(linux-2.6.38-gentoo-r6)$B$G$O2DG=$G$9!#(B
2.6.38 $B$H(B 2.6.39 $B$H$N4V$K$O0J2<$N0c$$(B
$B!J(B http://tomoyo.sourceforge.jp/2.3/patches/2.6.36-tomoyo-fix-memory-leak-in-tomoyo_check_open_permission.patch $B!K$7$+$J$/!"(B
$B$4<ALd$NIT6q9g$,@8$8$k$h$&$JJQ99E@$O$"$j$^$;$s!#(B

# diff -upr 2.6.38 2.6.39
diff -upr 2.6.38/security/tomoyo/file.c 2.6.39/security/tomoyo/file.c
--- 2.6.38/security/tomoyo/file.c 2011-08-29 10:49:15.000000000 +0900
+++ 2.6.39/security/tomoyo/file.c 2011-08-29 10:47:34.000000000 +0900
@@ -927,7 +927,7 @@ int tomoyo_check_open_permission(struct
struct path *path, const int flag)
{
const u8 acc_mode = ACC_MODE(flag);
- int error = -ENOMEM;
+ int error = 0;
struct tomoyo_path_info buf;
struct tomoyo_request_info r;
int idx;
@@ -938,9 +938,6 @@ int tomoyo_check_open_permission(struct
buf.name = NULL;
r.mode = TOMOYO_CONFIG_DISABLED;
idx = tomoyo_read_lock();
- if (!tomoyo_get_realpath(&buf, path))
- goto out;
- error = 0;
/*
* If the filename is specified by "deny_rewrite" keyword,
* we need to check "allow_rewrite" permission when the filename is not
diff -upr 2.6.38/security/tomoyo/load_policy.c 2.6.39/security/tomoyo/load_policy.c
--- 2.6.38/security/tomoyo/load_policy.c 2011-08-29 10:49:15.000000000 +0900
+++ 2.6.39/security/tomoyo/load_policy.c 2011-08-29 10:47:34.000000000 +0900
@@ -23,7 +23,7 @@ static bool tomoyo_policy_loader_exists(
* If the initrd includes /sbin/init but real-root-dev has not
* mounted on / yet, activating MAC will block the system since
* policies are not loaded yet.
- * Thus, let do_execve() call this function everytime.
+ * Thus, let do_execve() call this function every time.
*/
struct path path;

http://tomoyo.sourceforge.jp/2.3/patches/ $BFb$K$"$k%Q%C%A72!"$H$j$o$1(B
http://tomoyo.sourceforge.jp/2.3/patches/2.6.39-tomoyo-fix-domainname-validation-in-tomoyo_correct_domain.patch $B$,(B
$BE,MQ:Q$_$+$I$&$+$r$43NG'$/$@$5$$!#!J(B linux-2.6.38-gentoo-r6 $B$G$OE,MQ:Q$_$G$b(B
linux-2.6.39-gentoo-r3 $B$G$OL$E,MQ$H$$$&2DG=@-$,$"$j$^$9!#!K(B

$B2r7h$7$J$$>l9g!"(B linux-2.6.38-gentoo-r6/security/tomoyo/ $B$H(B
linux-2.6.39-gentoo-r3/security/tomoyo/ $B$N(B diff -upr $B$K$D$$$F$*CN$i$;$/$@$5$$!#(B



$BOC$,JQ$o$j$^$9$,!"(B Horvath Andras $B$5$s$,(B tomld $B$N:G=i$N0BDjHG$r%j%j!<%9$5$l$^$7$?!#(B
http://sourceforge.jp/projects/tomoyo/lists/archive/users-en/2011-August/000404.html



$B$^$?!"%W%m%0%i%`$N<B9T5v2D!J(B file execute $B!K;XDj$K%I%a%$%sA+0\$NJ}K!$r;XDj(B
$B$G$-$k$h$&$K$9$k$H$$$&=$@5$K$D$$$F$NOC$,;O$^$C$F$$$^$9!#!J<g$KAH9~$_$GMxMQ(B
$B$5$l$F$$$kJ}$K4X78$7$^$9!#!K(B
http://sourceforge.jp/projects/tomoyo/lists/archive/dev-en/2011-August/000310.html
Tetsuo Handa
2011-08-29 02:29:09 UTC
Permalink
Post by Tetsuo Handa
2.6.38 $B$H(B 2.6.39 $B$H$N4V$K$O0J2<$N0c$$(B
$B!J(B http://tomoyo.sourceforge.jp/2.3/patches/2.6.36-tomoyo-fix-memory-leak-in-tomoyo_check_open_permission.patch $B!K$7$+$J$/!"(B
$B$4$a$s$J$5$$!#(B git reset $B$G<h$j=P$7$?%U%!%$%k$,8E$+$C$?$h$&$G$9!#(B
2.6.38 $B$H(B 2.6.39 $B$N:9J,$O0J2<$N$h$&$K$J$C$F$$$^$9!#!J7kO@$OJQ$o$j$^$;$s!#!K(B

# diff -upr linux-2.6.38.8/ linux-2.6.39.4/
diff -upr linux-2.6.38.8/security/tomoyo/load_policy.c linux-2.6.39.4/security/tomoyo/load_policy.c
--- linux-2.6.38.8/security/tomoyo/load_policy.c 2011-03-15 10:20:32.000000000 +0900
+++ linux-2.6.39.4/security/tomoyo/load_policy.c 2011-05-19 13:06:34.000000000 +0900
@@ -23,7 +23,7 @@ static bool tomoyo_policy_loader_exists(
* If the initrd includes /sbin/init but real-root-dev has not
* mounted on / yet, activating MAC will block the system since
* policies are not loaded yet.
- * Thus, let do_execve() call this function everytime.
+ * Thus, let do_execve() call this function every time.
*/
struct path path;

diff -upr linux-2.6.38.8/security/tomoyo/mount.c linux-2.6.39.4/security/tomoyo/mount.c
--- linux-2.6.38.8/security/tomoyo/mount.c 2011-03-15 10:20:32.000000000 +0900
+++ linux-2.6.39.4/security/tomoyo/mount.c 2011-08-29 11:20:27.000000000 +0900
@@ -138,7 +138,7 @@ static int tomoyo_mount_acl(struct tomoy
}
if (need_dev) {
/* Get mount point or device file. */
- if (kern_path(dev_name, LOOKUP_FOLLOW, &path)) {
+ if (!dev_name || kern_path(dev_name, LOOKUP_FOLLOW, &path)) {
error = -ENOENT;
goto out;
}
早間義博
2011-08-29 03:37:29 UTC
Permalink
$BAa4V$G$9!#(B

portage $B$r;HMQ$7$F$$$k$N$G(B patch $B$NE,MQ$O:3$+H=$8$,$?$$$N$G!"%=!<(B
$B%9%3!<%I$NHf3S$r$7$^$7$?!#(B

# cd /usr/src/linux-2.6.39-gentoo-r3/security/tomoyo/
# for ff in *.c *.h Kconfig Makefile;do DX=`diff $ff /usr/src/linux-2.6.38-gentoo-r6/security/tomoyo/$ff`;if [ ! "X$DX" = "X" ] ; then echo $ff;fi; done
load_policy.c
mount.c
# diff load_policy.c /usr/src/linux-2.6.38-gentoo-r6/security/tomoyo/load_policy.c
26c26
< * Thus, let do_execve() call this function every time.
---
Post by Tetsuo Handa
* Thus, let do_execve() call this function everytime.
# diff mount.c /usr/src/linux-2.6.38-gentoo-r6/security/tomoyo/mount.c
141c141
< if (!dev_name || kern_path(dev_name, LOOKUP_FOLLOW, &path)) {
---
Post by Tetsuo Handa
if (kern_path(dev_name, LOOKUP_FOLLOW, &path)) {
$BJQ992U=j$O$4;XE&$N$H$*$j$N$h$&$G$9!#(B

-- $BAa4V(B
Post by Tetsuo Handa
Post by Tetsuo Handa
2.6.38 $B$H(B 2.6.39 $B$H$N4V$K$O0J2<$N0c$$(B
$B!J(B http://tomoyo.sourceforge.jp/2.3/patches/2.6.36-tomoyo-fix-memory-leak-in-tomoyo_check_open_permission.patch $B!K$7$+$J$/!"(B
$B$4$a$s$J$5$$!#(B git reset $B$G<h$j=P$7$?%U%!%$%k$,8E$+$C$?$h$&$G$9!#(B
# diff -upr linux-2.6.38.8/ linux-2.6.39.4/
diff -upr linux-2.6.38.8/security/tomoyo/load_policy.c linux-2.6.39.4/security/tomoyo/load_policy.c
--- linux-2.6.38.8/security/tomoyo/load_policy.c 2011-03-15 10:20:32.000000000 +0900
+++ linux-2.6.39.4/security/tomoyo/load_policy.c 2011-05-19 13:06:34.000000000 +0900
@@ -23,7 +23,7 @@ static bool tomoyo_policy_loader_exists(
* If the initrd includes /sbin/init but real-root-dev has not
* mounted on / yet, activating MAC will block the system since
* policies are not loaded yet.
- * Thus, let do_execve() call this function everytime.
+ * Thus, let do_execve() call this function every time.
*/
struct path path;
diff -upr linux-2.6.38.8/security/tomoyo/mount.c linux-2.6.39.4/security/tomoyo/mount.c
--- linux-2.6.38.8/security/tomoyo/mount.c 2011-03-15 10:20:32.000000000 +0900
+++ linux-2.6.39.4/security/tomoyo/mount.c 2011-08-29 11:20:27.000000000 +0900
@@ -138,7 +138,7 @@ static int tomoyo_mount_acl(struct tomoy
}
if (need_dev) {
/* Get mount point or device file. */
- if (kern_path(dev_name, LOOKUP_FOLLOW, &path)) {
+ if (!dev_name || kern_path(dev_name, LOOKUP_FOLLOW, &path)) {
error = -ENOENT;
goto out;
}
_______________________________________________
tomoyo-users mailing list
http://lists.sourceforge.jp/mailman/listinfo/tomoyo-users
Tetsuo Handa
2011-08-29 04:14:03 UTC
Permalink
$BAa4V5AGn(B $B$5$s$O=q$-$^$7$?!'(B
Post by 早間義博
$BJQ992U=j$O$4;XE&$N$H$*$j$N$h$&$G$9!#(B
$B$D$^$j!"%Q%C%A$NE,MQ>u67$K:90[$O$J$$$H$$$&$3$H$G$9$M!#(B
$B!J$9$k$H!"$J$<(B linux-2.6.38-gentoo-r6 $B$G$***@5>o$KF0:n$7$F$$$?$N$+Ff$G$9$M!#!K(B

$B>I>u$O0JA0$4Js9p$$$?$@$$$?(B
$B!V(B [tomoyo-users 813] Re: $B%o%$%k%I%+!<%I%Q%9L>$N(B allow_execute $B!W$HF1$8$G$9$h$M!)(B
$B>I>u$,F1$8$J$i!"(B http://tomoyo.sourceforge.jp/2.3/patches/ $B$+$i(B
2.6.39-tomoyo $B$G;O$^$k%Q%C%A$r%@%&%s%m!<%I$7$F!"(B

for i in 2.6.*-tomoyo-*.patch; do patch -Nt -p1 --dry-run < $i && patch -p1 < $i; done

$B$GE,MQ$9$k$3$H$***@5>o$KF0:n$9$k$h$&$K$J$k$+$H;W$$$^$9!#(B
早間義博
2011-08-29 11:04:55 UTC
Permalink
$BAa4V$G$9!#(B
2.6.39-tomoyo-dont-add-trailing-slash-for-allow_unmount-check.patch
2.6.39-tomoyo-fix-domainname-validation-in-tomoyo_correct_domain.patch
2.6.39-tomoyo-fix-incorrect-enforce-mode.patch
2.6.39-tomoyo-fix-infinite-loop-bug-when-reading-sys-kernel-security-tomoyo-query.patch
2.6.39-tomoyo-fix-memory-leak-in-tomoyo_commit_ok.patch
2.6.39-tomoyo-fix-oops-in-tomoyo_mount_acl.patch
2.6.39-tomoyo-fix-race-on-updating-profile-comment.patch
2.6.39-tomoyo-fix-refcount-leak-in-tomoyo_mount_acl.patch

$B$NCf$G(B

2.6.39-tomoyo-fix-oops-in-tomoyo_mount_acl.patch

$B$@$1%Q%C%A:Q$_$G$7$?!#(B

$B%Q%C%A8e%3%s%Q%$%k$7$FLdBj$N2U=j$O2r7h$7$?$h$&$K;W$$$^$9!#(B
$B2aEY>uBV$NLdBj$+(B
allow_ create /var/spool/mail/_\*.hst 0444
$B$H;XDj$7$F$"$k$N$K$b$+$+$o$i$:!"5/F0;~$K(B
WARNING: Access create /var/spool/mail/_38E.ch2WOB.hst 0444 denied for /usr/bin/procmail
$B$N$h$&$J%(%i!<$,BgNL$K=P$^$7$?!#$=$N8e$O=P$F$$$^$;$s!#(B
Post by Tetsuo Handa
$B$D$^$j!"%Q%C%A$NE,MQ>u67$K:90[$O$J$$$H$$$&$3$H$G$9$M!#(B
$B!V(B [tomoyo-users 813] Re: $B%o%$%k%I%+!<%I%Q%9L>$N(B allow_execute $B!W$HF1$8$G$9$h$M!)(B
$B>I>u$,F1$8$J$i!"(B http://tomoyo.sourceforge.jp/2.3/patches/ $B$+$i(B
for i in 2.6.*-tomoyo-*.patch; do patch -Nt -p1 --dry-run < $i && patch -p1 < $i; done
-- $BAa4V(B

Loading...