From: Tetsuo Handa Date: Sat, 2 Apr 2011 15:09:26 +0000 (+0900) Subject: TOMOYO: Fix race on updating profile's comment line. X-Git-Tag: v3.0-rc1~309^2~1^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a086e5d3a23570735f75b784d29b93068070833;p=pandora-kernel.git TOMOYO: Fix race on updating profile's comment line. In tomoyo_write_profile() since 2.6.34, a lock was by error missing when replacing profile's comment line. If multiple threads attempted echo '0-COMMENT=comment' > /sys/kernel/security/tomoyo/profile in parallel, garbage collector will fail to kfree() the old value. Protect the replacement using a lock. Also, keep the old value rather than replace with empty string when out of memory error has occurred. Signed-off-by: Xiaochen Wang Signed-off-by: Tetsuo Handa Signed-off-by: James Morris --- Reading git-diff-tree failed