]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: assert a valid limit in xfs_rtfind_forw
authorChristoph Hellwig <hch@lst.de>
Mon, 21 Oct 2024 00:10:42 +0000 (17:10 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 31 Oct 2024 22:45:02 +0000 (15:45 -0700)
Source kernel commit: 6d2db12d56a389b3e8efa236976f8dc3a8ae00f0

Protect against developers passing stupid limits when refactoring the
RT code once again.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/xfs_rtbitmap.c

index c7613f2de7b0a07245a1a35c1016a412b112f3f0..f578b0d34b36d3425b56c42b2c476431f91c6a8b 100644 (file)
@@ -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.
         */