Skip to content

Commit

Permalink
ipip: validate header length in ipip_tunnel_xmit
Browse files Browse the repository at this point in the history
[ Upstream commit 47d858d0bdcd47cc1c6c9eeca91b091dd9e55637 ]

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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Haishuang Yan authored and gregkh committed Aug 9, 2019
1 parent 1bb2dd3 commit f186fb5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv4/ipip.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,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;
Expand Down

0 comments on commit f186fb5

Please sign in to comment.