public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: Haowen Bai <baihaowen@meizu.com>, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: Fix a memory leak in btrfs_ioctl_balance()
Date: Thu, 21 Apr 2022 15:30:41 +0200	[thread overview]
Message-ID: <20220421133041.GA18596@suse.cz> (raw)
In-Reply-To: <d351b938-93c8-acc3-8c0f-eb471af8676d@suse.com>

On Thu, Apr 21, 2022 at 02:34:47PM +0300, Nikolay Borisov wrote:
> <snip>
> 
> > 
> > Actually to simplify further:
> > 
> > diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> > index 7a6974e877f4..bbda55d41a06 100644
> > --- a/fs/btrfs/ioctl.c
> > +++ b/fs/btrfs/ioctl.c
> > @@ -4353,6 +4353,7 @@ static long btrfs_ioctl_balance(struct file *file, 
> > void __user *arg)
> >          bargs = memdup_user(arg, sizeof(*bargs));
> >          if (IS_ERR(bargs)) {
> >                  ret = PTR_ERR(bargs);
> > +               bargs = NULL;
> >                  goto out;
> >          }
> 
> Unf, this also leads to the double free ...

Please send me an incremental diff that I can fold to the patch, thanks.

  reply	other threads:[~2022-04-21 13:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  9:51 [PATCH] btrfs: Fix a memory leak in btrfs_ioctl_balance() Haowen Bai
2022-04-21 10:01 ` Qu Wenruo
2022-04-21 10:47 ` Filipe Manana
2022-04-21 11:21 ` Nikolay Borisov
2022-04-21 11:25   ` Nikolay Borisov
2022-04-21 11:34     ` Nikolay Borisov
2022-04-21 13:30       ` David Sterba [this message]
2022-04-21 11:41     ` Qu Wenruo
2022-04-21 17:35 ` kernel test robot
2022-04-22 20:28 ` David Sterba

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=20220421133041.GA18596@suse.cz \
    --to=dsterba@suse.cz \
    --cc=baihaowen@meizu.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nborisov@suse.com \
    /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