lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 21 Apr 2020 00:32:29 +0200
From:   David Sterba <dsterba@...e.cz>
To:     Filipe Manana <fdmanana@...il.com>
Cc:     Xiyu Yang <xiyuyang19@...an.edu.cn>, Chris Mason <clm@...com>,
        Josef Bacik <josef@...icpanda.com>,
        David Sterba <dsterba@...e.com>, Jeff Mahoney <jeffm@...e.com>,
        linux-btrfs <linux-btrfs@...r.kernel.org>,
        linux-kernel@...r.kernel.org, yuanxzhang@...an.edu.cn,
        kjlu@....edu, Xin Tan <tanxin.ctf@...il.com>
Subject: Re: [PATCH] btrfs: Fix refcnt leak in btrfs_recover_relocation

On Mon, Apr 20, 2020 at 06:35:56PM +0100, Filipe Manana wrote:
> On Mon, Apr 20, 2020 at 6:34 PM Filipe Manana <fdmanana@...il.com> wrote:
> >
> > On Mon, Apr 20, 2020 at 6:50 AM Xiyu Yang <xiyuyang19@...an.edu.cn> wrote:
> > >
> > > btrfs_recover_relocation() invokes btrfs_join_transaction(), which joins
> > > a btrfs_trans_handle object into transactions and returns a reference of
> > > it with increased refcount to "trans".
> > >
> > > When btrfs_recover_relocation() returns, "trans" becomes invalid, so the
> > > refcount should be decreased to keep refcount balanced.
> > >
> > > The reference counting issue happens in one exception handling path of
> > > btrfs_recover_relocation(). When read_fs_root() failed, the refcnt
> > > increased by btrfs_join_transaction() is not decreased, causing a refcnt
> > > leak.
> > >
> > > Fix this issue by calling btrfs_end_transaction() on this error path
> > > when read_fs_root() failed.
> > >
> > > Fixes: 79787eaab461 ("btrfs: replace many BUG_ONs with proper error
> > > handling")
> > > Signed-off-by: Xiyu Yang <xiyuyang19@...an.edu.cn>
> > > Signed-off-by: Xin Tan <tanxin.ctf@...il.com>
> >
> > Reviewed-by: Filipe Manana <fdmanana@...e.com>
> >
> > Looks good, thanks.
> 
> Btw, the subject could be more clear.
> Instead of
> 
> "btrfs: Fix refcnt leak in btrfs_recover_relocation"
> 
> something like
> 
> "btrfs: fix transaction leak in ..."
> 
> David can probably fixup that when he picks the patch.

Yes, thanks, simple fixups are fine.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ