Netdev List
 help / color / mirror / Atom feed
From: wenxu <wenxu@ucloud.cn>
To: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] ipv6: add ipv6_fragment hook in ipv6_stub
Date: Fri, 28 Aug 2020 07:33:10 +0800	[thread overview]
Message-ID: <401c9afe-cc58-bf62-4588-b971b05cb024@ucloud.cn> (raw)
In-Reply-To: <20200827223836.GB2443@localhost.localdomain>

Yes, I check the ipv6_stub->ipv6_fragment. And in the case

if there is no ipv6_stub->ipv6_fragment it means no ipv6 fragment support

and it should free the skb.

Maybe sometimes  not all the calling remember to check with this? So

it should add a default one with following?

+static int eafnosupport_ipv6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
+                                     int (*output)(struct net *, struct sock *, struct sk_buff *))
+{
+       kfree_skb(skb);
+       return -EAFNOSUPPORT;
+}
+

在 2020/8/28 6:38, Marcelo Ricardo Leitner 写道:
> On Thu, Aug 27, 2020 at 07:51:47AM -0700, David Miller wrote:
>> From: wenxu@ucloud.cn
>> Date: Thu, 27 Aug 2020 18:39:51 +0800
>>
>>> From: wenxu <wenxu@ucloud.cn>
>>>
>>> Add ipv6_fragment to ipv6_stub to avoid calling netfilter when
>>> access ip6_fragment.
>>>
>>> Signed-off-by: wenxu <wenxu@ucloud.cn>
>> Please test these changes with ipv6 disabled.
>>
>> It will crash, you have to update the default stub in
>> net/ipv6/addrconf_core.c as well.
> I didn't test it myself but I'm not seeing how the crash could happen.
> The next patch does check for it being NULL before using it:
>
> -               if (!v6ops)
> +               if (!ipv6_stub->ipv6_fragment)
>                         goto err;
>
> Wenxu?
>
>   Marcelo
>

  reply	other threads:[~2020-08-27 23:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 10:39 [PATCH net-next 0/2] Put ip6_fragment in ipv6_stub wenxu
2020-08-27 10:39 ` [PATCH net-next 1/2] ipv6: add ipv6_fragment hook " wenxu
2020-08-27 14:51   ` David Miller
2020-08-27 22:38     ` Marcelo Ricardo Leitner
2020-08-27 23:33       ` wenxu [this message]
2020-08-27 10:39 ` [PATCH net-next 2/2] openvswitch: using ip6_fragment " wenxu

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=401c9afe-cc58-bf62-4588-b971b05cb024@ucloud.cn \
    --to=wenxu@ucloud.cn \
    --cc=davem@davemloft.net \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox