Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3407060ybb; Mon, 6 Apr 2020 08:21:44 -0700 (PDT) X-Google-Smtp-Source: APiQypL86BSd4IW5UQ7mzl6S3YPHFBz+/NLPaZpFf1QyPn3B8Giz0xk68xIHTUUfVITWepKaIzyk X-Received: by 2002:aca:b441:: with SMTP id d62mr13594182oif.107.1586186504197; Mon, 06 Apr 2020 08:21:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586186504; cv=none; d=google.com; s=arc-20160816; b=aK6uiic365CqWbZzDTAU43QzwwGv6bY8B1Th1qlZXdzZgYInzXEC5/K+rAXIydjiGc V8wTRO2yYMU9RwuUb/agAwoRJlcPYlgGaQPuc8glbTFE7Z96xo7R3SPDj5GGAjdELEXO 4dMD0pWokSDaEVV6Gax5RYOi9FmKw0J4P53fmflbJcNV8SZyRCutRuWN8QsDODuAB9Ev v4YFqk9Wks00OX0jjUc4D5SxjoXygnK0Fnz9BV7xi9aXCXBbrjCSy5zGbRQWoNFp2QKc QodPqmRIqOZKH2bPrGHbBBgf9Hv4vSJ/oEzuDL2QHyhE8nWFQAjOOu0GLaMp4r6BDKjh bYyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=aBfDok83UFCkn0X8D+fWJrmNHdBWoIO84bdn980eTHw=; b=f+yEg0cN1Md1Hhj5cIYH12/DYXogZkzT+kSZrgBxtSxxHwJQ3rLfIjTzNb2bvNQr2/ xqX6LR1D8/B3RigO9/OLPF4tn6Ps6yLpz5PzX1FeON+tMizh0EP698KLGdF1zJrPNT+m KJI2S/axwnj/lFl241cGWf4g7kfqN4UZgBnJT1Ke5zCpLMrbY5Q+uhGalRvvS1jTFQ15 f+Ok89WNYevFaXRIBtpFb0YTuafF5HdnfbAldDBu+tgvBZ9hjRXBlSVlXYDuGlbu8Aup +7XzCQ5ieD1pOBwtMxBH+vdXa9Io5Zjy3VgXyIxVoYKoWe/ZueTf9/Cpd9zLU9Z7Nj+N AOSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si8186156oou.47.2020.04.06.08.21.22; Mon, 06 Apr 2020 08:21:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728959AbgDFPTL (ORCPT + 99 others); Mon, 6 Apr 2020 11:19:11 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:33274 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728843AbgDFPTL (ORCPT ); Mon, 6 Apr 2020 11:19:11 -0400 Received: by mail-pj1-f68.google.com with SMTP id cp9so99239pjb.0; Mon, 06 Apr 2020 08:19:10 -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=aBfDok83UFCkn0X8D+fWJrmNHdBWoIO84bdn980eTHw=; b=AB40wVEXYr//GaCjwVMa2IClSM1o1poqpwK+v4mxFG7Ux4ujrsTd4ztwlz5uiRewpX jOH0owTymoAqjGpJZeuiOUdFWtuRbAPcdkUX2Y7YzNJzMdl0TO1M0PUh9Xe8MFeIgrfU JXu94cqw2SiWcGsH1as6gM06jyjUdNofD89SuqVjBZG73tGFZNO2CnqH23F+cc71bGCf gA99oAF/gV62AtnQsq9Y+73GxuowAOvHwO0A5GTqvNNYhCyHFwdTlXeyGYU48/SYuyIv r6MfPiViRLH04Fvz8cwpq4pVNXc7A/2NIq+hOduRpFQR9SRj2MKWGs9i1Kc2361fJg7m baAg== X-Gm-Message-State: AGi0PuajSse0wwTcEJvkGfqTjtYYAliJWMcwlBiY8Jk+MgkZXJEYHxCK PkeQVixmT+AaZjrI0AhH3hI= X-Received: by 2002:a17:902:b187:: with SMTP id s7mr21513465plr.84.1586186349722; Mon, 06 Apr 2020 08:19:09 -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 h10sm11187936pgf.23.2020.04.06.08.19.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 08:19:08 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id B104940246; Mon, 6 Apr 2020 15:19:07 +0000 (UTC) Date: Mon, 6 Apr 2020 15:19:07 +0000 From: Luis Chamberlain To: Nicolai Stange Cc: Bart Van Assche , Eric Sandeen , axboe@kernel.dk, viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org, rostedt@goodmis.org, mingo@redhat.com, jack@suse.cz, ming.lei@redhat.com, mhocko@suse.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Omar Sandoval , Hannes Reinecke , Michal Hocko , syzbot+603294af2d01acfdd6da@syzkaller.appspotmail.com Subject: Re: [RFC 2/3] blktrace: fix debugfs use after free Message-ID: <20200406151907.GD11244@42.do-not-panic.com> References: <20200402000002.7442-1-mcgrof@kernel.org> <20200402000002.7442-3-mcgrof@kernel.org> <3640b16b-abda-5160-301a-6a0ee67365b4@acm.org> <75aa4cff-1b90-ebd4-17a4-c1cb6d390b30@acm.org> <87d08lj7l6.fsf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d08lj7l6.fsf@suse.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 06, 2020 at 11:18:13AM +0200, Nicolai Stange wrote: > Bart Van Assche writes: > So I'd suggest to drop patch [3/3] from this series and modify this > patch [2/3] here to move the blk_q_debugfs_unregister(q) invocation from > __blk_release_queue() to blk_unregister_queue() instead. I'll take a stab. > > Additionally, I think the following changes fix that problem by using > > q->debugfs_dir in the blktrace code instead of debugfs_lookup(): > > That would fix the UAF, but !queue_is_mq() queues wouldn't get a debugfs > directory created for them by blktrace anymore? It would, it would just be done early on init as well, and it would now be shared with the queue_is_mq() case. Luis