[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20110226004220.8793.65076.stgit@gitlad.jf.intel.com>
Date: Fri, 25 Feb 2011 16:42:20 -0800
From: Alexander Duyck <alexander.h.duyck@...el.com>
To: davem@...emloft.net, jeffrey.t.kirsher@...el.com,
bhutchings@...arflare.com
Cc: netdev@...r.kernel.org, stable@...nel.org
Subject: [net-2.6 PATCH] ethtool: prevent null pointer dereference with NTUPLE
set but no set_rx_ntuple
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.
This issue appears to affect all kernels since 2.6.34.
Signed-off-by: Alexander Duyck <alexander.h.duyck@...el.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 c1a71bb..4843674 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -893,6 +893,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;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists