Re: [stable] [PATCH] sky2: bad memory reference on dual port cards

2006-04-06 Thread Greg KH
On Wed, Apr 05, 2006 at 05:47:15PM -0700, Stephen Hemminger wrote:
 Sky2 driver will oops referencing bad memory if used on
 a dual port card.  The problem is accessing past end of
 MIB counter space.
 
 Applies for both 2.6.17 and 2.6.16 (with fuzz)
 
 Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]

Queued to -stable, with a bit of a rewrite for the .h file.

thanks,

greg k-h
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] sky2: bad memory reference on dual port cards

2006-04-05 Thread Stephen Hemminger
Sky2 driver will oops referencing bad memory if used on
a dual port card.  The problem is accessing past end of
MIB counter space.

Applies for both 2.6.17 and 2.6.16 (with fuzz)

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]


--- test-2.6.orig/drivers/net/sky2.c
+++ test-2.6/drivers/net/sky2.c
@@ -579,8 +579,8 @@ static void sky2_mac_init(struct sky2_hw
reg = gma_read16(hw, port, GM_PHY_ADDR);
gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR);
 
-   for (i = 0; i  GM_MIB_CNT_SIZE; i++)
-   gma_read16(hw, port, GM_MIB_CNT_BASE + 8 * i);
+   for (i = GM_MIB_CNT_BASE; i = GM_MIB_CNT_END; i += 4)
+   gma_read16(hw, port, i);
gma_write16(hw, port, GM_PHY_ADDR, reg);
 
/* transmit control */
--- test-2.6.orig/drivers/net/sky2.h
+++ test-2.6/drivers/net/sky2.h
@@ -1375,7 +1375,7 @@ enum {
GM_PHY_ADDR = 0x0088,   /* 16 bit r/w   GPHY Address Register */
 /* MIB Counters */
GM_MIB_CNT_BASE = 0x0100,   /* Base Address of MIB Counters */
-   GM_MIB_CNT_SIZE = 256,
+   GM_MIB_CNT_END  = 0x025C,   /* Last MIB counter */
 };
 
 
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html