Commit ba9aa134 authored by david decotigny's avatar david decotigny Committed by David S. Miller

forcedeth: fix buffer overflow

Found by manual code inspection.

Tested: compile, reboot, ethtool -d ethX
Signed-off-by: default avatarDavid Decotigny <decot@googlers.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6cc2ff82
...@@ -4435,7 +4435,7 @@ static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void ...@@ -4435,7 +4435,7 @@ static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void
regs->version = FORCEDETH_REGS_VER; regs->version = FORCEDETH_REGS_VER;
spin_lock_irq(&np->lock); spin_lock_irq(&np->lock);
for (i = 0; i <= np->register_size/sizeof(u32); i++) for (i = 0; i < np->register_size/sizeof(u32); i++)
rbuf[i] = readl(base + i*sizeof(u32)); rbuf[i] = readl(base + i*sizeof(u32));
spin_unlock_irq(&np->lock); spin_unlock_irq(&np->lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment