From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67B53C5518C for ; Wed, 22 Apr 2020 07:30:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 21940206A1 for ; Wed, 22 Apr 2020 07:30:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="s7u78fW9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21940206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C84098E0006; Wed, 22 Apr 2020 03:30:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C59638E0003; Wed, 22 Apr 2020 03:30:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B971C8E0006; Wed, 22 Apr 2020 03:30:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id A1CB58E0003 for ; Wed, 22 Apr 2020 03:30:03 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 678C34DBC for ; Wed, 22 Apr 2020 07:30:03 +0000 (UTC) X-FDA: 76734667086.25.boy85_57c2c582d5807 X-HE-Tag: boy85_57c2c582d5807 X-Filterd-Recvd-Size: 3149 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Wed, 22 Apr 2020 07:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5cVmyOjgumSARbZn4H6K6b40Zl/grVWVzKEi+V2Sn5o=; b=s7u78fW9AIC121y/gwJInXjgts xeKqGqc6q2u6w+gdV/7xfa0ndbM09QQqG2q97ouH1DduCn6eSgGCZAExg0On9/O7zBwzQMRUttqol QKvRti9jABJjMzc/KsWtpiq0JKcUoiErFDaJ0rnOYKKrtl7SgWXtAI5r/IQ1I1gS4rkjolsUkQXRr mJsgvEAM5ePZBELt4pstUI4ppFhBsgITDj1T0sFZkOr0+bMXjoCGmzMgykF0Yekeq+J7UpYDf30bO JW4t7/mGmV0NUo3S2RY90apIrLYamJQrS3fJVJskmKcWbQoEGGSuMem0WXYtl9ZEzYOCH+PZArUpd nThtTpqg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jR9pG-0000tj-Nu; Wed, 22 Apr 2020 07:29:42 +0000 Date: Wed, 22 Apr 2020 00:29:42 -0700 From: Christoph Hellwig To: Luis Chamberlain Cc: Greg KH , axboe@kernel.dk, viro@zeniv.linux.org.uk, bvanassche@acm.org, rostedt@goodmis.org, mingo@redhat.com, jack@suse.cz, ming.lei@redhat.com, nstange@suse.de, akpm@linux-foundation.org, mhocko@suse.com, yukuai3@huawei.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Omar Sandoval , Hannes Reinecke , Michal Hocko , syzbot+603294af2d01acfdd6da@syzkaller.appspotmail.com Subject: Re: [PATCH v2 03/10] blktrace: fix debugfs use after free Message-ID: <20200422072942.GD19116@infradead.org> References: <20200419194529.4872-1-mcgrof@kernel.org> <20200419194529.4872-4-mcgrof@kernel.org> <20200420201615.GC302402@kroah.com> <20200420204156.GO11244@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200420204156.GO11244@42.do-not-panic.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Apr 20, 2020 at 08:41:56PM +0000, Luis Chamberlain wrote: > Its already there. And yes, after my changes it is technically possible > to just re-use it directly. But this is complicated by a few things. One > is that at this point in time, asynchronous request_queue removal is > still possible, and so a race was exposed where a requeust_queue may be > lingering but its old device is gone. That race is fixed by reverting us > back to synchronous request_queue removal, therefore ensuring that the > debugfs dir exists so long as the device does. > > I can remove the debugfs_lookup() *after* we revert to synchronous > request_queue removal, or we just re-order the patches so that the > revert happens first. That should simplify this patch. Yes, please move the synchronous removal first instead of working around the current problems.