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.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 73C14C2BA2B for ; Thu, 16 Apr 2020 05:48:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3ABA3214AF for ; Thu, 16 Apr 2020 05:48:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IUglMyDj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3ABA3214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9968A8E0083; Thu, 16 Apr 2020 01:48:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 946C88E0001; Thu, 16 Apr 2020 01:48:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85C368E0083; Thu, 16 Apr 2020 01:48:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0214.hostedemail.com [216.40.44.214]) by kanga.kvack.org (Postfix) with ESMTP id 6BE578E0001 for ; Thu, 16 Apr 2020 01:48:17 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1ECDB611F for ; Thu, 16 Apr 2020 05:48:17 +0000 (UTC) X-FDA: 76712637834.11.top92_e0e5184e985e X-HE-Tag: top92_e0e5184e985e X-Filterd-Recvd-Size: 3833 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Apr 2020 05:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587016096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ae5ly7M/OETZeDnJohKJkBFZBczMSVWSQhC8QwiJPZs=; b=IUglMyDj1DGq5laWrc8SNijx3dAuAgXQGv2BQ+zI5fJ/twzfYaftY1CwE9eOmeIBTqs8hx hNPU9A7KkBlr2xH/vEkVFP1n8CzR1AMhyKPpw8gGPkZAgLu/Z/AoDeVKgfPONLlI22RaZT MWqH30d/QiWsskp990ZD8w+S4eKGEFo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-y0juUd9SPm6Dr1B_bF4zJA-1; Thu, 16 Apr 2020 01:48:13 -0400 X-MC-Unique: y0juUd9SPm6Dr1B_bF4zJA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 09D7B801A09; Thu, 16 Apr 2020 05:48:11 +0000 (UTC) Received: from T590 (ovpn-8-29.pek2.redhat.com [10.72.8.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED6405C1C5; Thu, 16 Apr 2020 05:47:55 +0000 (UTC) Date: Thu, 16 Apr 2020 13:47:50 +0800 From: Ming Lei To: Luis Chamberlain Cc: axboe@kernel.dk, viro@zeniv.linux.org.uk, bvanassche@acm.org, gregkh@linuxfoundation.org, rostedt@goodmis.org, mingo@redhat.com, jack@suse.cz, 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 2/5] blktrace: fix debugfs use after free Message-ID: <20200416054750.GA2723777@T590> References: <20200414041902.16769-1-mcgrof@kernel.org> <20200414041902.16769-3-mcgrof@kernel.org> <20200416021036.GA2717677@T590> <20200416052524.GH11244@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200416052524.GH11244@42.do-not-panic.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 16, 2020 at 05:25:24AM +0000, Luis Chamberlain wrote: > On Thu, Apr 16, 2020 at 10:10:36AM +0800, Ming Lei wrote: > > In theory, multiple partitions can be traced concurrently, but looks > > it never works, so it won't cause trouble for multiple partition trace. > > > > One userspace visible change is that blktrace debugfs dir name is switched > > to disk name from partition name in case of partition trace, will it > > break some utilities? > > How is this possible, its not clear to me, we go from: > > - q->debugfs_dir = debugfs_create_dir(kobject_name(q->kobj.parent), > - blk_debugfs_root); > > To this: > > + q->debugfs_dir = debugfs_create_dir(kobject_name(q->kobj.parent), > + blk_debugfs_root); > > > Maybe I am overlooking something. Your patch removes the blktrace debugfs dir: do_blk_trace_setup() - dir = debugfs_lookup(buts->name, blk_debugfs_root); - if (!dir) - bt->dir = dir = debugfs_create_dir(buts->name, blk_debugfs_root); - Then create blktrace attributes under the dir of q->debugfs_dir. However, buts->name could be one partition device name, but q->debugfs_dir has to be disk name. This change is visible to blktrace utilities. Thanks, Ming