Commit 5a35c454 authored by Tim Hockin's avatar Tim Hockin

Natsemi enet: catch wraparound in ETHTOOL_GEEPROM

parent af291057
......@@ -2037,6 +2037,9 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
if (copy_from_user(&eeprom, useraddr, sizeof(eeprom)))
return -EFAULT;
if (eeprom.offset > eeprom.offset+eeprom.len)
return -EINVAL;
if ((eeprom.offset+eeprom.len) > NATSEMI_EEPROM_SIZE) {
eeprom.len = NATSEMI_EEPROM_SIZE-eeprom.offset;
}
......
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