• Jon Mason's avatar
    s2io: rx_ring_sz bounds checking · 1853e2e1
    Jon Mason authored
    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: default avatarJon Mason <jon.mason@exar.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1853e2e1
s2io.c 244 KB