]> git.itanic.dy.fi Git - linux-stable/commit
TOMOYO: Fix memory leak upon file open.
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Wed, 2 Mar 2011 07:54:24 +0000 (16:54 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Mar 2011 19:50:09 +0000 (12:50 -0700)
commitdb66d7a2baa3cecb38ea4383d803b51f2c448641
treeb6235102c4ac6a0a6b8f0442499e2946e6fc4808
parentc5c858261f3e55e16a7b9c1e54a275c0012519c3
TOMOYO: Fix memory leak upon file open.

commit eae61f3c829439f8f9121b5cd48a14be04df451f upstream.

In tomoyo_check_open_permission() since 2.6.36, TOMOYO was by error
recalculating already calculated pathname when checking allow_rewrite
permission. As a result, memory will leak whenever a file is opened for writing
without O_APPEND flag. Also, performance will degrade because TOMOYO is
calculating pathname regardless of profile configuration.
This patch fixes the leak and performance degrade.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
security/tomoyo/file.c