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 1FC72C55189 for ; Wed, 22 Apr 2020 07:30:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD44B206A1 for ; Wed, 22 Apr 2020 07:30:02 +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" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726090AbgDVHaC (ORCPT ); Wed, 22 Apr 2020 03:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726066AbgDVHaB (ORCPT ); Wed, 22 Apr 2020 03:30:01 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6405C03C1A6; Wed, 22 Apr 2020 00:30:01 -0700 (PDT) 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 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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.