]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: fix integer overflows in the fsmap rtbitmap and logdev backends
authorDarrick J. Wong <djwong@kernel.org>
Wed, 11 Jun 2025 21:01:06 +0000 (14:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:18 +0000 (11:07 +0100)
commit15da730a85681f209d5b406b2adcb17360a0b65e
treed9702b92105c9bbee553762253f2ad2d085f82e1
parent3dbb2d0bd837515c3f9a98251892334919b8f2bb
xfs: fix integer overflows in the fsmap rtbitmap and logdev backends

[ Upstream commit 7975aba19cba4eba7ff60410f9294c90edc96dcf ]

It's not correct to use the rmap irec structure to hold query key
information to query the rtbitmap because the realtime volume can be
longer than 2^32 fsblocks in length.  Because the rt volume doesn't have
allocation groups, introduce a daddr-based record filtering algorithm
and compute the rtextent values using 64-bit variables.  The same
problem exists in the external log device fsmap implementation, so use
the same solution to fix it too.

After this patch, all the code that touches info->low and info->high
under xfs_getfsmap_logdev and __xfs_getfsmap_rtdev are unnecessary.
Cleaning this up will be done in subsequent patches.

Fixes: 4c934c7dd60c ("xfs: report realtime space information via the rtbitmap")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Acked-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/xfs_fsmap.c