Skip to content

Commit 0fb823f

Browse files
Darrick J. Wongcmaiolino
authored andcommitted
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: 8f71bed ("xfs: repair inode fork block mapping data structures") Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent 77bfe1b commit 0fb823f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/scrub/bmap_repair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ xrep_bmap(
801801
{
802802
struct xrep_bmap *rb;
803803
char *descr;
804-
unsigned int max_bmbt_recs;
804+
xfs_extnum_t max_bmbt_recs;
805805
bool large_extcount;
806806
int error = 0;
807807

0 commit comments

Comments
 (0)