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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 7FB68C433DB for ; Mon, 15 Feb 2021 10:49:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DFBE64E34 for ; Mon, 15 Feb 2021 10:49:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbhBOKtv (ORCPT ); Mon, 15 Feb 2021 05:49:51 -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.