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

xen-devel

[Top] [All Lists]

[Xen-devel] [NET] netloop: Do not clobber cloned skb page frags

To: Keir Fraser <keir@xxxxxxxxxxxxx>, Xen Development Mailing List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [NET] netloop: Do not clobber cloned skb page frags
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 1 Aug 2007 21:39:20 +0800
Delivery-date: 2007年8月01日 06:37:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
Hi Keir:
This patch is required for anyone still using netloop.
[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>
Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff -r 88a17da7f336 drivers/xen/netback/loopback.c
--- a/drivers/xen/netback/loopback.c Thu Jul 26 16:36:52 2007 +0100
+++ b/drivers/xen/netback/loopback.c Tue Jul 31 18:59:11 2007 +0800
@@ -99,6 +99,10 @@ static int skb_remove_foreign_references
 
 BUG_ON(skb_shinfo(skb)->frag_list);
 
+ 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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [NET] netloop: Do not clobber cloned skb page frags, Herbert Xu <=
Previous by Date: [Xen-devel] [PATCH][ELF] Load elf symbols for Dom0 when BSD_SYMTAB=yes , Christoph Egger
Next by Date: Re: [Xen-devel] blkif_map error starting fourth guest domain , Kieran Mansley
Previous by Thread: [Xen-devel] [PATCH][ELF] Load elf symbols for Dom0 when BSD_SYMTAB=yes , Christoph Egger
Next by Thread: Re: [Xen-devel] blkif_map error starting fourth guest domain , Kieran Mansley
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /