net/core/dev: Warn on a too-short GRO frame
authorAaron Conole <aconole@bytheb.org>
Sat, 2 Apr 2016 19:26:43 +0000 (15:26 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Apr 2016 23:58:39 +0000 (19:58 -0400)
When signaling that a GRO frame is ready to be processed, the network stack
correctly checks length and aborts processing when a frame is less than 14
bytes. However, such a condition is really indicative of a broken driver,
and should be loudly signaled, rather than silently dropped as the case is
today.

Convert the condition to use net_warn_ratelimited() to ensure the stack
loudly complains about such broken drivers.

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index b9bcbe77d913b15dcbe7cdc9ee6cb7f74ee55aee..273f10d1e30618a99a172ec96d2bd017486f35d6 100644 (file)
@@ -4663,6 +4663,8 @@ static struct sk_buff *napi_frags_skb(struct napi_struct *napi)
        if (unlikely(skb_gro_header_hard(skb, hlen))) {
                eth = skb_gro_header_slow(skb, hlen, 0);
                if (unlikely(!eth)) {
+                       net_warn_ratelimited("%s: dropping impossible skb from %s\n",
+                                            __func__, napi->dev->name);
                        napi_reuse_skb(napi, skb);
                        return NULL;
                }