]> git.baikalelectronics.ru Git - kernel.git/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)
committerJames Morris <jmorris@namei.org>
Wed, 2 Mar 2011 23:13:26 +0000 (10:13 +1100)
commit9edbb56eb4131bcf23dc3b60ea510a6b21ad00f4
tree607f79bb57996e059c1da17a0411d5763c4748ca
parente5de4e46f7de531273c1e566e65ec326fe9229c3
TOMOYO: Fix memory leak upon file open.

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>
security/tomoyo/file.c