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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 B1E7AC2D0EC for ; Fri, 10 Apr 2020 19:58:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7BE7420801 for ; Fri, 10 Apr 2020 19:58:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BE7420801 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0D3248E005C; Fri, 10 Apr 2020 15:58:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05D268E004D; Fri, 10 Apr 2020 15:58:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E65E18E005C; Fri, 10 Apr 2020 15:58:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id CBE888E004D for ; Fri, 10 Apr 2020 15:58:09 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 83FF4181AEF2A for ; Fri, 10 Apr 2020 19:58:09 +0000 (UTC) X-FDA: 76693006698.17.coach40_644b4ca016663 X-HE-Tag: coach40_644b4ca016663 X-Filterd-Recvd-Size: 4232 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Apr 2020 19:58:09 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id u65so1463736pfb.4 for ; Fri, 10 Apr 2020 12:58:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9egYYB6bTrpDrTzttwKsxVc0B6/GRj6jRTmV+gtkQ74=; b=q0fQXLYXG2YKXTDQldtNF8JSDJuCcgUXUkK7sLPZ+bKJQwRDqwjBtkRpOis4zcXYxA lcOTqXN7+KivYTavyTSpIEmFhPJHBqjWiv55Q7k7ob8xV0rPJ9AJtTzkP40147uyCyE8 KvAipjMuAU2GpRiBvdgzPWzTTRlyG7B913m+cqBSCvuBraJ8Xvz51IvTLZW9veC3AcVA Zl6Vx7iSNBE41Zleez97dReY58pmO8ILPPFbVog6h7SMXcGBa788k1j6pPW9pG7PBXnd bkg2OIVTceNbWohrchSV93/7WmcYuhAilgnHNjOic5GrWxticb9RPFF5dI2PrRFY9lbK 00Dw== X-Gm-Message-State: AGi0PubzpZ7I9gnASSjZGYX6jj37Y0uAZ7cDBfBzRxYmThjeJwaRh7gR aLYp77k1T3Iqmj2vCJdp+Jc= X-Google-Smtp-Source: APiQypIkB3vH8LrSlvbH4JNkcEKZxJNCyG4NdBP0VvNLnRjmPqrr2Gra6b7M/BCoXvFMKaCfdh8HTg== X-Received: by 2002:aa7:97a6:: with SMTP id d6mr6824993pfq.154.1586548688133; Fri, 10 Apr 2020 12:58:08 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id q201sm2483234pfq.32.2020.04.10.12.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 12:58:05 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 12FD140630; Fri, 10 Apr 2020 19:58:05 +0000 (UTC) Date: Fri, 10 Apr 2020 19:58:05 +0000 From: Luis Chamberlain To: Bart Van Assche Cc: axboe@kernel.dk, viro@zeniv.linux.org.uk, 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: [RFC v2 2/5] blktrace: fix debugfs use after free Message-ID: <20200410195805.GM11244@42.do-not-panic.com> References: <20200409214530.2413-1-mcgrof@kernel.org> <20200409214530.2413-3-mcgrof@kernel.org> <88f94070-cd34-7435-9175-e0518a7d7db8@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <88f94070-cd34-7435-9175-e0518a7d7db8@acm.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Thu, Apr 09, 2020 at 07:52:59PM -0700, Bart Van Assche wrote: > On 2020-04-09 14:45, Luis Chamberlain wrote: > > +void blk_q_debugfs_register(struct request_queue *q) > > +{ > > + q->debugfs_dir = debugfs_create_dir(kobject_name(q->kobj.parent), > > + blk_debugfs_root); > > +} > > + > > +void blk_q_debugfs_unregister(struct request_queue *q) > > +{ > > + debugfs_remove_recursive(q->debugfs_dir); > > + q->debugfs_dir = NULL; > > +} > > There are no other functions in the block layer that start with the > prefix blk_q_. How about changing that prefix into blk_? I the first patch already introduced blk_debugfs_register(), so I have now changed the above to: blk_debugfs_common_register() blk_debugfs_common_unregister() Let me know if something else is preferred. > > -#ifdef CONFIG_BLK_DEBUG_FS > > +#ifdef CONFIG_DEBUG_FS > > struct dentry *debugfs_dir; > > +#endif > > Please add a comment above 'debugfs_dir' that it is used not only by the > code in block/blk-*debugfs.c but also by the code in > kernel/trace/blktrace.c. Otherwise this patch looks good to me. Sure, I'll do that. In the future, after this patch set I'll follow up with another series to clean that header file to make it easier to expand on proper documentaiton with kdoc. Luis