Skip to contentSkip to conversation

ocfs2-fix-possible-double-free-in-ocfs2_reflink_xattr_rec.patch removed from -mm tree

merged [email protected] 1 participant 1 message Sep 12, 2013 OCFS2

lore
Share & tools
lore
#0 lore raw

Subject: [merged] ocfs2-fix-possible-double-free-in-ocfs2_reflink_xattr_rec.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 12 Sep 2013 12:41:43 -0700

The patch titled
Subject: ocfs2: fix possible double free in ocfs2_reflink_xattr_rec
has been removed from the -mm tree. Its filename was
ocfs2-fix-possible-double-free-in-ocfs2_reflink_xattr_rec.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Joseph Qi <[email protected]>
Subject: 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.

---

 fs/ocfs2/xattr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/xattr.c renamed from fs/ocfs2/xattr.c~ocfs2-fix-possible-double-free-in-ocfs2_reflink_xattr_rec +1 -1
diff -puN fs/ocfs2/xattr.c~ocfs2-fix-possible-double-free-in-ocfs2_reflink_xattr_rec fs/ocfs2/xattr.c
@@ -6802,7 +6802,7 @@ out:
 	if (ret) {
 		if (*meta_ac) {
 			ocfs2_free_alloc_context(*meta_ac);
-			meta_ac = NULL;
+			*meta_ac = NULL;
 		}
 	}
 

_

Patches currently in -mm which might be from [email protected] are

origin.patch