From: Alexander Duyck <alexander.h.duyck@intel.com>
To: davem@davemloft.net, jeffrey.t.kirsher@intel.com,
bhutchings@solarflare.com
Cc: netdev@vger.kernel.org
Subject: [net-next-2.6 PATCH 1/2] ethtool: prevent null pointer dereference with NTUPLE set but no set_rx_ntuple
Date: Fri, 08 Apr 2011 15:07:22 -0700 [thread overview]
Message-ID: <20110408220722.25468.98089.stgit@gitlad.jf.intel.com> (raw)
In-Reply-To: <20110408220410.25468.49130.stgit@gitlad.jf.intel.com>
This change is meant to prevent a possible null pointer dereference if
NETIF_F_NTUPLE is defined but the set_rx_ntuple function pointer is not.
The main motivation behind this patch is to eventually replace the ntuple
interfaces entirely with the network flow classifier interfaces. This
allows the device drivers to maintain the ntuple check internally while
using the network flow classifier interface for setting up and displaying
rules.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
net/core/ethtool.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 1b7fa98..704e176 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -910,6 +910,9 @@ static noinline_for_stack int ethtool_set_rx_ntuple(struct net_device *dev,
struct ethtool_rx_ntuple_flow_spec_container *fsc = NULL;
int ret;
+ if (!ops->set_rx_ntuple)
+ return -EOPNOTSUPP;
+
if (!(dev->features & NETIF_F_NTUPLE))
return -EINVAL;
next prev parent reply other threads:[~2011-04-08 22:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-08 22:07 [net-next-2.6 PATCH 0/2] Start of work to cleanup ntuple filters Alexander Duyck
2011-04-08 22:07 ` Alexander Duyck [this message]
2011-04-11 20:21 ` [net-next-2.6 PATCH 1/2] ethtool: prevent null pointer dereference with NTUPLE set but no set_rx_ntuple David Miller
2011-04-08 22:07 ` [net-next-2.6 PATCH 2/2] ethtool: add ntuple flow specifier data to network flow classifier Alexander Duyck
2011-04-08 22:21 ` Ben Hutchings
2011-04-08 22:35 ` Alexander Duyck
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=20110408220722.25468.98089.stgit@gitlad.jf.intel.com \
--to=alexander.h.duyck@intel.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=jeffrey.t.kirsher@intel.com \
--cc=netdev@vger.kernel.org \
/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).