Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1242562rda; Mon, 23 Oct 2023 07:00:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFsQbR2Om9VnEFd/8QZJGABf0EMui7luVYRxaEmE+hlmqny8wcHvQoQBSOADgUAG7d/PBf8 X-Received: by 2002:a17:902:ead2:b0:1ca:7f91:aa5d with SMTP id p18-20020a170902ead200b001ca7f91aa5dmr8674806pld.16.1698069654088; Mon, 23 Oct 2023 07:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698069654; cv=none; d=google.com; s=arc-20160816; b=evnl9bH9uJ1qbHuvHGYEp8SDb1JAXp5d/yBT0or3hiLEXxI7qzrOQYxUJBLlBfQWVO EVIkktRBf2G27vumO4KuGAUg2vhvZVGhjKWODUkBnSdcAKX8OkbJ8yngLt1NgT94MmQu pG56Dntzi4s6jqhC52iVfc/ZOH1eeLekDkXVn/2b3uE1k9l7CkpKdF9CCSlZY9zIQ1So c+OoNmS6Lkit5qwbOthdZhLs25qd1UPZQ+zhHzjdjun9GdSJtBKFbHBBRlflkCrvDjlX Ao8hxmO2qRTKuEXbdD2Olnfs1kjHOhIL0pLrBelhCXtVCvaJEbTKf6RmAdaiEik6SRv5 vzGg== 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=QnAjvfjWFnCpRxuxioGHpQr5KpcVIkWFE2DSEbIq2A4=; fh=nK/B2gIzvYPsKU0sJgdKEVdz5eoE00hHt727sEimwsQ=; b=Tz+QJwOR5JgFAIvM5ln5UWhrCjHP+Oj8Fh8Dr+yHgZZQYZKjHL3Ras8NanuR+5vp1M Cb5VJa5sOLOfIUX5j3+H7b3Skqr0vg7iuk5mrKubCr6jy9jFTSmP7s0v4V4DH+/HGSpA VNZNscNwMRj0nrWTEoVze3AyENryKzMjYa0aXcg1408tfxs0F7p0+v/kgu9qgYDmaviA 61Bh0bynsOrSwDz+pgwfjVLHbTcBEg9+v6weSIyXuCNTXZa30jJq/KRDTivLEldDZkNR j6rOauP/FR/knmXzfNO7Tjjq2GnMxTu/IvpN7uSZWpmwEo6OrvJrH6KzOghJ4ULWbmbx wn5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=qpGm7DQ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id c1-20020a170902c1c100b001c7342b46e4si6141661plc.23.2023.10.23.07.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 07:00:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=qpGm7DQ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 40C5E8082CC7; Mon, 23 Oct 2023 07:00:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230449AbjJWOAW (ORCPT + 99 others); Mon, 23 Oct 2023 10:00:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231136AbjJWOAS (ORCPT ); Mon, 23 Oct 2023 10:00:18 -0400 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1710D73 for ; Mon, 23 Oct 2023 07:00:16 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 609DC240029 for ; Mon, 23 Oct 2023 16:00:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698069615; bh=Fig6sNGtNPtLEqdibiKwrPwhe4ldPvHG+L+Zwf6xQc0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=qpGm7DQ7F5jjomuPr+/Fq4TA4UceNKtt5zNG8KACUt/gWWCQh5ca7oRofj833f3ns 1HcLzNJTLA36h4OiLeGfZrMxFSS1JrGY/EM4Hom0Y93KKvUANBnV+B8AlZYG0/Nyq7 R6bAdpqL6ZfKMCbQhsj3RUkaFR6M/q+B/lKgFElW/AkZ/W6uPvp/CA1BGxG9hpLfpG c2JHS8QGRKILvD5891iRTr37j8dE0OoihV0den5o1fu1xVbBpZ2RGG1GeFzRiI3p2m 5s1cg8cGfKOKfCh2mke5k0YJ6cMdeawc8rq3XHZc55qgeoqU6ExdQ4OJOA9uJALo/7 BA+8zCZTEQ2Iw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SDcJt0HvNz6tsB; Mon, 23 Oct 2023 16:00:13 +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 v2 1/3] nvme-auth: auth success1 msg always includes resp Date: Mon, 23 Oct 2023 14:00:01 +0000 Message-Id: <20231023140003.58019-2-shiftee@posteo.net> In-Reply-To: <20231023140003.58019-1-shiftee@posteo.net> References: <20231023140003.58019-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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 07:00:35 -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 --- 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