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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240828-f1dd7dd01c3f515d78bb9dfd-pchelkin@ispras.ru>
Date: Wed, 28 Aug 2024 12:19:03 +0300
From: Fedor Pchelkin <pchelkin@...ras.ru>
To: David Sterba <dsterba@...e.cz>
Cc: David Sterba <dsterba@...e.com>, Chris Mason <clm@...com>,
	Josef Bacik <josef@...icpanda.com>, Boris Burkov <boris@....io>,
	linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
	lvc-project@...uxtesting.org,
	syzbot+81670362c283f3dd889c@...kaller.appspotmail.com,
	stable@...r.kernel.org
Subject: Re: [PATCH] btrfs: qgroup: add missing extent changeset release

On Tue, 27. Aug 18:03, David Sterba wrote:
> On Tue, Aug 27, 2024 at 06:12:43PM +0300, Fedor Pchelkin wrote:
> > The extent changeset may have some additional memory dynamically allocated
> > for ulist in result of clear_record_extent_bits() execution.
> 
> This can happen, as clear_record_extent_bits adds more data to the
> changeset in some cases. What I don't see yet how it happens. An extent
> range must be split so that a new entry is added with different bits
> set. This is usual thing, but why does this happen with the quotas
> disabled.

In the reproducer case, qgroup_reserve_data() which sets the bits happens
just before disabling the quotas via ioctl.

Commit af0e2aab3b70 ("btrfs: qgroup: flush reservations during quota disable")
added a call to clear_record_extent_bits() inside __btrfs_qgroup_release_data().
The changeset being passed is freshly initialized and empty. So the first call
to clear_state_bit() there will definitely create a new entry and add it to
the ulist.

If for some reason clear_state_bit() shouldn't be eventually called then,
to be honest, I don't quite understand why a call to clear_record_extent_bits()
was added in the first place without expecting it to do the real work with
clear_state_bit().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ