From: Tetsuo Handa Date: Sun, 15 Jan 2012 02:05:59 +0000 (+0900) Subject: TOMOYO: Accept \000 as a valid character. X-Git-Tag: v3.3-rc1~22^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25add8cf99c9ec8b8dc0acd8b9241e963fc0d29c;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git TOMOYO: Accept \000 as a valid character. TOMOYO 2.5 in Linux 3.2 and later handles Unix domain socket's address. Thus, tomoyo_correct_word2() needs to accept \000 as a valid character, or TOMOYO 2.5 cannot handle Unix domain's abstract socket address. Reported-by: Steven Allen Signed-off-by: Tetsuo Handa CC: stable@vger.kernel.org [3.2+] Signed-off-by: James Morris --- diff --git a/security/tomoyo/util.c b/security/tomoyo/util.c index 4a9b4b2..867558c 100644 --- a/security/tomoyo/util.c +++ b/security/tomoyo/util.c @@ -492,13 +492,13 @@ static bool tomoyo_correct_word2(const char *string, size_t len) if (d < '0' || d > '7' || e < '0' || e > '7') break; c = tomoyo_make_byte(c, d, e); - if (tomoyo_invalid(c)) - continue; /* pattern is not \000 */ + if (c <= ' ' || c >= 127) + continue; } goto out; } else if (in_repetition && c == '/') { goto out; - } else if (tomoyo_invalid(c)) { + } else if (c <= ' ' || c >= 127) { goto out; } }