aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorJoseph Qi <joseph.qi@huawei.com>2013-09-11 17:19:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:56:49 -0400
commit6cae6d3189ef34647bca9b9b1d240ebd760e5dea (patch)
treed6ee5de8ce6ca54b689ac132b7ba1ac0605d712f /fs/ocfs2
parent69b2bd16d9792085d57865fcaac55753803a4f5d (diff)
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>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/xattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 18330f5b57be..6ce0686eab72 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -6802,7 +6802,7 @@ out:
6802 if (ret) { 6802 if (ret) {
6803 if (*meta_ac) { 6803 if (*meta_ac) {
6804 ocfs2_free_alloc_context(*meta_ac); 6804 ocfs2_free_alloc_context(*meta_ac);
6805 meta_ac = NULL; 6805 *meta_ac = NULL;
6806 } 6806 }
6807 } 6807 }
6808 6808