]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: fix possible double free in ocfs2_reflink_xattr_rec
authorJoseph Qi <joseph.qi@huawei.com>
Wed, 11 Sep 2013 21:19:58 +0000 (14:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Sep 2013 22:56:49 +0000 (15:56 -0700)
commita20ea3bb29f4ceed5f25c25a9ed4267900a4f6ae
treed6ee5de8ce6ca54b689ac132b7ba1ac0605d712f
parent95d185397b4d61bad2084b27d30259662fe923ec
ocfs2: fix possible double free in ocfs2_reflink_xattr_rec

In ocfs2_reflink_xattr_rec(), meta_ac and data_ac are allocated by calling
ocfs2_lock_reflink_xattr_rec_allocators().

Once an error occurs when allocating *data_ac, it frees *meta_ac which is
allocated before.  Here it mistakenly sets meta_ac to NULL but *meta_ac.
Then ocfs2_reflink_xattr_rec() will try to free meta_ac again which is
already invalid.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/xattr.c