Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp934017ybz; Wed, 15 Apr 2020 22:52:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJ3togShz8y7oPbJvxXB/GXHllK9L9t2YWCJDYmUStplF623cgljhFGN6J9NzEy3DkMNnQs X-Received: by 2002:a05:6402:4ce:: with SMTP id n14mr14994099edw.32.1587016361584; Wed, 15 Apr 2020 22:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587016361; cv=none; d=google.com; s=arc-20160816; b=o8cTcoCj6pMnqrjQtwRE2+1GD0CdaUGGzVafrsaZlQb2Yxk314YqvdP/GeBeAu3A92 F/mwXe9dYY+dEHhoKSHr5dA1Pdp58qIBel9k49OgDRSXvIv8s1Y8tFGDdIctkY7NiNG/ 3sTRz68KyD26aOBuwe1CyvxCNFzaKWQmxryUFSoRn7AfB/8ebJpJg7px5PrTM3h4mQVa e36tj/ychMCD1t95WXq5Bp3H6QBZvZY6u1ZCGgH3qvEXx99ttCmGrxd2HmHkFuumU8Zj XLA13EtwtO3hlwZFhjheMrM6dvR+g4ka41mj34hYu98eW9j1Qlsz9+WctkU3g6CpafMg 2ZcQ== 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=Ae5ly7M/OETZeDnJohKJkBFZBczMSVWSQhC8QwiJPZs=; b=hqiXDMU/mTyi31QgqOEsOuyj2QOWThnV+i8Ycj70NzYNQoqplnzxb9yBzl3vynkv1y C7kfDlU9fEM0GY105jLJBA1ojiSeRdWCRMEigD2AWWqA6mPH6/cz7U0ytC2oCnTAtJdg /IIfWESZ3EdqMc2L4s8gbJcuvtzvA7w1gdsEltTddQpAxR8Qe2PSPI0szxFCIUB5mSFi /a5WkUXkBJhLPU9KbV2ugPpDEpd9YBf439lcsNyxD3K5f6xEDD5goVFQGZ7vFXcYEeDv 7XTmykaqTUO7AQKm9ki7qAPzzTXec9V/cP9647q07OW6zielfw7u1KXYpPzgzXgADnKW +THg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BbnMDIAH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si11040333eda.110.2020.04.15.22.52.18; Wed, 15 Apr 2020 22:52:41 -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=@redhat.com header.s=mimecast20190719 header.b=BbnMDIAH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407243AbgDPFsp (ORCPT + 99 others); Thu, 16 Apr 2020 01:48:45 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:36590 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2407169AbgDPFsU (ORCPT ); Thu, 16 Apr 2020 01:48:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587016097; 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=BbnMDIAHKp7abEuFM5DPZp0zIXuxamuWfj/Zidk2jC+d2j205dGPAkVrQJjJQUXcNBQuGH SeG2YqUNXhzSggQvN+rNQyTYkMw8vLA+6YKdRyGaK2aL2PnF4LrpItorLRhGkk3345Qlxa ydQA9AlpHpY/5/FF+SSZxZhCJSZxNmI= 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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