netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com,
	"Sebastian Pöhn" <sebastian.poehn@googlemail.com>
Subject: [PATCHv2 net-next 1/8] gianfar: Reject out-of-range RX NFC locations
Date: Tue, 3 Jan 2012 21:59:30 +0000	[thread overview]
Message-ID: <1325627970.2832.33.camel@bwh-desktop> (raw)
In-Reply-To: <1325627819.2832.31.camel@bwh-desktop>

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>
---
Sebastian, I took your private reply as an ack; please shout if that's
wrong.

Ben.

 drivers/net/ethernet/freescale/gianfar_ethtool.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 5890f4b..5a3b2e5 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -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;
 		}
-- 
1.7.4.4



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

  reply	other threads:[~2012-01-03 21:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-03 21:56 [PATCHv2 net-next 0/8] RX NFC support for hash-based filters Ben Hutchings
2012-01-03 21:59 ` Ben Hutchings [this message]
2012-01-03 22:04 ` [PATCHv2 net-next 2/8] ethtool: Allow drivers to select RX NFC rule locations Ben Hutchings
2012-01-03 22:05 ` [PATCHv2 net-next 3/8] sfc: Change filter ID generation to satisfy priority semantics of RX NFC Ben Hutchings
2012-01-03 22:05 ` [PATCHv2 net-next 4/8] sfc: Use consistent types for filter IDs, indices and search depths Ben Hutchings
2012-01-03 22:05 ` [PATCHv2 net-next 5/8] sfc: Add support for retrieving and removing filters by ID Ben Hutchings
2012-01-03 22:05 ` [PATCHv2 net-next 6/8] sfc: Implement ethtool RX NFC rules API instead of n-tuple API Ben Hutchings
2012-01-03 22:05 ` [PATCHv2 net-next 7/8] sfc: Remove now-unused filter function Ben Hutchings
2012-01-03 22:07 ` [PATCHv2 net-next 8/8] ethtool: Remove ethtool_ops::set_rx_ntuple operation Ben Hutchings
2012-01-03 22:24 ` [PATCHv2 ethtool 1/3] ethtool-copy.h: sync with net-next Ben Hutchings
2012-01-03 22:24 ` [PATCHv2 ethtool 2/3] rxclass: Use RX_CLS_LOC_{ANY,SPECIAL} in place of RX_CLS_LOC_UNSPEC Ben Hutchings
2012-01-03 22:25 ` [PATCHv2 ethtool 3/3] rxclass: Allow driver to select RX NFC rule location Ben Hutchings
2012-01-04 19:11 ` [PATCHv2 net-next 0/8] RX NFC support for hash-based filters David Miller
2012-01-04 21:39   ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1325627970.2832.33.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=sebastian.poehn@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).