mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
ipip: validate header length in ipip_tunnel_xmit
[ Upstream commit47d858d0bd] We need the same checks introduced by commitcb9f1b7838("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1bb2dd37cb
commit
f186fb5ccf
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user