All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlad Yasevich <vyasevic@redhat.com>
To: Sabrina Dubroca <sd@queasysnail.net>, davem@davemloft.net
Cc: netdev@vger.kernel.org, matt@mattgrant.net.nz
Subject: Re: [PATCH net] ipv6: skip __ipv6_select_ident when there is no skb_dst
Date: Wed, 18 Mar 2015 10:04:10 -0400	[thread overview]
Message-ID: <550985DA.3070703@redhat.com> (raw)
In-Reply-To: <1426686735-6129-1-git-send-email-sd@queasysnail.net>

On 03/18/2015 09:52 AM, Sabrina Dubroca wrote:
> 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);
> 

Hi Sabrina

This would result in us using id 0 which is not what we want to do.

In this case, udp6_ufo_fragment() should be calling ipv6_proxy_select_ident() so that
the fragment id is properly generated.

-vlad

  reply	other threads:[~2015-03-18 14:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=550985DA.3070703@redhat.com \
    --to=vyasevic@redhat.com \
    --cc=davem@davemloft.net \
    --cc=matt@mattgrant.net.nz \
    --cc=netdev@vger.kernel.org \
    --cc=sd@queasysnail.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.