WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] RE: [PATCH ixgbe] Don't depend of skb->data for VMDq

To: Steven Smith <steven.smith@xxxxxxxxxx>
Subject: [Xen-devel] RE: [PATCH ixgbe] Don't depend of skb->data for VMDq
From: "Williams, Mitch A" <mitch.a.williams@xxxxxxxxx>
Date: Wed, 18 Feb 2009 15:18:30 -0700
Accept-language: en-US
Acceptlanguage: en-US
Cc: Steven Smith <Steven.Smith@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "joserenato.santos@xxxxxx" <joserenato.santos@xxxxxx>
Delivery-date: Wed, 18 Feb 2009 14:18:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090218141038.GB4936@xxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <b04b26320902171624g76c7903av8214ec1a44a4f361@xxxxxxxxxxxxxx> <20090218141038.GB4936@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcmR0rorqqt8kbaTRRCEWWmMMMr/mAAQpTug
Thread-topic: [PATCH ixgbe] Don't depend of skb->data for VMDq
 

>> Occasionally, vmq_alloc_skb() will give us an skb with a nonzero but
>> bogus data pointer.  Dereferencing this pointer will then cause a
>> panic.
>That's disturbing.  The SKB needs to have a data area (because
>otherwise there's nowhere to put the skb_shinfo, and hence no frags
>list), so the data pointer really ought to be valid (i.e. NULL is also
>bad here).
>

OK, I need to eat some crow here.  The patch is correct, but my description is 
completely wrong, and is based on false assumptions.  I completely forgot that 
skb_shinfo hangs off the data area, and assumed that "no packet data in 
skb->data" was equivalent to "skb->data is NULL".  Completely, totally, wrong.

As you noted, skb->data has got to be valid for the skb to be useful at all.  
The use of "if (skb->data)" is completely incorrect in any context.  I should 
know this -- I've stared at skbuff.h long enough over the years.

In my defense, the patch went through two internal review cycles and nobody 
else noticed it either.  So I feel a little better.  It's a use case that just 
doesn't come up that often.

Please keep the patch, but ignore (or change) the description.  Sorry about the 
confusion.

-Mitch
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>