Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2469353rda; Wed, 25 Oct 2023 03:52:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrO2FtCb/amI0XUiXbVhBMEdXNMxT7PRtrV3GTClUa4UhUCb4uXKreod+RQwi4idfcOMzk X-Received: by 2002:a25:d38d:0:b0:d9c:2a9c:3f4f with SMTP id e135-20020a25d38d000000b00d9c2a9c3f4fmr15436857ybf.62.1698231130482; Wed, 25 Oct 2023 03:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698231130; cv=none; d=google.com; s=arc-20160816; b=TM7eHz7Wpz5caMsrlLIOUY2OdLd07l+0+L+wab3WvYPvgkqxjTyYdsxnmlKj21+ntX lqCkaiu8hyAoLwbOxotB3ldU2fCKXlXkzJbRMhSXkf85n+GJlCbq6QDbSuSYg9fXon0X o/1UxlLqJcQFiiFvtcSRtZdJdgNA1fY6wjvMHTyntV9r4NzpxRib+VPYohZB1GHIJTnL jLfp3AqQMza4INumWfmIcjgtVum/fluEXyryqBOglyQ71X/s+a1y/ctMy12uix4HPWnQ KDEydgW3+XF2/v/je4K3GHq09yrWqnQcD/tJULfqLjSCpAHHNiPwwVuvXic85gU2hk0J LqQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GjqLB3n/3wM9GLzr63LISYPuPKRe45txi1u/PioJ9As=; fh=nK/B2gIzvYPsKU0sJgdKEVdz5eoE00hHt727sEimwsQ=; b=sPDJz55Gl0O4NNwasSlskGdapkScq0sDMEGZUGRQU1XN19yvdow6KmduEUxm2jd3iP 0oGfDsf1CJn5vVt01CsbqimBA3nEf8RTHmTmjlhPZXXhmbirmqnIgKX4j3KwGFLtojER wkmV4GJLbW89APqfYMprFOHod5QDBa7qCtXueO7qYyuC5in3qyY+i2Fos/YfGcEelCoB /XYutnx1tMNihlmcT0xVnIxiqwnKjDwhUzkt5XytmLcHg91ZOlGc+ollD4Ngp55Rkta/ obh871lj12cMgb/oBwzTkzFcNLqTdHfcqQY4bgHcB0l+THOdoL/6sikGNnvoupRzcMKF jz7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=fzzKsHIs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id o140-20020a25d792000000b00d9cb702cd4dsi9505022ybg.365.2023.10.25.03.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 03:52:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=fzzKsHIs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 49B9380BB216; Wed, 25 Oct 2023 03:52:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234715AbjJYKvw (ORCPT + 99 others); Wed, 25 Oct 2023 06:51:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjJYKvo (ORCPT ); Wed, 25 Oct 2023 06:51:44 -0400 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36C25AC for ; Wed, 25 Oct 2023 03:51:41 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 95331240106 for ; Wed, 25 Oct 2023 12:51:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698231098; bh=jTnT/chsOtzfuw6NmZuyV4Fm9a93YfuqFYlLWZRZY3Q=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=fzzKsHIsQKX/JSmLFfIJeoRn8YWtpU7rmdb4t43E50CthymzErREjllwxUr7GDapJ L1O5yv8kPfS1KCMDdfvOLNeCmiYnabQ69zM3uHpF2MAxMPWO4/KGmBMcV08n1z6c1H E5CytkHMvHIXBBiq8eu5zExYkJZsciwAczgZsCfe6ccS2yxeJE4iLJ+JtxqeDvWJYB LLGOJPQxXHl7IIbY5bR+/PuwpQ/W2CMfm29BnkgfnPgJ0H6Raib5xTAxommQpy7H2u yY6bTq1sCK2iGyUf57eP9v0XYKBdXUqj3qdJsUEBwLLvfBWejwR+29PKdyGb6/N902 9jfmsaRsqLZfA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SFm2J70n8z9rxH; Wed, 25 Oct 2023 12:51:36 +0200 (CEST) From: Mark O'Donovan To: linux-kernel@vger.kernel.org Cc: linux-nvme@lists.infradead.org, sagi@grimberg.me, hch@lst.de, axboe@kernel.dk, kbusch@kernel.org, hare@suse.de, Mark O'Donovan Subject: [PATCH v3 1/3] nvme-auth: auth success1 msg always includes resp Date: Wed, 25 Oct 2023 10:51:23 +0000 Message-Id: <20231025105125.134443-2-shiftee@posteo.net> In-Reply-To: <20231025105125.134443-1-shiftee@posteo.net> References: <20231025105125.134443-1-shiftee@posteo.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 25 Oct 2023 03:52:06 -0700 (PDT) In cases where RVALID is false, the response is still transmitted, but is cleared to zero. Relevant extract from the spec: Response R2, if valid (i.e., if the RVALID field is set to 01h), cleared to 0h otherwise Signed-off-by: Mark O'Donovan Reviewed-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig --- v1: used incorrect prefix nvme-tcp v2: rebase on latest git drivers/nvme/host/auth.c | 5 +---- include/linux/nvme.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c index 064592a5d546..e0fc33d41baa 100644 --- a/drivers/nvme/host/auth.c +++ b/drivers/nvme/host/auth.c @@ -339,10 +339,7 @@ static int nvme_auth_process_dhchap_success1(struct nvme_ctrl *ctrl, struct nvme_dhchap_queue_context *chap) { struct nvmf_auth_dhchap_success1_data *data = chap->buf; - size_t size = sizeof(*data); - - if (chap->s2) - size += chap->hash_len; + size_t size = sizeof(*data) + chap->hash_len; if (size > CHAP_BUF_SIZE) { chap->status = NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD; diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 26dd3f859d9d..8d8df9c15b74 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -1722,7 +1722,7 @@ struct nvmf_auth_dhchap_success1_data { __u8 rsvd2; __u8 rvalid; __u8 rsvd3[7]; - /* 'hl' bytes of response value if 'rvalid' is set */ + /* 'hl' bytes of response value */ __u8 rval[]; }; -- 2.39.2