From: Christoph Hellwig Date: Fri, 30 Aug 2024 22:36:54 +0000 (-0700) Subject: xfs: assert a valid limit in xfs_rtfind_forw X-Git-Tag: v6.12-rc1~138^2~24^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d2db12d56a389b3e8efa236976f8dc3a8ae00f0;p=thirdparty%2Fkernel%2Flinux.git xfs: assert a valid limit in xfs_rtfind_forw 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/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c index 9feeefe539488..4de97c4e8ebdd 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.c +++ b/fs/xfs/libxfs/xfs_rtbitmap.c @@ -315,6 +315,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. */