]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
xfs: make sure the rt allocator doesn't run off the end
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 9 Sep 2020 21:21:06 +0000 (14:21 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:49:13 +0000 (14:49 +0100)
commit5ac275e90b1801eade00c764247823951273a2c5
tree5cb911b63ccb8acbfb1c6e11ec1d24000074e95f
parent45548f8dcdfc77b3974784a4448b34e4c2566d29
xfs: make sure the rt allocator doesn't run off the end

BugLink: https://bugs.launchpad.net/bugs/1902115
[ Upstream commit 2a6ca4baed620303d414934aa1b7b0a8e7bab05f ]

There's an overflow bug in the realtime allocator.  If the rt volume is
large enough to handle a single allocation request that is larger than
the maximum bmap extent length and the rt bitmap ends exactly on a
bitmap block boundary, it's possible that the near allocator will try to
check the freeness of a range that extends past the end of the bitmap.
This fails with a corruption error and shuts down the fs.

Therefore, constrain maxlen so that the range scan cannot run off the
end of the rt bitmap.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
fs/xfs/xfs_rtalloc.c