* [PATCH] ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called
@ 2014-01-21 7:18 Duan Jiong
2014-01-21 18:33 ` Pravin Shelar
0 siblings, 1 reply; 5+ messages in thread
From: Duan Jiong @ 2014-01-21 7:18 UTC (permalink / raw)
To: David Miller; +Cc: Pravin B Shelar, Daniel Petre, Eric Dumazet, netdev
commit a622260254ee48("ip_tunnel: fix kernel panic with icmp_dest_unreach")
clear IPCB in ip_tunnel_xmit() , or else skb->cb[] may contain garbage from
GSO segmentation layer.
But commit 0e6fbc5b6c621("ip_tunnels: extend iptunnel_xmit()") refactor codes,
and it clear IPCB behind the dst_link_failure().
So clear IPCB in ip_tunnel_xmit() just like commti a622260254ee48("ip_tunnel:
fix kernel panic with icmp_dest_unreach").
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/ipv4/ip_tunnel.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 90ff957..dda1e9a 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -535,6 +535,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
inner_iph = (const struct iphdr *)skb_inner_network_header(skb);
+ memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
dst = tnl_params->daddr;
if (dst == 0) {
/* NBMA tunnel */
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called
2014-01-21 7:18 [PATCH] ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called Duan Jiong
@ 2014-01-21 18:33 ` Pravin Shelar
2014-01-23 5:24 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Pravin Shelar @ 2014-01-21 18:33 UTC (permalink / raw)
To: Duan Jiong; +Cc: David Miller, Daniel Petre, Eric Dumazet, netdev
On Mon, Jan 20, 2014 at 11:18 PM, Duan Jiong <duanj.fnst@cn.fujitsu.com> wrote:
>
> commit a622260254ee48("ip_tunnel: fix kernel panic with icmp_dest_unreach")
> clear IPCB in ip_tunnel_xmit() , or else skb->cb[] may contain garbage from
> GSO segmentation layer.
>
> But commit 0e6fbc5b6c621("ip_tunnels: extend iptunnel_xmit()") refactor codes,
> and it clear IPCB behind the dst_link_failure().
>
ok.
> So clear IPCB in ip_tunnel_xmit() just like commti a622260254ee48("ip_tunnel:
> fix kernel panic with icmp_dest_unreach").
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> ---
> net/ipv4/ip_tunnel.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
> index 90ff957..dda1e9a 100644
> --- a/net/ipv4/ip_tunnel.c
> +++ b/net/ipv4/ip_tunnel.c
> @@ -535,6 +535,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
>
> inner_iph = (const struct iphdr *)skb_inner_network_header(skb);
>
> + memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
> dst = tnl_params->daddr;
> if (dst == 0) {
> /* NBMA tunnel */
Can you clear IPCB in error path for dst_link_failure(). So that we do
not clear it twice in fast path.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called
2014-01-21 18:33 ` Pravin Shelar
@ 2014-01-23 5:24 ` David Miller
2014-01-23 6:00 ` [PATCH v2] " Duan Jiong
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2014-01-23 5:24 UTC (permalink / raw)
To: pshelar; +Cc: duanj.fnst, daniel.petre, edumazet, netdev
From: Pravin Shelar <pshelar@nicira.com>
Date: Tue, 21 Jan 2014 10:33:36 -0800
> Can you clear IPCB in error path for dst_link_failure(). So that we do
> not clear it twice in fast path.
Indeed, please add this memset() before the dst_link_failure() call.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called
2014-01-23 5:24 ` David Miller
@ 2014-01-23 6:00 ` Duan Jiong
2014-01-23 21:28 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Duan Jiong @ 2014-01-23 6:00 UTC (permalink / raw)
To: David Miller, pshelar; +Cc: daniel.petre, edumazet, netdev
commit a622260254ee48("ip_tunnel: fix kernel panic with icmp_dest_unreach")
clear IPCB in ip_tunnel_xmit() , or else skb->cb[] may contain garbage from
GSO segmentation layer.
But commit 0e6fbc5b6c621("ip_tunnels: extend iptunnel_xmit()") refactor codes,
and it clear IPCB behind the dst_link_failure().
So clear IPCB in ip_tunnel_xmit() just like commti a622260254ee48("ip_tunnel:
fix kernel panic with icmp_dest_unreach").
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
v2: add the memset() before the dst_link_failure() call
net/ipv4/ip_tunnel.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 90ff957..471c8c1 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -618,6 +618,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
tunnel->err_time + IPTUNNEL_ERR_TIMEO)) {
tunnel->err_count--;
+ memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
dst_link_failure(skb);
} else
tunnel->err_count = 0;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called
2014-01-23 6:00 ` [PATCH v2] " Duan Jiong
@ 2014-01-23 21:28 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2014-01-23 21:28 UTC (permalink / raw)
To: duanj.fnst; +Cc: pshelar, daniel.petre, edumazet, netdev
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Date: Thu, 23 Jan 2014 14:00:25 +0800
>
> commit a622260254ee48("ip_tunnel: fix kernel panic with icmp_dest_unreach")
> clear IPCB in ip_tunnel_xmit() , or else skb->cb[] may contain garbage from
> GSO segmentation layer.
>
> But commit 0e6fbc5b6c621("ip_tunnels: extend iptunnel_xmit()") refactor codes,
> and it clear IPCB behind the dst_link_failure().
>
> So clear IPCB in ip_tunnel_xmit() just like commti a622260254ee48("ip_tunnel:
> fix kernel panic with icmp_dest_unreach").
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-01-23 21:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-21 7:18 [PATCH] ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called Duan Jiong
2014-01-21 18:33 ` Pravin Shelar
2014-01-23 5:24 ` David Miller
2014-01-23 6:00 ` [PATCH v2] " Duan Jiong
2014-01-23 21:28 ` 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).