[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200429094746.GA2081185@kroah.com>
Date: Wed, 29 Apr 2020 11:47:46 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: axboe@...nel.dk, viro@...iv.linux.org.uk, bvanassche@....org,
rostedt@...dmis.org, mingo@...hat.com, jack@...e.cz,
ming.lei@...hat.com, nstange@...e.de, akpm@...ux-foundation.org,
mhocko@...e.com, yukuai3@...wei.com, linux-block@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Omar Sandoval <osandov@...com>,
Hannes Reinecke <hare@...e.com>,
Michal Hocko <mhocko@...nel.org>,
syzbot+603294af2d01acfdd6da@...kaller.appspotmail.com
Subject: Re: [PATCH v3 4/6] blktrace: fix debugfs use after free
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
Powered by blists - more mailing lists