Re: [PATCH net-next v1 1/4] tipc: add net device to skb before UDP xmit

2016-03-06 Thread David Miller
From: Richard Alpe 
Date: Thu, 3 Mar 2016 14:20:40 +0100

> Prior to this patch enabling a IPv4 UDP bearer caused a null pointer
> dereference in iptunnel_xmit_stats(), when it tried to dereference the
> net device from the skb. To resolve this we now point the skb device
> to the net device resolved from the routing table.
> 
> Fixes: 039f50629b7f (ip_tunnel: Move stats update to iptunnel_xmit())
> Signed-off-by: Richard Alpe 
> Acked-by: Jon Maloy 
> Reviewed-by: Erik Hugne 

Applied.


RE: [PATCH net-next v1 1/4] tipc: add net device to skb before UDP xmit

2016-03-03 Thread Xue, Ying
As I just saw, you had submitted the series to net-next. Anyway, this is a very 
good job!

Thanks,
Ying

-Original Message-
From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org] On 
Behalf Of Richard Alpe
Sent: 2016年3月3日 21:21
To: netdev@vger.kernel.org
Cc: tipc-discuss...@lists.sourceforge.net; Richard Alpe
Subject: [PATCH net-next v1 1/4] tipc: add net device to skb before UDP xmit

Prior to this patch enabling a IPv4 UDP bearer caused a null pointer 
dereference in iptunnel_xmit_stats(), when it tried to dereference the net 
device from the skb. To resolve this we now point the skb device to the net 
device resolved from the routing table.

Fixes: 039f50629b7f (ip_tunnel: Move stats update to iptunnel_xmit())
Signed-off-by: Richard Alpe 
Acked-by: Jon Maloy 
Reviewed-by: Erik Hugne 
---
 net/tipc/udp_media.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index 
d63a911..f22a5bb1 100644
--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -181,6 +181,8 @@ static int tipc_udp_send_msg(struct net *net, struct 
sk_buff *skb,
err = PTR_ERR(rt);
goto tx_error;
}
+
+   skb->dev = rt->dst.dev;
ttl = ip4_dst_hoplimit(&rt->dst);
udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr,
dst->ipv4.s_addr, 0, ttl, 0, src->udp_port,
--
2.1.4



[PATCH net-next v1 1/4] tipc: add net device to skb before UDP xmit

2016-03-03 Thread Richard Alpe
Prior to this patch enabling a IPv4 UDP bearer caused a null pointer
dereference in iptunnel_xmit_stats(), when it tried to dereference the
net device from the skb. To resolve this we now point the skb device
to the net device resolved from the routing table.

Fixes: 039f50629b7f (ip_tunnel: Move stats update to iptunnel_xmit())
Signed-off-by: Richard Alpe 
Acked-by: Jon Maloy 
Reviewed-by: Erik Hugne 
---
 net/tipc/udp_media.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c
index d63a911..f22a5bb1 100644
--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -181,6 +181,8 @@ static int tipc_udp_send_msg(struct net *net, struct 
sk_buff *skb,
err = PTR_ERR(rt);
goto tx_error;
}
+
+   skb->dev = rt->dst.dev;
ttl = ip4_dst_hoplimit(&rt->dst);
udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr,
dst->ipv4.s_addr, 0, ttl, 0, src->udp_port,
-- 
2.1.4