From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer Weikusat Subject: Re: possible circular locking dependency detected Date: Fri, 2 Sep 2016 16:18:04 +0100 Message-ID: <87lgzae3f7.fsf@doppelsaurus.mobileactivedefense.com> References: <87h99zo4d8.fsf@doppelsaurus.mobileactivedefense.com> <871t13o1n1.fsf@doppelsaurus.mobileactivedefense.com> <6f7d587b-3933-7c02-a804-db1732ced1cf@stressinduktion.org> <20160901204746.GR2356@ZenIV.linux.org.uk> <20160901210142.GS2356@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Al Viro , CAI Qian , "Miklos Szeredi" , Rainer Weikusat , Hannes Frederic Sowa , Rainer Weikusat , Eric Sandeen , Network Development To: Linus Torvalds Return-path: Received: from mail-co1nam03on0076.outbound.protection.outlook.com ([104.47.40.76]:64651 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932464AbcIBQvV (ORCPT ); Fri, 2 Sep 2016 12:51:21 -0400 In-Reply-To: (Linus Torvalds's message of "Thu, 1 Sep 2016 15:04:38 -0700") Sender: netdev-owner@vger.kernel.org List-ID: Linus Torvalds writes: > On Thu, Sep 1, 2016 at 2:43 PM, Linus Torvalds > wrote: >> On Thu, Sep 1, 2016 at 2:01 PM, Al Viro wrote: >>> >>> Outside as in "all fs activity in bind happens under it". Along with >>> assignment to ->u.addr, etc. IOW, make it the outermost lock there. >> >> Hah, yes. I misunderstood you. >> >> Yes. In fact that fixes the problem I mentioned, rather than introducing it. > > So the easiest approach would seem to be to revert commit c845acb324aa > ("af_unix: Fix splice-bind deadlock"), and then apply the lock split. > > Like the attached two patches. > > This is still *entirely* untested. As far as I can tell, this should work as I can't currently imagine why a fs operation might end up binding a unix socket despite the idea to make af_unix.c yet more complicated in order to work around irregular behaviour of (as far as I can tell) a single filesystem (for which kern_path_create doesn't really mean kern_path_create and it has to work around that once it gets control) goes against all instincts I have in this area. If filesystems need to do arbitrary stuff when __sb_start_write is called for 'their' superblock, they should be able to do so directly. At present, this is a theoretic concern as I can't (due to other work committments) put any non-cursory work into this before Sunday. There may also be other reasons why this idea is impractical or even unworkable.