From: Alexander Duyck <alexander.h.duyck@intel.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [net-next-2.6 PATCH 01/10] ethtool: prevent null pointer dereference with NTUPLE set but no set_rx_ntuple
Date: Fri, 25 Feb 2011 16:40:13 -0800 [thread overview]
Message-ID: <4D684BED.20805@intel.com> (raw)
In-Reply-To: <1298679675.3555.4.camel@localhost>
On 2/25/2011 4:21 PM, Ben Hutchings wrote:
> On Fri, 2011-02-25 at 15:32 -0800, Alexander Duyck wrote:
>> 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.
>
> I think it would be a bug for NETIF_F_NTUPLE to be enabled on a device
> that doesn't have this operation. Are there any drivers for which this
> is possible?
Currently there are no drivers where this is possible. However I
encountered it as a result of testing the patches further on in this set.
>> This issue appears to affect all kernels since 2.6.34.
>
> If this can actually happen, the fix should go to net-2.6 and
> stable@kernel.org. However, I think that the null deference is
> impossible and this really just fixes the error code.
>
> Ben.
It cannot occur with any of the in-kernel drivers since they all set the
NETIF_F_NTUPLE flag and have the function defined. However going
forward I would like to have the option of using the network flow
classifier interface instead of the set_rx_ntuple interface due to the
fact that it supports many of the features I needed.
I believe this patch should apply to net-2.6 without any changes so if
it is better placed there I will resubmit it specifically for net-2.6
and stable.
Thanks,
Alex
>> 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 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;
>>
>>
>
next prev parent reply other threads:[~2011-02-26 0:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-25 23:32 [net-next-2.6 PATCH 00/10] Workarounds and fixes for ntuple filters Alexander Duyck
2011-02-25 23:32 ` [net-next-2.6 PATCH 01/10] ethtool: prevent null pointer dereference with NTUPLE set but no set_rx_ntuple Alexander Duyck
2011-02-26 0:21 ` Ben Hutchings
2011-02-26 0:40 ` Alexander Duyck [this message]
2011-02-27 0:07 ` David Miller
2011-02-27 2:16 ` Alexander Duyck
2011-02-25 23:32 ` [net-next-2.6 PATCH 02/10] ethtool: add ntuple flow specifier to network flow classifier Alexander Duyck
2011-02-26 1:00 ` Ben Hutchings
2011-02-26 5:30 ` Alexander Duyck
2011-03-02 18:50 ` Ben Hutchings
2011-03-02 19:11 ` Dimitrios Michailidis
2011-03-02 19:27 ` Ben Hutchings
2011-03-02 20:03 ` Dimitrios Michailidis
2011-03-04 19:30 ` Alexander Duyck
2011-03-04 21:00 ` Alexander Duyck
2011-02-27 0:05 ` David Miller
2011-02-25 23:32 ` [net-next-2.6 PATCH 03/10] [RFC] ixgbe: remove ntuple filtering Alexander Duyck
2011-02-25 23:33 ` [net-next-2.6 PATCH 04/10] [RFC] ethtool: remove support for ETHTOOL_GRXNTUPLE Alexander Duyck
2011-02-25 23:33 ` [net-next-2.6 PATCH 05/10] [RFC] ixgbe: add support for different Rx packet buffer sizes Alexander Duyck
2011-02-25 23:33 ` [net-next-2.6 PATCH 06/10] [RFC] ixgbe: update perfect filter framework to support retaining filters Alexander Duyck
2011-02-25 23:33 ` [net-next-2.6 PATCH 07/10] [RFC] ixgbe: add basic support for settting and getting nfc controls Alexander Duyck
2011-02-25 23:33 ` [net-next-2.6 PATCH 08/10] [RFC] ixgbe: add support for displaying ntuple filters via the nfc interface Alexander Duyck
2011-02-25 23:33 ` [net-next-2.6 PATCH 09/10] [RFC] ixgbe: add support for nfc addition and removal of filters Alexander Duyck
2011-02-25 23:33 ` [net-next-2.6 PATCH 10/10] [RFC] ixgbe: Add support for using the same fields as ntuple in nfc 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=4D684BED.20805@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).