[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220421133041.GA18596@suse.cz>
Date: Thu, 21 Apr 2022 15:30:41 +0200
From: David Sterba <dsterba@...e.cz>
To: Nikolay Borisov <nborisov@...e.com>
Cc: Haowen Bai <baihaowen@...zu.com>, Chris Mason <clm@...com>,
Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>, linux-btrfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: Fix a memory leak in btrfs_ioctl_balance()
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.
Powered by blists - more mailing lists