xen-netfront: be more drop monitor friendly
authorEric Dumazet <edumazet@google.com>
Wed, 30 Aug 2017 17:32:58 +0000 (10:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Aug 2017 22:56:16 +0000 (15:56 -0700)
xennet_start_xmit() might copy skb with inappropriate layout
into a fresh one.

Old skb is freed, and at this point it is not a drop, but
a consume. New skb will then be either consumed or dropped.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/xen-netfront.c

index 7b61adb6270c99f8c70f1efa7575b1bb62d96f45..523387e71a8021b81beb46407132def2638fdb48 100644 (file)
@@ -611,7 +611,7 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
                nskb = skb_copy(skb, GFP_ATOMIC);
                if (!nskb)
                        goto drop;
-               dev_kfree_skb_any(skb);
+               dev_consume_skb_any(skb);
                skb = nskb;
                page = virt_to_page(skb->data);
                offset = offset_in_page(skb->data);