Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3535773pxb; Sat, 13 Feb 2021 00:48:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaojGGk+rfUvPdgC7k4IYoGJ+SF2ANQGPBQETbsMZE9x0qcM9kaoQK1O8jKpVEn6CB61Px X-Received: by 2002:a17:906:259a:: with SMTP id m26mr6744058ejb.399.1613206104251; Sat, 13 Feb 2021 00:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613206104; cv=none; d=google.com; s=arc-20160816; b=Xz4c4KWFzD3FfHmCm75JJO4V/u4UeMMjv9+2B01MQQ5aFofSE7XfdS63qKT9PdlMuT HzV5krwMz48f3Ys8VuZq5+WeJA0l+XnYFv9GluOVgf/JBUvh80i9aE0OO3YG1/9na74S z0XgGNtt1F4ysCcVzoCPr1hw3gof0zExZY6aUDM1jV4iJgFtb8Zw7yjsveNOIEJJIF16 5n9kbZa87fDPIqItTl2nMUB96m/PbPoGW9mpNCG85sANebi7sHsuRRt9X2smy9ANBIUL lYoQSE1A/Qd8HEwwQU6TVe9iTUIoFF3APhZVM9dy0vAFMkIaKxEk/ZBqi+iGyFBm6do9 22cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=KYHcZSKBOUebzcR4zSKCUj6mhl8OsFPlXIlgZ1AhW0g=; b=tdFdHhq0oj3Z7sn0pMJXo7/9wBIOtwZS6rWukwMsoGLI2zrnn683mkgDmWRTFZE6Wg 81skrXRuoXjxkkkT5kJqlrUO82q3fwlVQVeGXGi+uIXbf4WVTekRR3T4flZhRQCoY0jy 3Hq7wPbeEJjDqw1uJzIvX0BjCVEmM1YsUQjNieEEVFPbIGkZTRV2Z999/knHM4R8ckbA 1JxhHlcglPzHAf2hBpfDoI+j4cWLI291zI9sX199qMG8KyrtuT1qiLTVJh9POG519WxC r4YeXKhDJPeueQ3QRt0iECAl0tk8DhCx1KAb223+7gcTsmlhHakLOtjjwYDSRDrw9Dnb AMuA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si8242395edn.168.2021.02.13.00.47.59; Sat, 13 Feb 2021 00:48:24 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229592AbhBMIna (ORCPT + 99 others); Sat, 13 Feb 2021 03:43:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:60436 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbhBMIn2 (ORCPT ); Sat, 13 Feb 2021 03:43:28 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5F7D1AC32; Sat, 13 Feb 2021 08:42:47 +0000 (UTC) Subject: Re: [PATCH] nvme-tcp: Check if request has started before processing it To: Daniel Wagner , linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Sagi Grimberg , Christoph Hellwig , Jens Axboe , Keith Busch References: <20210212181738.79274-1-dwagner@suse.de> From: Hannes Reinecke Message-ID: <3f183393-cc1e-3d03-3074-40c18f3cb9cc@suse.de> Date: Sat, 13 Feb 2021 09:42:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210212181738.79274-1-dwagner@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/12/21 7:17 PM, Daniel Wagner wrote: > blk_mq_tag_to_rq() will always return a request if the command_id is > in the valid range. Check if the request has been started. If we > blindly process the request we might double complete a request which > can be fatal. > > Signed-off-by: Daniel Wagner > --- > > This patch is against nvme-5.12. > > There is one blk_mq_tag_to_rq() in nvme_tcp_recv_ddgst() which I > didn't update as I am not sure if it's also needed. > I guess it is; this patch is essentially a protection against invalid frames, and as such affects all places. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer