netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv6: skip __ipv6_select_ident when there is no skb_dst
@ 2015-03-18 13:52 Sabrina Dubroca
  2015-03-18 14:04 ` Vlad Yasevich
  0 siblings, 1 reply; 10+ messages in thread
From: Sabrina Dubroca @ 2015-03-18 13:52 UTC (permalink / raw)
  To: davem; +Cc: netdev, matt, Sabrina Dubroca, Vladislav Yasevich

Matt Grant reported frequent crashes in ipv6_select_ident when
udp6_ufo_fragment is called from openvswitch on a skb that doesn't
have a dst_entry set.

Skip __ipv6_select_ident in case of a NULL rt.

Fixes: 0508c07f5e0c ("ipv6: Select fragment id during UFO segmentation if not set.")
Cc: Vladislav Yasevich <vyasevic@redhat.com>
Reported-by: Matt Grant <matt@mattgrant.net.nz>
Tested-by: Matt Grant <matt@mattgrant.net.nz>
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
David, can you queue it for stable (3.19)?

 net/ipv6/output_core.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
index 74581f706c4d..52b1bc76d5c5 100644
--- a/net/ipv6/output_core.c
+++ b/net/ipv6/output_core.c
@@ -62,12 +62,14 @@ EXPORT_SYMBOL_GPL(ipv6_proxy_select_ident);
 void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
 {
 	static u32 ip6_idents_hashrnd __read_mostly;
-	u32 id;
+	u32 id = 0;
 
 	net_get_random_once(&ip6_idents_hashrnd, sizeof(ip6_idents_hashrnd));
 
-	id = __ipv6_select_ident(ip6_idents_hashrnd, &rt->rt6i_dst.addr,
-				 &rt->rt6i_src.addr);
+	if (rt)
+		id = __ipv6_select_ident(ip6_idents_hashrnd, &rt->rt6i_dst.addr,
+					 &rt->rt6i_src.addr);
+
 	fhdr->identification = htonl(id);
 }
 EXPORT_SYMBOL(ipv6_select_ident);
-- 
2.3.3

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

end of thread, other threads:[~2015-03-20 17:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-18 13:52 [PATCH net] ipv6: skip __ipv6_select_ident when there is no skb_dst Sabrina Dubroca
2015-03-18 14:04 ` Vlad Yasevich
2015-03-18 14:15   ` Sabrina Dubroca
2015-03-18 14:25     ` Vlad Yasevich
2015-03-18 14:36       ` Sabrina Dubroca
2015-03-19  9:39         ` Matt Grant
2015-03-19 10:10           ` Sabrina Dubroca
2015-03-19 10:22             ` [PATCH net] ipv6: call ipv6_proxy_select_ident instead of ipv6_select_ident in udp6_ufo_fragment Sabrina Dubroca
2015-03-19 12:37               ` Vlad Yasevich
2015-03-20 17:19               ` 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).