linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipip: validate header length in ipip_tunnel_xmit
@ 2019-07-25  3:07 Haishuang Yan
  2019-07-25  3:07 ` Haishuang Yan
  2019-07-26  0:26 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Haishuang Yan @ 2019-07-25  3:07 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov; +Cc: netdev, linux-kernel, Haishuang Yan

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

Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
 net/ipv4/ipip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 43adfc1..2f01cf6 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -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;
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ipip: validate header length in ipip_tunnel_xmit
  2019-07-25  3:07 [PATCH] ipip: validate header length in ipip_tunnel_xmit Haishuang Yan
@ 2019-07-25  3:07 ` Haishuang Yan
  2019-07-25 13:48   ` Willem de Bruijn
  2019-07-26  0:26 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Haishuang Yan @ 2019-07-25  3:07 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov; +Cc: netdev, linux-kernel, Haishuang Yan

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

Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
 net/ipv4/ipip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 43adfc1..2f01cf6 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -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;
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipip: validate header length in ipip_tunnel_xmit
  2019-07-25  3:07 ` Haishuang Yan
@ 2019-07-25 13:48   ` Willem de Bruijn
  0 siblings, 0 replies; 4+ messages in thread
From: Willem de Bruijn @ 2019-07-25 13:48 UTC (permalink / raw)
  To: Haishuang Yan
  Cc: David S. Miller, Alexey Kuznetsov, Network Development, linux-kernel

On Wed, Jul 24, 2019 at 11:09 PM Haishuang Yan
<yanhaishuang@cmss.chinamobile.com> wrote:
>
> 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>

Good catch. reg_vif_xmit in net/ipv4/ipmr.c probably also needs it.
All other ndo_start_xmit under net/ipv4 and net/ipv6 have this check
as of the above commit.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipip: validate header length in ipip_tunnel_xmit
  2019-07-25  3:07 [PATCH] ipip: validate header length in ipip_tunnel_xmit Haishuang Yan
  2019-07-25  3:07 ` Haishuang Yan
@ 2019-07-26  0:26 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-07-26  0:26 UTC (permalink / raw)
  To: yanhaishuang; +Cc: kuznet, netdev, linux-kernel

From: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Date: Thu, 25 Jul 2019 11:07:55 +0800

> We need the same checks introduced by commit cb9f1b783850
> ("ip: validate header length on virtual device xmit") for
> ipip tunnel.
> 
> Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-26  0:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25  3:07 [PATCH] ipip: validate header length in ipip_tunnel_xmit Haishuang Yan
2019-07-25  3:07 ` Haishuang Yan
2019-07-25 13:48   ` Willem de Bruijn
2019-07-26  0:26 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).