Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] Btrfs: fix use-after-free when cloning a trailing file hole
@ 2014-06-29 19:43 Filipe David Borba Manana
  2014-06-29 19:23 ` Chris Mason
  2014-06-29 20:45 ` [PATCH v2] " Filipe David Borba Manana
  0 siblings, 2 replies; 4+ messages in thread
From: Filipe David Borba Manana @ 2014-06-29 19:43 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Filipe David Borba Manana, Chris Mason

The transaction handle was being used after being freed.

Cc: Chris Mason <clm@fb.com>
Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
---
 fs/btrfs/ioctl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 02dc64b..2562dc7 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3565,12 +3565,10 @@ process_slot:
 			btrfs_end_transaction(trans, root);
 			goto out;
 		}
-		ret = clone_finish_inode_update(trans, inode, destoff + len,
-						destoff, olen);
-		if (ret)
-			goto out;
 		clone_update_extent_map(inode, trans, path, NULL, last_dest_end,
 					destoff + len - last_dest_end);
+		ret = clone_finish_inode_update(trans, inode, destoff + len,
+						destoff, olen);
 	}
 
 out:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-29 19:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-29 19:43 [PATCH] Btrfs: fix use-after-free when cloning a trailing file hole Filipe David Borba Manana
2014-06-29 19:23 ` Chris Mason
2014-06-29 19:28   ` Filipe David Manana
2014-06-29 20:45 ` [PATCH v2] " Filipe David Borba Manana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox