Tetsuo Handa 2a086e5d3a 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 <wangxiaochen0@gmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
2011-04-19 09:37:06 +10:00
..
2011-03-03 10:13:26 +11:00
2010-08-02 15:34:54 +10:00
2009-02-12 15:19:00 +11:00
2011-01-07 17:50:21 +11:00
2010-08-02 15:34:33 +10:00
2010-08-02 15:35:09 +10:00