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 1BB87C54FD0 for ; Fri, 24 Apr 2020 23:47:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C0328218AC for ; Fri, 24 Apr 2020 23:47:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0328218AC 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 26DC58E0005; Fri, 24 Apr 2020 19:47:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 21DD28E0003; Fri, 24 Apr 2020 19:47:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10C2B8E0005; Fri, 24 Apr 2020 19:47:45 -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 EE0088E0003 for ; Fri, 24 Apr 2020 19:47:44 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id AFEB9180AD817 for ; Fri, 24 Apr 2020 23:47:44 +0000 (UTC) X-FDA: 76744388448.10.fly28_95ddb318a80a X-HE-Tag: fly28_95ddb318a80a X-Filterd-Recvd-Size: 4054 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Fri, 24 Apr 2020 23:47:44 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id 145so5558418pfw.13 for ; Fri, 24 Apr 2020 16:47:44 -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=2TZ/4bQaQW3y9S9s+KEU9TLvqWFSpoONWW+8+xgZgBc=; b=CGgX/kZ6lW2o4RwKg15uaDhJkAM1gO++eBLLdxWlTmbDl22t7qezxL0sWHEUiy8I4Z HiK+FEc/KcUxvXZh9tfalOql9y1Z23g63DY8yKeQla4GQL1McZdbYemtiTocIvDYsX/n rPsQfD2FW24S3LiQJt9bOJTsWWe/+KtmqM/1svDoPQbZdEajFLsFeX7kP0ET73Pcf4b8 qJwW6Kx3vXRvCW4XFad64HRS3g6Uq+TSR8QxH54EWbat0VLDaZtgwh0VJX4ESTHb7K+p k1bR5/ze1IUk4I+ORLsyDCT9tNajiLW7whGuMmBIXWdUO1ulgPsUXZtqk07GkqUrvT6u snMg== X-Gm-Message-State: AGi0PuazFIQPu4cNebQe0bmfIPSRgmdcOBA5Ijq+6eae9KZaSypcWNaA WNjljwTD8u8x63nOhliVpNA= X-Google-Smtp-Source: APiQypJDXv1g6ygWuektKKutf1+iC/qYvRTcwuE+lTA64Uab9ASbCz5uzkw/u8ELL9ZSNepYT8C3SQ== X-Received: by 2002:aa7:8594:: with SMTP id w20mr12551364pfn.137.1587772063332; Fri, 24 Apr 2020 16:47:43 -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 s199sm6990029pfs.124.2020.04.24.16.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 16:47:42 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 91A6D403AB; Fri, 24 Apr 2020 23:47:41 +0000 (UTC) Date: Fri, 24 Apr 2020 23:47:41 +0000 From: Luis Chamberlain To: Ming Lei Cc: Greg KH , axboe@kernel.dk, viro@zeniv.linux.org.uk, bvanassche@acm.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 v2 03/10] blktrace: fix debugfs use after free Message-ID: <20200424234741.GE11244@42.do-not-panic.com> References: <20200419194529.4872-1-mcgrof@kernel.org> <20200419194529.4872-4-mcgrof@kernel.org> <20200420201615.GC302402@kroah.com> <20200420204156.GO11244@42.do-not-panic.com> <20200421070048.GD347130@kroah.com> <20200422072859.GQ11244@42.do-not-panic.com> <20200422094320.GH299948@T590> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200422094320.GH299948@T590> 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 Wed, Apr 22, 2020 at 05:43:20PM +0800, Ming Lei wrote: > On Wed, Apr 22, 2020 at 07:28:59AM +0000, Luis Chamberlain wrote: > > At this point in time patch-wise we still haven't reverted back to > > synchronous request_queue removal. Considering this, a race with the > > parent disappearing can happen because the request_queue removal is > > deferred, that is, the request_queue's kobject's release() call used > > schedule_work() to finish off its removal. We expect the last > > blk_put_queue() to be called at the end of blk_cleanup_queue(). Since > > Actually no, we expect that request queue is released after disk is > released. Don't forget that gendisk does hold one extra refcount of > request queue. Then by all means using blk_put_queue() from everywhere should be safe in atomic context, as we have control over that blk_put_queue() on the block layer. (Modulo, we accept the races possible today on blk_get_queue(), which I'll try to address). Luis