Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp429038ybz; Wed, 29 Apr 2020 02:51:38 -0700 (PDT) X-Google-Smtp-Source: APiQypKaas8Hu36yurOL6+cfanGzGxDBVi7GHgd67L1rZgYFP7pea2Th2xzeH14y/D8q6RxsQH6s X-Received: by 2002:a05:6402:221b:: with SMTP id cq27mr1678974edb.65.1588153897963; Wed, 29 Apr 2020 02:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588153897; cv=none; d=google.com; s=arc-20160816; b=AhGEfKgn+zP1KhEYWmj94tQh2J/CZj0zodra3dsCfpxwRz7nohkETi9SyUXTOAI3UT ACbgZM8zwGavhHPiS7fJtaur8k+U3ijSxqtXccWGgIqMsQ8cKJQrOwKZsjysy6VvrEI/ ybwXZ3mk/dRywMyd2KlTNmQpkRJ5DzxaQw7xkerxVvlAZaZvKRhJIrBf+2YTEVOVxg0Z KfhP6bJ/UAnpgcr8V8fWJHUoEZH7nbMVwp9ZAjaQm/4E9sXJWhjKB79txvRC6TZFVOJJ zFSa5QRny3vBG0KyPDYneeqTbesGLasD9MkEG/zTknYOThLYto3EBk++mkny85b+9dGH yN9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=iHmtfBbzHZBUuGOZxdO1mvrcu0uITKJUD+0NGxC3Y1o=; b=Gdt+C2w0OoKxT4dgFcqUNCYnqGfO/jAMrrf0s7Pyoil/bHpfd8/AQVI5MYhUV3ovHs njV7L+S+yDYpZ2YvYz1Wv0UZ4iI/PYnrRLXGp9AYy//KqCPgEGDg0uqdpP9lAxomniTD RjXNO6oD+vnz1Tc7GH8p05fOtLPxLx1+vSQsa8OcE0rPYEnBM+UN33yAvnm6901mYmfz 1GK5I4Ddg4kyn2zCryr7USD7pzC4uJVxtsjGSKW0x++b1AkcIzTmDheX2+ledqZWcIEa exBME8aNYyd977E21raur/S31/2J0jIF+h1TKFG2b2zjC6b45ktFnPMA6fv5zOzO3H32 31ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gSoNmc4E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z70si3502128ede.463.2020.04.29.02.51.15; Wed, 29 Apr 2020 02:51:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gSoNmc4E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726575AbgD2Jrs (ORCPT + 99 others); Wed, 29 Apr 2020 05:47:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:51664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbgD2Jrs (ORCPT ); Wed, 29 Apr 2020 05:47:48 -0400 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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