From: Stefano Brivio <sbrivio@redhat.com>
To: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
David Miller <davem@davemloft.net>, <petrm@mellanox.com>,
<idosch@mellanox.com>, <sd@queasysnail.net>,
<mousuanming@huawei.com>, <netdev@vger.kernel.org>,
<mingfangsen@huawei.com>, <zhoukang7@huawei.com>,
<wangxiaogang3@huawei.com>
Subject: Re: [PATCH v2] vxlan: remove the redundant gro_cells_destroy() calling.
Date: Sat, 16 Mar 2019 06:45:07 +0100 [thread overview]
Message-ID: <20190316064507.10373066@elisabeth> (raw)
In-Reply-To: <308992f9-5c45-ea0c-7265-82c6976be45f@huawei.com>
On Sat, 16 Mar 2019 13:24:39 +0800
Zhiqiang Liu <liuzhiqiang26@huawei.com> wrote:
> I have updated the commit message as suggested by Eric. Even though I have read
> Documentation/networking/netdev-FAQ.rst as you mentioned. I am now still a little
> confused about the subject-prefix of v3 (net or net-next).
It's "net": this is a (likely critical) fix.
> And David Miller saied the net-next tree is CLOSED.
Right, but this is not for net-next anymore, given what Eric found.
> Could you help me check whether the following v3 patch is ok?
>
>
> Subject: [PATCH net v3] vxlan: remove the redundant gro_cells_destroy() calling.
This one. And it's not just redundant, so maybe something like:
"[PATCH net v3] vxlan: Don't call gro_cells_destroy() before
device is unregistered"
> OR
> Subject: [PATCH net-next v3] vxlan: remove the redundant gro_cells_destroy() calling.
>
> Commit ad6c9986bcb62 ("vxlan: Fix GRO cells race condition between
> receive and link delete") fixed a race condition for the typical case a vxlan
> device is dismantled from the current netns. But if a netns is dismantled,
> vxlan_destroy_tunnels() is called to schedule a unregister_netdevice_queue()
> of all the vxlan tunnels that are related to this netns.
>
> In vxlan_destroy_tunnels(), gro_cells_destroy() is called and finished before
> unregister_netdevice_queue(). This means that the gro_cells_destroy() call is
> done too soon, for the same reasons explained in above commit.
>
> So we need to fully respect the RCU rules, and thus must remove the
> gro_cells_destroy() call or risk use after-free.
>
> Fixes: 58ce31cca1ff ("vxlan: GRO support at tunnel layer")
> Signed-off-by: Suanming.Mou <mousuanming@huawei.com>
> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
> Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
> Reviewed-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
> ---
> V1->V2:
This will actually be v3.
> - update the commit message suggeted by Eric Dumazet
> - update Fixes: tag
>
> drivers/net/vxlan.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 077f1b9f2761..d76dfed8d9bb 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -4335,10 +4335,8 @@ static void vxlan_destroy_tunnels(struct net *net, struct list_head *head)
> /* If vxlan->dev is in the same netns, it has already been added
> * to the list by the previous loop.
> */
> - if (!net_eq(dev_net(vxlan->dev), net)) {
> - gro_cells_destroy(&vxlan->gro_cells);
> + if (!net_eq(dev_net(vxlan->dev), net))
> unregister_netdevice_queue(vxlan->dev, head);
> - }
> }
>
> for (h = 0; h < PORT_HASH_SIZE; ++h)
Looks good to me, you can keep my Reviewed-by: tag for v3. Thanks!
--
Stefano
next prev parent reply other threads:[~2019-03-16 5:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-15 10:06 [PATCH] vxlan: remove the redundant gro_cells_destroy() calling Zhiqiang Liu
2019-03-15 11:54 ` Stefano Brivio
2019-03-15 14:55 ` Zhiqiang Liu
2019-03-15 15:25 ` Stefano Brivio
2019-03-15 14:58 ` Eric Dumazet
2019-03-15 15:18 ` [PATCH v2] " Zhiqiang Liu
2019-03-15 15:28 ` Stefano Brivio
2019-03-15 16:06 ` Eric Dumazet
2019-03-15 18:02 ` David Miller
2019-03-15 18:56 ` Eric Dumazet
2019-03-15 21:08 ` Stefano Brivio
2019-03-15 21:26 ` Eric Dumazet
2019-03-15 22:04 ` Stefano Brivio
2019-03-16 5:24 ` Zhiqiang Liu
2019-03-16 5:45 ` Stefano Brivio [this message]
2019-03-16 6:27 ` Zhiqiang Liu
2019-03-16 2:33 ` Zhiqiang Liu
2019-03-16 9:02 ` [PATCH net v3] vxlan: Don't call gro_cells_destroy() before device is unregistered Zhiqiang Liu
2019-03-19 0:08 ` David Miller
2019-03-15 18:02 ` [PATCH v2] vxlan: remove the redundant gro_cells_destroy() calling 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=20190316064507.10373066@elisabeth \
--to=sbrivio@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=idosch@mellanox.com \
--cc=liuzhiqiang26@huawei.com \
--cc=mingfangsen@huawei.com \
--cc=mousuanming@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=petrm@mellanox.com \
--cc=sd@queasysnail.net \
--cc=wangxiaogang3@huawei.com \
--cc=zhoukang7@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).