kernel 2.6.35: ixgbe: skip non IPv4 packets in ATR filter
Subsystems (2)
PATCH 1/1 kernel 2.6.35: ixgbe: skip non IPv4 packets in ATR filter
Hello,
In driver ixgbe, ixgbe_atr may cause crashes for non-ipv4 packets. Just add a test to check skb->protocol:
From fcb81aa89b6819f95349a4ed8c30f0629430aa1d Mon Sep 17 00:00:00 2001
From: Guillaume Gaudonville <[email protected]>
Date: Thu, 17 Jun 2010 16:02:14 +0200
Subject: [PATCH] ixgbe: skip non IPv4 packets in ATR filter
It may crash on short packets due to ip_hdr() access.
---drivers/net/ixgbe/ixgbe_main.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +0 -0
@@ -6019,7 +6019,6 @@ static void ixgbe_tx_queue(struct ixgbe_adapter *adapter,
static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb,
int queue, u32 tx_flags)
{
- /* Right now, we support IPv4 only */
struct ixgbe_atr_input atr_input;
struct tcphdr *th;
struct iphdr *iph = ip_hdr(skb);
@@ -6028,6 +6027,10 @@ static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb,
u32 src_ipv4_addr, dst_ipv4_addr;
u8 l4type = 0;+ /* Right now, we support IPv4 only */
+ if (skb->protocol != htons(ETH_P_IP))
+ return;
+
/* check if we're UDP or TCP */
if (iph->protocol == IPPROTO_TCP) {
th = tcp_hdr(skb);Signature · 5 lines
1.5.6.5 -- Guillaume Gaudonville [email protected]
Quoted 55 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Gaudonville
Sent: Monday, June 21, 2010 6:05 AM
To: [email protected]
Cc: Kirsher, Jeffrey T; Waskiewicz Jr, Peter P; Chilakala, Mallikarjuna
Subject: [PATCH] kernel 2.6.35: ixgbe: skip non IPv4 packets in ATR filterHello,
In driver ixgbe,
ixgbe_atrmay cause crashes for non-ipv4 packets. Just add a test to checkskb->protocol:From
fcb81aa89b6819f95349a4ed8c30f0629430aa1dMon Sep 17 00:00:00 2001
From: Guillaume Gaudonville <[email protected]>
Date: Thu, 17 Jun 2010 16:02:14 +0200
Subject: [PATCH] ixgbe: skip non IPv4 packets in ATR filterIt may crash on short packets due to
ip_hdr()access.Signed-off-by Guillaume Gaudonville <[email protected]>---
drivers/net/ixgbe/ixgbe_main.c| 5 ++++-1 files changed, 4 insertions(+), 1 deletions(-)drivers/net/ixgbe/ixgbe_main.c +0
-1@@ -6019,7 +6019,6 @@ static void ixgbe_tx_queue(struct ixgbe_adapter *adapter, static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb,int queue,u32 tx_flags) { -/* Right now, we support IPv4 only */ struct ixgbe_atr_input atr_input;struct tcphdr *th;struct iphdr *iph = ip_hdr(skb);drivers/net/ixgbe/ixgbe_main.c +4
-0@@ -6028,6 +6027,10 @@ static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, u32 src_ipv4_addr, dst_ipv4_addr;u8 l4type =0 ; +/* Right now, we support IPv4 only */ +if (skb->protocol !=htons (ETH_P_IP )) +return ; +/* check if we're UDP or TCP */ if (iph->protocol ==IPPROTO_TCP ) {th = tcp_hdr(skb);--
1.5.6.5
Quoted 8 lines
--
Guillaume Gaudonville
[email protected]--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
This patch has been pulled into our internal tree for testing.
Thanks,
-Don
<[email protected]>