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/
Home Products Support Community News


[Xen-changelog] [linux-2.6.18-xen] [NET] netloop: Do not clobber cloned

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] [NET] netloop: Do not clobber cloned skb page frags
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 01 Aug 2007 09:54:41 -0700
Delivery-date: Wed, 01 Aug 2007 09:52:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1185977806 -3600
# Node ID 8d5ae51a09a66ff450b46ebb09ff99475604ed91
# Parent  1372bc676080a527c98cd4de82637edd319794e7
[NET] netloop: Do not clobber cloned skb page frags

The netloop driver tries to localise foreign mappings by
copying them.  Unfortunately, it does so by directly modifying
skb page frags without checking whether the skb is cloned or
not.  In fact, the packet is going to be cloned more often
than not.

This may result in either data corruption on DMA or a
page fault in dom0 which kills the whole machine.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
 drivers/xen/netback/loopback.c |    4 ++++
 1 files changed, 4 insertions(+)

diff -r 1372bc676080 -r 8d5ae51a09a6 drivers/xen/netback/loopback.c
--- a/drivers/xen/netback/loopback.c    Wed Aug 01 09:23:46 2007 +0100
+++ b/drivers/xen/netback/loopback.c    Wed Aug 01 15:16:46 2007 +0100
@@ -99,6 +99,10 @@ static int skb_remove_foreign_references
+       if (skb_cloned(skb) &&
+           unlikely(pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
+               return 0;
        for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
                pfn = page_to_pfn(skb_shinfo(skb)->frags[i].page);
                if (!is_foreign(pfn))

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] [NET] netloop: Do not clobber cloned skb page frags, Xen patchbot-linux-2.6.18-xen <=