[tomoyo-users 813] Re: ワイルドカードパス名の allow_execute

Back to archive index

Tetsuo Handa from-****@I-lov*****
2011年 5月 11日 (水) 11:24:32 JST


早間義博 さんは書きました:
> http://tomoyo.sourceforge.jp/2.3/policy-reference.html.ja 
> に「allow_execute のパス名にワイルドカードを使用することは認められ
> ていません」とありますが
すみません。内容が古いです。 TOMOYO 2.3 ではワイルドカードを使用できます。

> 追加です、domain
> 
> <kernel> /usr/local/bin/...  /home/local/application/\*
> 
> には下位ドメインの追加(自動・tomoyo-editpolicy とも)は出来ません。

ご指摘ありがとうございます。これは TOMOYO 1.8 で生じて TOMOYO 2.3 へと継承されたバグですね。
以下のパッチで修正できます。MLに投げますのでお名前の英語表記とメールアドレスをお知らせください。

(1) カーネルのソースコード側に適用するパッチ:

[PATCH] TOMOYO: Fix wrong domainname validation.

In tomoyo_correct_domain() since 2.6.36, TOMOYO was by error validating
"<kernel>" + "/foo/\" + "/bar" when "<kernel> /foo/\* /bar" was given.
As a result, legal domainnames like "<kernel> /foo/\* /bar" are rejected.

Reported-by: 
Signed-off-by: Tetsuo Handa <pengu****@I-lov*****>
---
 security/tomoyo/util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.39-rc7.orig/security/tomoyo/util.c
+++ linux-2.6.39-rc7/security/tomoyo/util.c
@@ -390,7 +390,7 @@ bool tomoyo_correct_domain(const unsigne
 		if (!cp)
 			break;
 		if (*domainname != '/' ||
-		    !tomoyo_correct_word2(domainname, cp - domainname - 1))
+		    !tomoyo_correct_word2(domainname, cp - domainname))
 			goto out;
 		domainname = cp + 1;
 	}

(2) tomoyo-tools-2.3 側に適用するパッチ:

Index: usr_sbin/tomoyotools.c
===================================================================
--- usr_sbin/tomoyotools.c	(revision 4975)
+++ usr_sbin/tomoyotools.c	(working copy)
@@ -373,7 +373,7 @@
 		if (!cp)
 			break;
 		if (*domainname != '/' ||
-		    !tomoyo_correct_word2(domainname, cp - domainname - 1))
+		    !tomoyo_correct_word2(domainname, cp - domainname))
 			goto out;
 		domainname = cp + 1;
 	}




tomoyo-users メーリングリストの案内
Back to archive index