Peter,

I've a bit modified my patch in order to prevent other call to ixgbe_atr() without checking,
please see attachment.

What do you mean by spin the patch? If you can submit it, it is ok for me.

Best Regards,

Waskiewicz Jr, Peter P wrote:
Guillaume,

Apologies for the crash, but thank you very much for debugging it and
proposing the patch.  This seems reasonable to me.  What protocol are you
running when you hit this (just my curiosity)?  Would you like me to submit
this patch on your behalf to the kernel, or can you spin the patch?  Also, I
will commit this to our local standalone driver which will show up on
SourceForge in the near future.

In the future, please also include [email protected] in your
CC line.  That way all our driver dev's can see this, in case others like me
are on vacation.  :-)

Cheers,

PJ Waskiewicz
[email protected]

-----Original Message-----
From: Guillaume Gaudonville [mailto:[email protected]] Sent: Wednesday, June 16, 2010 2:31 AM
To: Waskiewicz Jr, Peter P
Cc: Chilakala, Mallikarjuna; Kirsher, Jeffrey T; Jean-Mickael Guerin
Subject: IXGBE: crash in ixgbe_atr

Hello,

I'm working on the IXGBE driver and I encountered a oops in ixgbe_atr function. This function extracts ip header from the skb without checking that protocol is IPv4 (which seems coherant because it says it supports only IPv4).

The issue is that in ixgbe_xmit_frame(), the skb protocol field is not checked before calling ixgbe_atr(). What do you think about following patch (patch only add test on skb->protocol, remainder is indentation):

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 6c00ee4..22d8b37 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -5770,15 +5770,17 @@ static netdev_tx_t ixgbe_xmit_frame(struct sk_buff *skb, count = ixgbe_tx_map(adapter, tx_ring, skb, tx_flags, first);
        if (count) {
-               /* add the ATR filter if ATR is on */
-               if (tx_ring->atr_sample_rate) {
-                       ++tx_ring->atr_count;
- if ((tx_ring->atr_count >= tx_ring->atr_sample_rate) &&
-                            test_bit(__IXGBE_FDIR_INIT_DONE,
-                                      &tx_ring->reinit_state)) {
- ixgbe_atr(adapter, skb, tx_ring->queue_index,
-                                         tx_flags);
-                               tx_ring->atr_count = 0;
+               if (skb->protocol == htons(ETH_P_IP)) {
+                       /* add the ATR filter if ATR is on */
+                       if (tx_ring->atr_sample_rate) {
+                               ++tx_ring->atr_count;
+ if ((tx_ring->atr_count >= tx_ring->atr_sample_rate) &&
+                                   test_bit(__IXGBE_FDIR_INIT_DONE,
+                                            &tx_ring->reinit_state)) {
+ ixgbe_atr(adapter, skb, tx_ring->queue_index,
+                                                 tx_flags);
+                                       tx_ring->atr_count = 0;
+                               }
                        }
                }
                txq = netdev_get_tx_queue(netdev, tx_ring->queue_index);



--
Guillaume Gaudonville
6WIND
Software Engineer

Tel: +33 1 39 30 92 63
Mob: +33 6 47 85 34 33
Fax: +33 1 39 30 92 11
[email protected]
www.6wind.com
Join the Multicore Packet Processing Forum: www.multicorepacketprocessing.com

Ce courriel ainsi que toutes les pièces jointes, est uniquement destiné à son 
ou ses destinataires. Il contient des informations confidentielles qui sont la 
propriété de 6WIND. Toute révélation, distribution ou copie des informations 
qu'il contient est strictement interdite. Si vous avez reçu ce message par 
erreur, veuillez immédiatement le signaler à l'émetteur et détruire toutes les 
données reçues

This e-mail message, including any attachments, is for the sole use of the 
intended recipient(s) and contains information that is confidential and 
proprietary to 6WIND. All unauthorized review, use, disclosure or distribution 
is prohibited. If you are not the intended recipient, please contact the sender 
by reply e-mail and destroy all copies of the original message.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to