Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Filipe David Borba Manana <fdmanana@gmail.com>,
	<linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: fix use-after-free when cloning a trailing file hole
Date: Sun, 29 Jun 2014 15:23:57 -0400	[thread overview]
Message-ID: <53B067CD.4050903@fb.com> (raw)
In-Reply-To: <1404071004-20724-1-git-send-email-fdmanana@gmail.com>

On 06/29/2014 03:43 PM, Filipe David Borba Manana wrote:
> 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:
> 

What about the path?  It has been released, so it should either be NULL
or we have other problems ;)

-chris

  reply	other threads:[~2014-06-29 19:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-06-29 19:28   ` Filipe David Manana
2014-06-29 20:45 ` [PATCH v2] " Filipe David Borba Manana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53B067CD.4050903@fb.com \
    --to=clm@fb.com \
    --cc=fdmanana@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox