Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp80549iob; Tue, 17 May 2022 19:24:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNEG66vS89EJkOCk6Jq5zBVXJfbV0dxAt6ng6rOwzm28bTpb8mSZgetdFwxl0DJP9tuWyy X-Received: by 2002:a63:4a1f:0:b0:3db:aa1a:48bf with SMTP id x31-20020a634a1f000000b003dbaa1a48bfmr18749837pga.72.1652840691194; Tue, 17 May 2022 19:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652840691; cv=none; d=google.com; s=arc-20160816; b=rxHKtk94EkcsZ0h7RkgfOk3S0PjZYAlAe98SAOytY7FZXP/u3R/ndebkj7ei19AvzJ BOdAPoIdLAAaXFKHHka5JXPAMgrdJ09Cnwnz3K49OfZAF/Hu12wmOo81TnQ201KCjRmp CRC3Fs0/YLDMeWSGYQhUtiExGpGUMcJTu7uQY6KN5IdQonXJJaEsui4C2GGcz7BxEaKR xVU+G0Y0nCpaUjIYzp36BvA7NsCJVu7KqMqB64ANBD1emX1b0rerxDJDEHx1fRBuidgR pIjzMd5VyPvMgYmccNUT7ErwTL1NdMV2N90Lc2vOxm7zPmif671WVbf4NHnE737M6h9W 1iQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=0dFZ90Rm9ScYPFYt6NgL8tBOlHUxVtCERktuFWGpM6I=; b=tjtlkzazn4P91frnA8YP9Xr8sbx2hS8VIOkXPy2XGFkKBttLSSOR2uoKHyjegkVo9x c4aDItKLTOeKcaV+dzkgChNbPITkF4KRKtWj3DsVgSAeyP76HUxvqRKKKQ4pTVtDs/ZF CZnK9XeyLmiKUkG/vBFQb8ciDcH8IFmoYBsYLgba9Va/ceStcZVfhNcTkxYlidFOyOz+ nL6Vq72QFL/guWeojw5j4YfE/K2vyr/taAeUFRIyy+X0jZgqDBj1/Ej46kq5UcbrYFTZ q8HokfvP7h4qrvV83isOmb7HUSToBMsExWRBPd1dvD7fm/u7352D+v6D4tmA0768Tc3C eHoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j190-20020a636ec7000000b003f5ccb1a239si858438pgc.113.2022.05.17.19.24.19; Tue, 17 May 2022 19:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232012AbiERAjY (ORCPT + 99 others); Tue, 17 May 2022 20:39:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232654AbiERAjU (ORCPT ); Tue, 17 May 2022 20:39:20 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FBBE36E0C; Tue, 17 May 2022 17:39:18 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L2vGW4rrtzgYCj; Wed, 18 May 2022 08:37:55 +0800 (CST) Received: from dggpemm500004.china.huawei.com (7.185.36.219) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 18 May 2022 08:39:16 +0800 Received: from [10.174.177.69] (10.174.177.69) by dggpemm500004.china.huawei.com (7.185.36.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 18 May 2022 08:39:16 +0800 Message-ID: <356ba1b6-7979-a767-2501-0a96b653c860@huawei.com> Date: Wed, 18 May 2022 08:39:16 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH -next v2] blk-throttle: Set BIO_THROTTLED when bio has been throttled To: Jens Axboe CC: , , , , Ming Lei References: <20220301123919.2381579-1-qiulaibin@huawei.com> From: QiuLaibin In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.69] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500004.china.huawei.com (7.185.36.219) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org friendly ping.... 在 2022/3/2 21:51, Ming Lei 写道: > On Tue, Mar 01, 2022 at 08:39:19PM +0800, Laibin Qiu wrote: >> 1.In current process, all bio will set the BIO_THROTTLED flag >> after __blk_throtl_bio(). >> >> 2.If bio needs to be throttled, it will start the timer and >> stop submit bio directly. Bio will submit in >> blk_throtl_dispatch_work_fn() when the timer expires.But in >> the current process, if bio is throttled. The BIO_THROTTLED >> will be set to bio after timer start. If the bio has been >> completed, it may cause use-after-free blow. >> >> BUG: KASAN: use-after-free in blk_throtl_bio+0x12f0/0x2c70 >> Read of size 2 at addr ffff88801b8902d4 by task fio/26380 > > After the queue lock is released, the bio can be dispatched & completed, > so it shouldn't be touched after lock release: > > Reviewed-by: Ming Lei > > Thanks, > Ming > > .