1
0
Fork 0

ipip: validate header length in ipip_tunnel_xmit

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

Fixes: cb9f1b7838 ("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>
alistair/sunxi64-5.4-dsi
Haishuang Yan 2019-07-25 11:07:56 +08:00 committed by David S. Miller
parent 53db1cced4
commit 47d858d0bd
1 changed files with 3 additions and 0 deletions

View File

@ -275,6 +275,9 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb,
const struct iphdr *tiph = &tunnel->parms.iph;
u8 ipproto;
if (!pskb_inet_may_pull(skb))
goto tx_error;
switch (skb->protocol) {
case htons(ETH_P_IP):
ipproto = IPPROTO_IPIP;