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: Hayama Yossihiro <[email protected]>
Signed-off-by: Tetsuo Handa <[email protected]>
Signed-off-by: James Morris <[email protected]>
This commit is contained in:
Tetsuo Handa 2011-05-12 06:40:51 +09:00 • committed by James Morris
commit e77dc3460f

View file

@ -390,7 +390,7 @@ bool tomoyo_correct_domain(const unsigned char *domainname)
if (!cp)
break;
if (*domainname != '/' ||
!tomoyo_correct_word2(domainname, cp - domainname - 1))
!tomoyo_correct_word2(domainname, cp - domainname))
goto out;
domainname = cp + 1;
}