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 5F2E1C83007 for ; Wed, 29 Apr 2020 11:51:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1FE4B2087E for ; Wed, 29 Apr 2020 11:51:12 +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="QJGlrjHM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FE4B2087E 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 A71EF8E0005; Wed, 29 Apr 2020 07:51:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A22FD8E0001; Wed, 29 Apr 2020 07:51:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9386F8E0005; Wed, 29 Apr 2020 07:51:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id 7AFBC8E0001 for ; Wed, 29 Apr 2020 07:51:11 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 348C6181AC9CB for ; Wed, 29 Apr 2020 11:51:11 +0000 (UTC) X-FDA: 76760726742.24.roll74_a513c8c78006 X-HE-Tag: roll74_a513c8c78006 X-Filterd-Recvd-Size: 3790 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 11:51:10 +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=oyKgLniimkAmkE+J7+Br+5E6UcxfwNH8Z24K+8PaK5c=; b=QJGlrjHM05z9QK4nTK+XwpPppJ GLY2OhtPISa/RpLK6Wv9WXV/bv6Yy+0F2LXB37cmdyFZi1jYeEMpDQ+2BnZxirZIz0ngTZh/WLv9j vc+02DgtYeqYh3eAaQGHL9371APsQdkvpvGtwWV1QkSWF4hVTwOfiRChb3wowVBtT0HxKz0R35BCi Xk7wP/DGxnKi37qyAZV9t1uo/kzsPVZ15kJ3l3smn6trZJ8kBotwf/BXXtYU48cLcRmUgj7SSBKDU yPfAQtxpgWut6HGiAsim95APwJ91HyBiKwaNoWba2upaqUZccOXGp1uCgAYNZ4dLwIdpIpdhc1ZCO wWrCT5tQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTlEp-0001cW-5p; Wed, 29 Apr 2020 11:50:51 +0000 Date: Wed, 29 Apr 2020 04:50:51 -0700 From: Christoph Hellwig To: Luis Chamberlain Cc: Christoph Hellwig , axboe@kernel.dk, viro@zeniv.linux.org.uk, bvanassche@acm.org, gregkh@linuxfoundation.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 v3 4/6] blktrace: fix debugfs use after free Message-ID: <20200429115051.GA27378@infradead.org> References: <20200429074627.5955-1-mcgrof@kernel.org> <20200429074627.5955-5-mcgrof@kernel.org> <20200429112637.GD21892@infradead.org> <20200429114542.GJ11244@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429114542.GJ11244@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 Wed, Apr 29, 2020 at 11:45:42AM +0000, Luis Chamberlain wrote: > On Wed, Apr 29, 2020 at 04:26:37AM -0700, Christoph Hellwig wrote: > > I can't say I'm a fan of all these long backtraces in commit logs.. > > > > > +static struct dentry *blk_debugfs_dir_register(const char *name) > > > +{ > > > + return debugfs_create_dir(name, blk_debugfs_root); > > > +} > > > > I don't think we really need this helper. > > We don't export blk_debugfs_root, didn't think we'd want to, and > since only a few scew funky drivers would use the struct gendisk > and also support BLKTRACE, I didn't think we'd want to export it > now. > > A new block private symbol namespace alright? Err, that function is static and has two callers. > > This could be simplified down to: > > > > if (bdev && bdev != bdev->bd_contains) > > return bdev->bd_part->debugfs_dir; > > return q->debugfs_dir; > > > > Given that bd_part is in __blkdev_get very near bd_contains. > > Ah neat. > > > Also given that this patch completely rewrites blk_trace_debugfs_dir is > > there any point in the previous patch? > > Still think it helps with making this patch easier to read, but I don't > care, lemme know if I should just fold it. In fact I'm not even sure we need the helper. Modulo the comment this just becomes a: if (bdev && bdev != bdev->bd_contains) dir = bdev->bd_part->debugfs_dir; else dir = q->debugfs_dir; in do_blk_trace_setup.