From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shards.monkeyblade.net ([184.105.139.130]:59310 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751825AbeCVSlh (ORCPT ); Thu, 22 Mar 2018 14:41:37 -0400 Date: Thu, 22 Mar 2018 14:41:34 -0400 (EDT) Message-Id: <20180322.144134.17715767505857944.davem@davemloft.net> To: ktkhai@virtuozzo.com Cc: yoshfuji@linux-ipv6.org, edumazet@google.com, yanhaishuang@cmss.chinamobile.com, nikolay@cumulusnetworks.com, yotamg@mellanox.com, soheil@google.com, avagin@virtuozzo.com, nicolas.dichtel@6wind.com, ebiederm@xmission.com, fw@strlen.de, roman.kapl@sysgo.com, netdev@vger.kernel.org, xiyou.wangcong@gmail.com, dvyukov@google.com, andreyknvl@google.com, lkp@intel.com Subject: Re: [PATCH net-next v2 2/5] net: Revert "ipv4: fix a deadlock in ip_ra_control" From: David Miller In-Reply-To: <41aba98d-6e38-0789-f562-4eada70a84b6@virtuozzo.com> References: <152145089432.7718.3981942805167545803.stgit@localhost.localdomain> <20180320.122305.1801176841938756457.davem@davemloft.net> <41aba98d-6e38-0789-f562-4eada70a84b6@virtuozzo.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: From: Kirill Tkhai Date: Tue, 20 Mar 2018 22:25:35 +0300 > On 20.03.2018 19:23, David Miller wrote: >> From: Kirill Tkhai >> Date: Mon, 19 Mar 2018 12:14:54 +0300 >> >>> This reverts commit 1215e51edad1. >>> Since raw_close() is used on every RAW socket destruction, >>> the changes made by 1215e51edad1 scale sadly. This clearly >>> seen on endless unshare(CLONE_NEWNET) test, and cleanup_net() >>> kwork spends a lot of time waiting for rtnl_lock() introduced >>> by this commit. >>> >>> Next patches in series will rework this in another way, >>> so now we revert 1215e51edad1. Also, it doesn't seen >>> mrtsock_destruct() takes sk_lock, and the comment to the commit >>> does not show the actual stack dump. So, there is a question >>> did we really need in it. >>> >>> Signed-off-by: Kirill Tkhai >> >> Kirill, I think the commit you are reverting is legitimate. >> >> The IP_RAW_CONTROL path has an ABBA deadlock with other paths once >> you revert this, so you are reintroducing a bug. > > The talk is about IP_ROUTER_ALERT, I assume there is just an erratum. My bad, I did indeed mean IP_ROUTER_ALERT. >> All code paths that must take both RTNL and the socket lock must >> do them in the same order. And that order is RTNL then socket >> lock. > > The place I change in this patch is IP_ROUTER_ALERT. There is only > a call of ip_ra_control(), while this function does not need socket > lock. Please, see next patch. It moves this ip_ra_control() out > of socket lock. And it fixes the problem pointed in reverted patch > in another way. So, if there is ABBA, after next patch it becomes > solved. Does this mean I have to merge [2/5] and [3/5] together? Yes, that is what should happen, because the revert by itself reintroduces the potential ABBA deadlock between the socket lock and the RTNL mutex. I'll take a look at the new version of your series. Thank you.