Skip to content

Commit

Permalink
gianfar: Reject out-of-range RX NFC locations
Browse files Browse the repository at this point in the history
Currently the driver only uses location values to maintain an ordered
list of filters.  Make it reject location values >= MAX_FILER_IDX
passed to the ETHTOOL_SRXCLSRLINS command, consistent with the range
it reports for the ETHTOOL_GRXCLSRLALL command.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Sebastian Pöhn <sebastian.poehn@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Jan 4, 2012
1 parent 6386994 commit 3a73e49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/ethernet/freescale/gianfar_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1692,8 +1692,9 @@ static int gfar_set_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
ret = gfar_set_hash_opts(priv, cmd);
break;
case ETHTOOL_SRXCLSRLINS:
if (cmd->fs.ring_cookie != RX_CLS_FLOW_DISC &&
cmd->fs.ring_cookie >= priv->num_rx_queues) {
if ((cmd->fs.ring_cookie != RX_CLS_FLOW_DISC &&
cmd->fs.ring_cookie >= priv->num_rx_queues) ||
cmd->fs.location >= MAX_FILER_IDX) {
ret = -EINVAL;
break;
}
Expand Down

0 comments on commit 3a73e49

Please sign in to comment.