From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC564606A339 for ; Tue, 1 Dec 2026 11:29:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=GdcjYiS6; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=j+OeZYaI DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=2W3MVfdPSSdbN43H9coNlciJDA/QjymUCPpvcK+ZQU4=; b=GdcjYiS6wncrXi R/FQoISlyngyGcGQ1LebA28SyusAZzKNViy95WR+piKWSJ3VHQdW/GoDqi1/KSXXFYaoZtuMuvcBG 04NYkfsSql2FMKRnCslFIfVjaWNZqpwAy0BWQN5EZStU59h9CPMIHOc2qIDOULqLTkkRszxve5/d7 V7eaknJizP5goFCHHM11XgVG3geXEGbIOZ01C2b2EDfLiZsM+Ws7Ik9BTjGFoWvB5fanoi6EENvVK UA7R1VFVhKVsswTXu/LYmCSSipmtO3DHPYlx8MutEOgp5RgWgdCzg/8hLJugrUFLy3UbG1jPWmEBP j+75RQdOerT/FlBzRuzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYM2n-00000007alA-2SLN; Tue, 01 Dec 2026 11:29:09 +0000 Received: from mail-yx2-x07.google.com ([2607:f8b0:4864:41::7]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYM1i-00000007aFU-3VW8 for linux-nvme@lists.infradead.org; Tue, 01 Dec 2026 11:28:46 +0000 Received: by mail-yx2-x07.google.com with SMTP id 956f58d0204a3-67da3aca3b8so5973237d50.1 for ; Tue, 01 Dec 2026 03:28:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796124481; x=1796729281; darn=lists.infradead.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2W3MVfdPSSdbN43H9coNlciJDA/QjymUCPpvcK+ZQU4=; b=j+OeZYaIYl6U2ACnbMZL8ThAzkHSPQw4hjsKq8TndXJBTa3kcTq8IKF9XTnDTnn+r5 fprn9UKv0cTIoQ0copo2l4oKLWeCFXRmBLAfpUdWs9DsaWsHYYhcfWyziwccLf/6MGSn Tr5bvQayl70sqXjtg0+gtA5bDDrUOFR8iuzkN+DtOK4MXxxPbcKBlIjG6zDNIm7r/6Tn BC+mCt1nBFlpnVj1vS+skCUW4WaONLrx7ZeKRXGeXZ7xiSlH+GEPbG0EJtJ/x/52MuOy VgWK3OnJ0bgBIlN6g7f/nzwYqn+9lNt2QmHWtiMj3wFLfk3rJKeHDqeCL2o3jo74FfHs kqpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796124481; x=1796729281; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=2W3MVfdPSSdbN43H9coN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eZt8MiztpgrxjgAEvvbG irxfyICIlDtOCN2oApu4RCXkqDv6ChV6ML0= X-Received: by 2002:a05:690e:4505:10b0:67d:be72:879b with SMTP id 956f58d0204a3-67df44c230emr11769299d50.81.1796124481076; Tue, 01 Dec 2026 03:28:01 -0800 (PST) Received: from [10.0.0.48] ([71.69.222.122]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-67df3378f59sm15828464d50.14.2026.12.01.03.27.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 03:28:00 -0800 (PST) Message-ID: <92bd7230-87cf-42e6-91ba-05e62bd6f2e5@gmail.com> Date: Tue, 1 Dec 2026 06:27:59 -0500 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 09/14] nvme: allow to pass in key description as dhchap secret To: Hannes Reinecke , Hannes Reinecke , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Eric Biggers , David Howells , Jarkko Sakkinen , Jonathan Corbet , Shuah Khan , Randy Dunlap , Kees Cook , "Gustavo A. R. Silva" Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, keyrings@vger.kernel.org, linux-doc@vger.kernel.org, linux-hardening@vger.kernel.org References: <20261126-dhchap-keyring-v4-v7-0-ee438ffea527@kernel.org> <20261126-dhchap-keyring-v4-v7-9-ee438ffea527@kernel.org> <17a445a0-16ef-452e-a174-5bb09940d3fc@gmail.com> <2900913f-d7b2-418f-9a1d-4c7c5c8879a6@suse.de> Content-Language: en-US From: Martin Belanger In-Reply-To: <2900913f-d7b2-418f-9a1d-4c7c5c8879a6@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_032803_177058_2D1B7D21 X-CRM114-Status: GOOD ( 22.17 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 12/1/26 05:21, Hannes Reinecke wrote: > We have been there before with the TLS keys, and found that using > serial numbers to identify keys is really a bad idea if you want > to store it in a configuration file. Agreed, and I did not mean that. A serial cannot go into a configuration file. It changes each time a key is added to the keyring. The configuration holds the key description. > And there's an additional attribute dhchap_key and dhchap_ctrl_key > which will display the key serial. You are right, v7 already has them, and I missed them. libnvme can use the presence of this attribute to detect keyring support. That is all it needs. For everything else, the description that dhchap_secret shows for a pre-provisioned key is enough, because the kernel accepts it on connect. On the names: I would still prefer kxchap_key and kxchap_ctrl_key. These attributes are new ABI. Base 2.4 renamed DH-HMAC-CHAP to KX-HMAC-CHAP because the key exchange is no longer only Diffie-Hellman (ML-KEM). The same key is used with any of these key exchanges. Also, nvmet configfs already has a dhchap_key attribute, and there it holds the secret. A host attribute with the same name that shows a serial would be confusing. The existing attributes keep their names. > To honour you original request of not allowing to rotate > pre-provisioned keys we could return -EBUSY (-EINVAL?) > when someone writes to dhchap_secret / dhchap_ctrl_secret > of a pre-provisioned key, and allow writes to dhchap_key / > dhchap_ctrl_key for pre-provisioned keys. My request was a little different. A pre-provisioned key should be rotated in the keyring: keyctl update changes the payload, the serial stays the same, and the next authentication uses the new key. I would like that to be the only way to change such a key. So I would prefer kxchap_key and kxchap_ctrl_key to stay read-only, as in v7. A write can be added later if someone needs it. Once it is released, it cannot be removed. Returning -EBUSY on a write to dhchap_secret for a pre-provisioned key is fine with me. libnvme only reads that attribute. Martin