Skip to contentSkip to conversation

xen-netfront: use correct linear area after linearizing an skb

PATCH In review David Vrabel 2 participants 3 messages Dec 9, 2014 – Dec 10, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen-netfront: use correct linear area after linearizing an skb

Commit 97a6d1bb2b658ac85ed88205ccd1ab809899884d (xen-netfront: Fix handling packets on compound pages with skb_linearize) attempted to fix a problem where an skb that would have required too many slots would be dropped causing TCP connections to stall.

However, it filled in the first slot using the original buffer and not the new one and would use the wrong offset and grant access to the wrong page.

Netback would notice the malformed request and stop all traffic on the VIF, reporting:

vif vif-3-0 vif3.0: txreq.offset: 85e, size: 4002, end: 6144 vif vif-3-0 vif3.0: fatal error; disabling device

---
 drivers/net/xen-netfront.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/net/xen-netfront.c +3 -0
index ece8d18..eeed0ce 100644
@@ -627,6 +627,9 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 				    slots, skb->len);
 		if (skb_linearize(skb))
 			goto drop;
+		data = skb->data;
+		offset = offset_in_page(data);
+		len = skb_headlen(skb);
 	}
 
 	spin_lock_irqsave(&queue->tx_lock, flags);
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw

From: David Vrabel <[email protected]>
Date: Tue, 9 Dec 2014 18:43:28 +0000

Quoted 12 lines

Commit 97a6d1bb2b658ac85ed88205ccd1ab809899884d (xen-netfront: Fix handling packets on compound pages with skb_linearize) attempted to fix a problem where an skb that would have required too many slots would be dropped causing TCP connections to stall.

However, it filled in the first slot using the original buffer and not the new one and would use the wrong offset and grant access to the wrong page.

Netback would notice the malformed request and stop all traffic on the VIF, reporting:

Quoted 6 lines

vif vif-3-0 vif3.0: txreq.offset: 85e, size: 4002, end: 6144 vif vif-3-0 vif3.0: fatal error; disabling device

Applied and queued up for -stable, thanks.

maintainer
#2 lore raw
In reply to David Vrabel

From: David Vrabel <[email protected]>
Date: Tue, 9 Dec 2014 18:43:28 +0000

Quoted 12 lines

Commit 97a6d1bb2b658ac85ed88205ccd1ab809899884d (xen-netfront: Fix handling packets on compound pages with skb_linearize) attempted to fix a problem where an skb that would have required too many slots would be dropped causing TCP connections to stall.

However, it filled in the first slot using the original buffer and not the new one and would use the wrong offset and grant access to the wrong page.

Netback would notice the malformed request and stop all traffic on the VIF, reporting:

Quoted 6 lines

vif vif-3-0 vif3.0: txreq.offset: 85e, size: 4002, end: 6144 vif vif-3-0 vif3.0: fatal error; disabling device

Applied and queued up for -stable, thanks.