xfs
[Top] [All Lists]

[PATCH] xfs_metadump: agcount*agblocks overflow

To: xfs mailing list <xfs@xxxxxxxxxxx>
Subject: [PATCH] xfs_metadump: agcount*agblocks overflow
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Thu, 02 Jul 2009 12:03:23 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090320)
Found another potential overflow in xfs_metadump,
similar to those just fixed in repair.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
--

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;

<Prev in Thread] Current Thread [Next in Thread>