[PATCH] xfs_metadump: agcount*agblocks overflow

Eric Sandeen sandeen at sandeen.net
Thu Jul 2 12:03:23 CDT 2009


Found another potential overflow in xfs_metadump,
similar to those just fixed in repair.

Signed-off-by: Eric Sandeen <sandeen at redhat.com>
--

diff --git a/db/metadump.c b/db/metadump.c
index 19aed4f..ef6e571 100644
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -222,7 +222,8 @@ valid_bno(
 		return 1;
 	if (agno == (mp->m_sb.sb_agcount - 1) && agbno > 0 &&
 			agbno <= (mp->m_sb.sb_dblocks -
-			 (mp->m_sb.sb_agcount - 1) * mp->m_sb.sb_agblocks))
+			 (xfs_drfsbno_t)(mp->m_sb.sb_agcount - 1) *
+			 mp->m_sb.sb_agblocks))
 		return 1;
 
 	return 0;




More information about the xfs mailing list