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.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,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 62696C433E0 for ; Sat, 20 Jun 2020 21:18:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 18F01246C0 for ; Sat, 20 Jun 2020 21:18:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="t/Am+hFL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18F01246C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B6E978D0015; Sat, 20 Jun 2020 17:18:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B20148D0008; Sat, 20 Jun 2020 17:18:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0F4A8D0015; Sat, 20 Jun 2020 17:18:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0205.hostedemail.com [216.40.44.205]) by kanga.kvack.org (Postfix) with ESMTP id 899DD8D0008 for ; Sat, 20 Jun 2020 17:18:32 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 47C00824556B for ; Sat, 20 Jun 2020 21:18:32 +0000 (UTC) X-FDA: 76950854064.17.event82_270f74c26e24 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 16D9B180D0184 for ; Sat, 20 Jun 2020 21:18:32 +0000 (UTC) X-HE-Tag: event82_270f74c26e24 X-Filterd-Recvd-Size: 5571 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Sat, 20 Jun 2020 21:18:31 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id y17so5639241plb.8 for ; Sat, 20 Jun 2020 14:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=25eSrepyVILhrv7XgPWvBbKHc9Y423BPGYOb7vQWjWs=; b=t/Am+hFLmddRtCKiXi0HbUHiPvo3BwDUiHiS7fW1vmwLBIr+dyLNnWTKqSTGvW/t41 aK4swZ5bkA/22fovt5YvZ/ax72Zzd1mSdWWpP7CYOPx/B08WSIQExrzQEwBIIsXOUZwR KZy9FMIclUUsq55bLNqYjSGKckeCTZWE9H4m2L+qfIuGTRP2IgD5FYvo/jkbqo0n5sw/ sB7rlC0H55rGS7hVSpHlb/d1x/4N1cftR54gNfOTHHqzuSss/BnGFjGqF8tD6opKiCbT bo2AmTJwOWE5mf/K8Wa6r87Yp1loNPlH3VT1RLHmpq3LY3dw9fhJFFIDvabWlAlgD3dR H29A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=25eSrepyVILhrv7XgPWvBbKHc9Y423BPGYOb7vQWjWs=; b=IsUyvV9jmMvUz6NSvZCX4utCfkRQ7Gr6hkJfiyX1N2b/zKG23UPJ4PN9tvC+xdwF86 kHbGYTNrObGCdlVBatEgIfZzL+KRnJC1Z9tSQbUFFwY+SmDuIb3c+MQi6vRjOw8PSNMC 4IbelZHIhwXzcIgSN4KGDnTQOdc6XCNOSrENRl69NwRSZ5h/KZAHwBQs339MSOy4llHt XYaFEIkXro14V3IvuYjsHexBSDWPcdzo4GKXNEvgpVy4+Jh8/sUern6Xe+bb1a2j31Fz 3vFEc+eM1v/Rz/Rf2F7HU8yJZSyJ/daQaj6JOuedGS2BmnE2PSonzP6gpUD9uiDciJdn Xocg== X-Gm-Message-State: AOAM533/A0ck98T3S6n3EejMJevKelgk+e9fOCsEJmfEF8WP/kx+/03E pDSjVka6Qpiu1GGZPRAxhc3BEw== X-Google-Smtp-Source: ABdhPJw6HucljAEvnDkOHfNh65rF9/hxbjXXyREwSSmUNEASTpR9xRKv8GzwdP0MYN2zYK/4mRcMAQ== X-Received: by 2002:a17:90a:3b09:: with SMTP id d9mr10818806pjc.225.1592687908863; Sat, 20 Jun 2020 14:18:28 -0700 (PDT) Received: from [192.168.1.188] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id d2sm5301327pfc.1.2020.06.20.14.18.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Jun 2020 14:18:28 -0700 (PDT) Subject: Re: [PATCH v7 0/8] blktrace: fix debugfs use after free To: Luis Chamberlain , viro@zeniv.linux.org.uk, bvanassche@acm.org, gregkh@linuxfoundation.org, rostedt@goodmis.org, mingo@redhat.com, jack@suse.cz, ming.lei@redhat.com, nstange@suse.de, akpm@linux-foundation.org Cc: mhocko@suse.com, yukuai3@huawei.com, martin.petersen@oracle.com, jejb@linux.ibm.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20200619204730.26124-1-mcgrof@kernel.org> From: Jens Axboe Message-ID: <1d2ef645-9790-21b9-51bd-de7987158c78@kernel.dk> Date: Sat, 20 Jun 2020 15:18:26 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200619204730.26124-1-mcgrof@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 16D9B180D0184 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 6/19/20 2:47 PM, Luis Chamberlain wrote: > Its been a fun ride, but all patch series come to an end. My hope is > that this is it. The simplification of the fix is considerable now, > with only a few lines of code and with no data structure changes. > > We were only creating the debugfs_dir upon initialization only if > you had CONFIG_BLK_DEBUG_FS for for make_request block drivers > (multiqueue). That's where the UAF bug could happen. Folks liked > the idea of open coding the debugfs initialization even if > CONFIG_BLK_DEBUG_FS was disabled, given that debugfs code will > simply ignore that code if debugfs is disabled, but to make > the fix easier to backport, that shift is done now in another > patch. Likewise, although we were only creating the debugfs_dir > only for make_request block drivers (multiqueue), the same new > additional patch also creates the debugfs_dir for request-based > block drivers. That *begged* us to just rename the mutex to > clarify its for the debugfs_dir, blktrace then just becomes > its biggest user. > > The only patches changed here is the last one from the last series, > which actually fixed the UAF oops, and that one is now split in 3 > patches, which makes a secondary fix much clearer. > > I've waited a while to post these, to let 0-day give me its blessings, > both for Linus' tree and linux-next. No issues have been found. I've > also taken time to run blktests prior and after this series and I have > found no regressions. In fact, I think I should just extend blktests > with the break-blktrace tests, I'll do that later. > > Luis Chamberlain (8): > block: add docs for gendisk / request_queue refcount helpers > block: clarify context for refcount increment helpers > block: revert back to synchronous request_queue removal > blktrace: annotate required lock on do_blk_trace_setup() > loop: be paranoid on exit and prevent new additions / removals > blktrace: fix debugfs use after free > blktrace: ensure our debugfs dir exists > block: create the request_queue debugfs_dir on registration Applied for 5.9, thanks. -- Jens Axboe