1

xfs: fix integer overflow in xrep_bmap

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.

Coverity-id: 1630958
Fixes: 8f71bede8e ("xfs: repair inode fork block mapping data structures")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Darrick J. Wong 2024-10-07 21:07:08 -07:00 committed by Carlos Maiolino
parent 77bfe1b11e
commit 0fb823f1cf

View File

@ -801,7 +801,7 @@ xrep_bmap(
{ {
struct xrep_bmap *rb; struct xrep_bmap *rb;
char *descr; char *descr;
unsigned int max_bmbt_recs; xfs_extnum_t max_bmbt_recs;
bool large_extcount; bool large_extcount;
int error = 0; int error = 0;