Skip to content

Commit

Permalink
xen-netfront: use correct linear area after linearizing an skb
Browse files Browse the repository at this point in the history
Commit 97a6d1b (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

Reported-by: Anthony Wright <anthony@overnetdata.com>
Tested-by: Anthony Wright <anthony@overnetdata.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David Vrabel authored and David S. Miller committed Dec 10, 2014
1 parent 0f85fea commit 11d3d2a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/xen-netfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 11d3d2a

Please sign in to comment.