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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 BE58CC83008 for ; Wed, 29 Apr 2020 09:47:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 828DE2082E for ; Wed, 29 Apr 2020 09:47:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="gSoNmc4E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 828DE2082E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 020258E0005; Wed, 29 Apr 2020 05:47:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F13B68E0001; Wed, 29 Apr 2020 05:47:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E27ED8E0005; Wed, 29 Apr 2020 05:47:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id C70AE8E0001 for ; Wed, 29 Apr 2020 05:47:49 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7EC64181AEF00 for ; Wed, 29 Apr 2020 09:47:49 +0000 (UTC) X-FDA: 76760415858.22.joke62_615e41211f047 X-HE-Tag: joke62_615e41211f047 X-Filterd-Recvd-Size: 3007 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 09:47:48 +0000 (UTC) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 87E7C20775; Wed, 29 Apr 2020 09:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588153668; bh=9IqOx6w1fe2TV4zs9Fg3I7y+tZugWMUZbtzlPDAhSMA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gSoNmc4Ev+QnguasjvVTtyTRsWiFGZJ7uiC1fwGw/Njo4edcob8SzCDQvfksmJjtk 8ZdA6nNEgVzqCsP23gKGiFrMtM1+sRGenzp4Sp+OHAjfSmVwcglxfdfL/e8miMTIBJ 9r3C2tVKL/c/NGxkeBs03Icq6v4YU8+ecS0xr/PY= Date: Wed, 29 Apr 2020 11:47:46 +0200 From: Greg KH To: Luis Chamberlain Cc: 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 v3 4/6] blktrace: fix debugfs use after free Message-ID: <20200429094746.GA2081185@kroah.com> References: <20200429074627.5955-1-mcgrof@kernel.org> <20200429074627.5955-5-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429074627.5955-5-mcgrof@kernel.org> 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 07:46:25AM +0000, Luis Chamberlain wrote: > --- a/block/blk-debugfs.c > +++ b/block/blk-debugfs.c > @@ -13,3 +13,32 @@ void blk_debugfs_register(void) > { > blk_debugfs_root = debugfs_create_dir("block", NULL); > } > + > +static struct dentry *blk_debugfs_dir_register(const char *name) > +{ > + return debugfs_create_dir(name, blk_debugfs_root); > +} Nit, that function is not needed at all, just spell out the call to debugfs_create_dir() in the 2 places below you call it. That will result in less lines of code overall :) > - dir = blk_trace_debugfs_dir(buts, bt); > + dir = blk_trace_debugfs_dir(bdev, q); > + if (WARN_ON(!dir)) > + goto err; With panic-on-warn you just rebooted the box, lovely :( I said previously, that if you _REALLY_ wanted to warn about this, or do something different based on the result of a debugfs call, then you can, but you need to comment the heck out of it as to why you are doing so, otherwise I'm just going to catch it in my tree-wide sweeps and end up removing it. Other than those two nits, this looks _much_ better, thanks for doing this. greg k-h