Message ID | 20241008040708.GQ21853@frogsfrogsfrogs (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Series | xfs: fix integer overflow in xrep_bmap | expand |
On Mon, Oct 07, 2024 at 09:07:08PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <djwong@kernel.org> > > The variable declaration in this function predates the merge of the > nrext64 (aka 64-bit extent counters) feature, which means that the > variable declaration type is insufficient to avoid an integer overflow. > Fix that by redeclaring the variable to be xfs_extnum_t. Looks good: Reviewed-by: Christoph Hellwig <hch@lst.de>
On Mon, 07 Oct 2024 21:07:08 -0700, Darrick J. Wong wrote: > The variable declaration in this function predates the merge of the > nrext64 (aka 64-bit extent counters) feature, which means that the > variable declaration type is insufficient to avoid an integer overflow. > Fix that by redeclaring the variable to be xfs_extnum_t. > > Applied to for-next, thanks! [1/1] xfs: fix integer overflow in xrep_bmap commit: 0fb823f1cf3417e06846d1ffe2c97e10a65a847e Best regards,
diff --git a/fs/xfs/scrub/bmap_repair.c b/fs/xfs/scrub/bmap_repair.c index 49dc38acc66bf..4505f4829d53f 100644 --- a/fs/xfs/scrub/bmap_repair.c +++ b/fs/xfs/scrub/bmap_repair.c @@ -801,7 +801,7 @@ xrep_bmap( { struct xrep_bmap *rb; char *descr; - unsigned int max_bmbt_recs; + xfs_extnum_t max_bmbt_recs; bool large_extcount; int error = 0;