Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4845768pxb; Mon, 15 Feb 2021 02:50:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkk6V8iOdAlu2POOiejpMa6jrJqa0aPVb28fpOGIDMOwgFSlnvueM6seksRVEN4lvAFSM0 X-Received: by 2002:a50:bf42:: with SMTP id g2mr14904058edk.101.1613386245428; Mon, 15 Feb 2021 02:50:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613386245; cv=none; d=google.com; s=arc-20160816; b=tVdFGYLdNxqE/6AEuvl5zUyfvFOAktiLFz+L8CIPWMpu+XN30j1IE5XxxR6os8B7I3 6/uHAojdZJ3Anv4cvI893ET4sDWAX9hQJYleHqAh1E6zAJTdsVXtf0mpPPYKyyeKffqI 62j0gepSTuAoUtRIA4oZJvmjJqPhhfL/vtYqUZ8vSSk8VEkTEaz/BaUXylDYTdAEL3rx jteM/HrLx5dI/9o8vMUvBxuNfkG93PJGv4yWDpB+DXsZwa11kWGnY7MYnkU8A5VXAYm7 1GonksnOtLo0IhxbgnbiKGc+ijFW+D4vPH4EHyR7XhWiEBd/myeO9UJEw5fSmOehCahO CdJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=x7OLhMQD6FbVb+VYiQOhhCYoucizDtDtBZQlbi146gQ=; b=RI1Pwd3smlE3q0OT/4D6cU7oLbRCMvDeGLangg0K8bvsV10tEe1sBAmpy2GQTgqm+f +8oKcJ4Y0akGcCI7+RPTOeZwBu6AxX3z57ib8vGjPr93MfoXRyib6z/lT/ohGN1hjapS youwevVoHC8yy765DmGckb4bLcPwJsJiyHluXa9omTJD6ioLdTddrfGcrSAt9V4UiRWn YP1BFDR1o3gH6GuW5S55tDsA6qswEOMveAt/SPp331XFGhKMeKrrJCsFp2WFaeQXchCG pGqXwxdvKQFQ4dfqL7Uw3wrlx3uGhj/z/yIWO/D17NE3XRmPUi8YbAp8R3bzDIcBekfy 0aJA== 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 c10si12196840ejf.281.2021.02.15.02.50.22; Mon, 15 Feb 2021 02:50:45 -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 S230248AbhBOKtj (ORCPT + 99 others); Mon, 15 Feb 2021 05:49:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:45298 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230334AbhBOKlB (ORCPT ); Mon, 15 Feb 2021 05:41:01 -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 8F854AC32; Mon, 15 Feb 2021 10:40:20 +0000 (UTC) Date: Mon, 15 Feb 2021 11:40:20 +0100 From: Daniel Wagner To: Hannes Reinecke Cc: Sagi Grimberg , Keith Busch , Jens Axboe , Christoph Hellwig , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvme-tcp: Check if request has started before processing it Message-ID: <20210215104020.yyithlo2hkxqvguj@beryllium.lan> References: <20210212181738.79274-1-dwagner@suse.de> <20210212210929.GA3851@redsun51.ssa.fujisawa.hgst.com> <73e4914e-f867-c899-954d-4b61ae2b4c33@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73e4914e-f867-c899-954d-4b61ae2b4c33@suse.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 13, 2021 at 09:46:41AM +0100, Hannes Reinecke wrote: > On 2/12/21 10:49 PM, Sagi Grimberg 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. > > > > > > > > How did you get to this one? did the controller send a completion for > > > > a completed/bogus request? > > > > > > If that is the case, then that must mean it's possible the driver could > > > have started the command id just before the bogus completion check. Data > > > iorruption, right? 'during TCP LIF toggles and aggr relocates' testing the host crashes. TBH, I do not really know what is happening or what the test does. Still trying to figure out what's going on. I was just very surprised how much the code trusts the other side to behave correctly. > > Yes, which is why I don't think this check is very useful.. > > I actually view that as a valid protection against spoofed frames. > Without it it's easy to crash the machine by injecting fake completions with > random command ids. In this test scenario it's not even a spoofed frame; maybe just a confused controller.