* [PATCH net v3] ip_tunnel: Set network header properly for IP_ECN_decapsulate()
@ 2014-05-04 22:20 Ying Cai
2014-05-05 16:32 ` Eric Dumazet
2014-05-05 20:32 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Ying Cai @ 2014-05-04 22:20 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Neal Cardwell, Sergei Shtylyov, Ying Cai
In ip_tunnel_rcv(), set skb->network_header to inner IP header
before IP_ECN_decapsulate().
Without the fix, IP_ECN_decapsulate() takes outer IP header as
inner IP header, possibly causing error messages or packet drops.
Note that this skb_reset_network_header() call was in this spot when
the original feature for checking consistency of ECN bits through
tunnels was added in eccc1bb8d4b4 ("tunnel: drop packet if ECN present
with not-ECT"). It was only removed from this spot in 3d7b46cd20e3
("ip_tunnel: push generic protocol handling to ip_tunnel module.").
Fixes: 3d7b46cd20e3 ("ip_tunnel: push generic protocol handling to ip_tunnel module.")
Reported-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Ying Cai <ycai@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
---
net/ipv4/ip_tunnel.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index fa5b751..b3f8597 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -442,6 +442,8 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
tunnel->i_seqno = ntohl(tpi->seq) + 1;
}
+ skb_reset_network_header(skb);
+
err = IP_ECN_decapsulate(iph, skb);
if (unlikely(err)) {
if (log_ecn_error)
--
1.9.1.423.g4596e3a
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v3] ip_tunnel: Set network header properly for IP_ECN_decapsulate()
2014-05-04 22:20 [PATCH net v3] ip_tunnel: Set network header properly for IP_ECN_decapsulate() Ying Cai
@ 2014-05-05 16:32 ` Eric Dumazet
2014-05-05 20:32 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2014-05-05 16:32 UTC (permalink / raw)
To: Ying Cai; +Cc: David Miller, netdev, Neal Cardwell, Sergei Shtylyov
On Sun, 2014-05-04 at 15:20 -0700, Ying Cai wrote:
> In ip_tunnel_rcv(), set skb->network_header to inner IP header
> before IP_ECN_decapsulate().
>
> Without the fix, IP_ECN_decapsulate() takes outer IP header as
> inner IP header, possibly causing error messages or packet drops.
>
> Note that this skb_reset_network_header() call was in this spot when
> the original feature for checking consistency of ECN bits through
> tunnels was added in eccc1bb8d4b4 ("tunnel: drop packet if ECN present
> with not-ECT"). It was only removed from this spot in 3d7b46cd20e3
> ("ip_tunnel: push generic protocol handling to ip_tunnel module.").
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v3] ip_tunnel: Set network header properly for IP_ECN_decapsulate()
2014-05-04 22:20 [PATCH net v3] ip_tunnel: Set network header properly for IP_ECN_decapsulate() Ying Cai
2014-05-05 16:32 ` Eric Dumazet
@ 2014-05-05 20:32 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-05-05 20:32 UTC (permalink / raw)
To: ycai; +Cc: netdev, ncardwell, sergei.shtylyov
From: Ying Cai <ycai@google.com>
Date: Sun, 4 May 2014 15:20:04 -0700
> In ip_tunnel_rcv(), set skb->network_header to inner IP header
> before IP_ECN_decapsulate().
>
> Without the fix, IP_ECN_decapsulate() takes outer IP header as
> inner IP header, possibly causing error messages or packet drops.
>
> Note that this skb_reset_network_header() call was in this spot when
> the original feature for checking consistency of ECN bits through
> tunnels was added in eccc1bb8d4b4 ("tunnel: drop packet if ECN present
> with not-ECT"). It was only removed from this spot in 3d7b46cd20e3
> ("ip_tunnel: push generic protocol handling to ip_tunnel module.").
>
> Fixes: 3d7b46cd20e3 ("ip_tunnel: push generic protocol handling to ip_tunnel module.")
> Reported-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Ying Cai <ycai@google.com>
> Acked-by: Neal Cardwell <ncardwell@google.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-05 20:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-04 22:20 [PATCH net v3] ip_tunnel: Set network header properly for IP_ECN_decapsulate() Ying Cai
2014-05-05 16:32 ` Eric Dumazet
2014-05-05 20:32 ` 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).