Commit 47d858d0 authored by Haishuang Yan's avatar Haishuang Yan Committed by David S. Miller

ipip: validate header length in ipip_tunnel_xmit

We need the same checks introduced by commit cb9f1b78
("ip: validate header length on virtual device xmit") for
ipip tunnel.

Fixes: cb9f1b78 ("ip: validate header length on virtual device xmit")
Signed-off-by: default avatarHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 53db1cce
...@@ -275,6 +275,9 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, ...@@ -275,6 +275,9 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb,
const struct iphdr *tiph = &tunnel->parms.iph; const struct iphdr *tiph = &tunnel->parms.iph;
u8 ipproto; u8 ipproto;
if (!pskb_inet_may_pull(skb))
goto tx_error;
switch (skb->protocol) { switch (skb->protocol) {
case htons(ETH_P_IP): case htons(ETH_P_IP):
ipproto = IPPROTO_IPIP; ipproto = IPPROTO_IPIP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment