mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
xen/netback: Reset nr_frags before freeing skb
[ Upstream commit 3a0233ddec ]
At this point nr_frags has been incremented but the frag does not yet
have a page assigned so freeing the skb results in a crash. Reset
nr_frags before freeing the skb to prevent this.
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f85c2f3ab4
commit
47fd4df0c2
@@ -927,6 +927,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
|
||||
skb_shinfo(skb)->nr_frags = MAX_SKB_FRAGS;
|
||||
nskb = xenvif_alloc_skb(0);
|
||||
if (unlikely(nskb == NULL)) {
|
||||
skb_shinfo(skb)->nr_frags = 0;
|
||||
kfree_skb(skb);
|
||||
xenvif_tx_err(queue, &txreq, extra_count, idx);
|
||||
if (net_ratelimit())
|
||||
@@ -942,6 +943,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
|
||||
|
||||
if (xenvif_set_skb_gso(queue->vif, skb, gso)) {
|
||||
/* Failure in xenvif_set_skb_gso is fatal. */
|
||||
skb_shinfo(skb)->nr_frags = 0;
|
||||
kfree_skb(skb);
|
||||
kfree_skb(nskb);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user