Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipip: validate header length in ipip_tunnel_xmit

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

Fixes: cb9f1b783850b ("ip: validate header length on virtual device xmit")
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Haishuang Yan and committed by
David S. Miller
47d858d0 53db1cce

+3
+3
net/ipv4/ipip.c
··· 275 275 const struct iphdr *tiph = &tunnel->parms.iph; 276 276 u8 ipproto; 277 277 278 + if (!pskb_inet_may_pull(skb)) 279 + goto tx_error; 280 + 278 281 switch (skb->protocol) { 279 282 case htons(ETH_P_IP): 280 283 ipproto = IPPROTO_IPIP;