]> git.karo-electronics.de Git - mv-sheeva.git/commit
s2io: rx_ring_sz bounds checking
authorJon Mason <jon.mason@exar.com>
Fri, 10 Dec 2010 15:40:01 +0000 (15:40 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 11 Dec 2010 19:46:36 +0000 (11:46 -0800)
commit1853e2e15dc95ff3430530941b5856581251ef70
tree0ae74601e624a49ebab41de725e2793fbfddb564
parent9835fd7321a67feba6432e63bf2cba43f5a56bd9
s2io: rx_ring_sz bounds checking

modparm rx_ring_sz can be set to be greater than the maximum allowable
number of blocks.  This results in an array overrun when probing the
driver, and causes memory corruption.

Also, the MAX_RX_DESC_1 multiply the max number of rings by max number
of blocker per ring by 127, but the driver does the same calculation
with 127+1.  This results in the possibility of the value being set
being larger than the maximum allowable value.

Finally, clean-up the s2io_ethtool_gringparam code to be more
intuitive.

Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/s2io.c
drivers/net/s2io.h