Skip to content

Commit

Permalink
l2tp: test for ethernet header in l2tp_eth_dev_recv()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Aug 26, 2010
1 parent d84ba63 commit bfc960a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/l2tp/l2tp_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
printk("\n");
}

if (data_len < ETH_HLEN)
if (!pskb_may_pull(skb, sizeof(ETH_HLEN)))
goto error;

secpath_reset(skb);
Expand Down

0 comments on commit bfc960a

Please sign in to comment.