Commit bfc960a8eec023a170a80697fe65157cd4f44f81

Authored by Eric Dumazet
Committed by David S. Miller
1 parent d84ba638e4

l2tp: test for ethernet header in l2tp_eth_dev_recv()

close https://bugzilla.kernel.org/show_bug.cgi?id=16529

Before calling dev_forward_skb(), we should make sure skb head contains
at least an ethernet header, even if length included in upper layer said
so. Use pskb_may_pull() to make sure this ethernet header is present in
skb head.

Reported-by: Thomas Heil <heil@terminal-consulting.de>
Reported-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -132,7 +132,7 @@
132 132 printk("\n");
133 133 }
134 134  
135   - if (data_len < ETH_HLEN)
  135 + if (!pskb_may_pull(skb, sizeof(ETH_HLEN)))
136 136 goto error;
137 137  
138 138 secpath_reset(skb);