提交 3a73e49c 编写于 作者: B Ben Hutchings 提交者: David S. Miller

gianfar: Reject out-of-range RX NFC locations

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: NBen Hutchings <bhutchings@solarflare.com>
Acked-by: NSebastian Pöhn <sebastian.poehn@googlemail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6386994e
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册