Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5235558pxb; Mon, 15 Feb 2021 13:34:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUwVfoHpvUrKYK8rrdWTzbO2o44lUqhwFei8UnV1bg/goNrP947uFWe074Y7FJm2OCeXxT X-Received: by 2002:a17:906:c0c9:: with SMTP id bn9mr17753520ejb.318.1613424844810; Mon, 15 Feb 2021 13:34:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613424844; cv=none; d=google.com; s=arc-20160816; b=p1w96zyicPtyO13JhFIJ5731CzazRJAFC5USXI+HAh5+1JDgRe464jndpF06BHZ4aX c+AswwjuWITbf/0Jf5rBj1ytj2JotMXq60muO0fv7vE4n+y4c56V4CY70Bol/MQk4+oF QPvj5aT2gtTn0YjxAcNt007n5wpem91IPpq43KRHPRiXtGCMfxC0wRN96S3HBRextOl4 faU1imGr//76a5hTJ8EB2Lw4KX+SUlXnNj52j8lv3f2g6I5Xs3DlVyffDKZi77rx6Xm5 FLvg9Mem2Y1FUNDCq41j38gwZHtiq1zOB4NgV930mWRr/NbvTWhXiHuaWsDr1DRSvxeC FX6w== 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=s+MKjbp2tjims7Jwguvyk6qEwa7KWs9qt/eX8yJuFUE=; b=cLZRTFljp7zLslnqubfsizC2vnyFmAH4Uo4bC1WAIRAiAZHu5NgNEFTqY9LOXHo30d uJVax4iPwd9yoLqcY3FpiUUu/yeZiR+wnOoGHyAzi8sQvmcCqdwpCPToxkg8sSGDC/85 Vs3M4jlQUJFIs2euKaEpEX472EpmlFeLpLviWW/cL9RO9iaJ7tGlch/cH/hUGYch5gYs 4ay9NswT8qu+cAWQvogdvZhJ1sIMSWAir8HN0WbzzYIQ0kkqWumF3oo8wIgfhitTsGTd ulSY2EIvZ6ySwqGXwFPJivS6TLstGSLuQmkyobNsYWv2DunjF6Sdpul01ebDJj+mONa4 jaZw== 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 dk15si12659090edb.468.2021.02.15.13.33.41; Mon, 15 Feb 2021 13:34:04 -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 S229697AbhBOVah (ORCPT + 99 others); Mon, 15 Feb 2021 16:30:37 -0500 Received: from mail-wr1-f42.google.com ([209.85.221.42]:45867 "EHLO mail-wr1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbhBOVac (ORCPT ); Mon, 15 Feb 2021 16:30:32 -0500 Received: by mail-wr1-f42.google.com with SMTP id v7so10696402wrr.12 for ; Mon, 15 Feb 2021 13:30:15 -0800 (PST) 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=s+MKjbp2tjims7Jwguvyk6qEwa7KWs9qt/eX8yJuFUE=; b=ZSOS2NemZMqK+M8G72ADkXCW/4E7keqsLjN+CDUezcEw+vOOUQRjQyP8KmXa69C49R buOKbMOiYky0eRebAOK5VCYrMABBA0u7jizL4rBdJzEFwBERaxGMdo0TNjTIXgoNpN7f r6CmaT8khKnBVhXbv7a0SKFQX3qR9TVgKgZxMdrXrREpTfJJNJlkeHqo4KaIAlAv5RVj RjLpvIS+ZpOGyaBA5ScWTcEP+0B1XUwxJ9QWR/FhNLcK3MqW0S9LX57NrAP1zX/VEVnj xxRDKXOjPLKaygS0JzfMYKpWhhT/ucCMYeiHUl/SjpRkpRzDUGPL+lNuvMFLePuAhRgV P5FA== X-Gm-Message-State: AOAM531FVcumLswM6VkWtgi4b6X1q7is4O8IbeuiKp2VtlJaLUilA5WW OffPSuU9CM+2c1VgaUBzGo9z7u5Ak2E= X-Received: by 2002:a5d:4e41:: with SMTP id r1mr16045804wrt.6.1613424589846; Mon, 15 Feb 2021 13:29:49 -0800 (PST) Received: from ?IPv6:2601:647:4802:9070:e348:9c6c:4cb7:8321? ([2601:647:4802:9070:e348:9c6c:4cb7:8321]) by smtp.gmail.com with ESMTPSA id j71sm615134wmj.31.2021.02.15.13.29.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Feb 2021 13:29:49 -0800 (PST) Subject: Re: [PATCH] nvme-tcp: Check if request has started before processing it To: Daniel Wagner , Hannes Reinecke Cc: Keith Busch , Jens Axboe , Christoph Hellwig , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org References: <20210212181738.79274-1-dwagner@suse.de> <20210212210929.GA3851@redsun51.ssa.fujisawa.hgst.com> <73e4914e-f867-c899-954d-4b61ae2b4c33@suse.de> <20210215104020.yyithlo2hkxqvguj@beryllium.lan> From: Sagi Grimberg Message-ID: Date: Mon, 15 Feb 2021 13:29:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210215104020.yyithlo2hkxqvguj@beryllium.lan> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>>>> 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. Well, I think we should probably figure out why that is happening first. > I was just very > surprised how much the code trusts the other side to behave correctly./ What does pci/rdma/fc does differently? What does scsi do here? >>> 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. Maybe... I am still not sure how this patch helps here though...