From: Ben Hutchings <bhutchings@solarflare.com>
To: "David Miller" <davem@davemloft.net>,
"Sebastian Pöhn" <sebastian.belden@googlemail.com>
Cc: <netdev@vger.kernel.org>
Subject: [PATCH net] gianfar: Reject out-of-range RX NFC locations
Date: Sat, 17 Dec 2011 01:05:27 +0000 [thread overview]
Message-ID: <1324083927.2798.34.camel@bwh-desktop> (raw)
Currently the driver only uses location values to maintain an ordered
list of filters. There is nothing to stop the list becoming longer
than the filer hardware can support - the driver will report an error,
but will not roll back the change!
Make it reject location values >= MAX_FILER_IDX, consistent with the
range that gfar_get_cls_all() reports.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
[Re-sent to what I hope is a current address for Sebastian.]
This has not been tested in any way, as I don't have a suitable compiler
installed. Sebastian, please could you review this?
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.
next reply other threads:[~2011-12-17 1:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-17 1:05 Ben Hutchings [this message]
2011-12-17 8:39 ` [PATCH net] gianfar: Reject out-of-range RX NFC locations Sebastian Pöhn
2011-12-19 15:51 ` Ben Hutchings
-- strict thread matches above, loose matches on Subject: below --
2011-12-17 0:56 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=1324083927.2798.34.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sebastian.belden@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