Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfc960a8 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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: default avatarThomas Heil <heil@terminal-consulting.de>
Reported-by: default avatarIan Campbell <Ian.Campbell@eu.citrix.com>
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d84ba638
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -132,7 +132,7 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
		printk("\n");
		printk("\n");
	}
	}


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


	secpath_reset(skb);
	secpath_reset(skb);