From: Christoph Hellwig Date: Mon, 21 Oct 2024 00:10:42 +0000 (-0700) Subject: xfs: assert a valid limit in xfs_rtfind_forw X-Git-Tag: v6.12.0~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=39c5ade944006ed5cb8e657fa4be975ac58a888b;p=thirdparty%2Fxfsprogs-dev.git xfs: assert a valid limit in xfs_rtfind_forw Source kernel commit: 6d2db12d56a389b3e8efa236976f8dc3a8ae00f0 Protect against developers passing stupid limits when refactoring the RT code once again. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c index c7613f2d..f578b0d3 100644 --- a/libxfs/xfs_rtbitmap.c +++ b/libxfs/xfs_rtbitmap.c @@ -313,6 +313,8 @@ xfs_rtfind_forw( xfs_rtword_t incore; unsigned int word; /* word number in the buffer */ + ASSERT(start <= limit); + /* * Compute and read in starting bitmap block for starting block. */