From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.224.139 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796124482; b=aTp7Q/UYobjeL6eGIUeDOX2nYjpGJxQ288oT6oo7nCG3UJBUY63ap3kWkTrgTbu6I3Xb 5jD6PL+jiwRT2WAj4tIdbcnuLGmLhhdtQHgKONSWBNnL7llMbOn8hIaMUF95mlSrirePx 4mH7nlvwdPRtQnvteXDm58FyEZwDPMlGpEUFCW1fyMsDl6+kJeIWS+7/BLZvYu2Wl/zRh NR1Pt5jMBkrRpB0JY6PQbnmIuh3/IJNwLi4/h0y4dDXkW4EcCH4XEPyE/q6nh5Od8xcYI C9YwrLBUPrWPQh1tDoRQUO7MpkoDgd7RtTzIZrTMJqMqVtrDAMZDFOmv0AUdxTvFwUg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796124482; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=2W3MVfdPSSdbN43H9coNlciJDA/QjymUCPpvcK+ZQU4=; b=J3WgOLO1ImAO/7neqz0yjVN6hymTHIdgyKC6h7Xx/OW/42XeekLHJQ6ndJBKzysPnyW6 +aj1BEgbhJTsHRuFfPvxHFD14OeMxuZCG9+9OfWW1HIucIi0uWcFxmCN0CtrPaY9rOw1z r71kNteBY1y07t9r8cCnsj4nIaN/DuZS5VlDF0ldikjTHgyGI1GX08qxJRQBGh2twl8pQ DGtaMlLDY+rjPJ/x8PiOP29ZfmAgyhNc9/qKy8oqZQk/De6QnI+Dk3Doxyn/buXatc3Ay C465dnefHU0duUY+49r+s1zfRCepNVKerFYRfxij6RCRqcuaF11pmtFG0rh4yPmSIYA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Qe6dMndK; arc=none smtp.remote-ip=74.125.224.139 Received: from mail-yx2-f11.google.com (mail-yx2-f11.google.com [74.125.224.139]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 057D9606A31A for ; Tue, 1 Dec 2026 11:28:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 057D9606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Qe6dMndK Received: by mail-yx2-f11.google.com with SMTP id 956f58d0204a3-67da3aca3b8so5973232d50.1 for ; Tue, 01 Dec 2026 03:28:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796124481; x=1796729281; darn=vger.kernel.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=Qe6dMndKInoSNAPkXogt3Q3MHc4/W+RvtuWjcXh3KZikJrL7ULZp6vRXAVuNPRD3n/ HiJu9u53jFwf9sX2NIMgS/MAYAquryaEFN42KAQdQDftOLzZq3tIXL6kIt2V6ROxgBef NcsXhlBFah2GokyXr/9V3y8gBhZILgMkJpDKub0gBlxqZSFXUR/64YCRf3ccHqyKzmlp JwY8GuLkS/sF9/9TYYMP75ZurNGzDEWnV9H3XrkVkVP70wdPREortRqWMvwoWMEpgiIz 46VX0NUmEmiKpgk5VNxlEq3BU5oM7tjYBhxDGhuqoHkDfMrXAPVniaNnJG+UC+xJv6K/ GhjQ== 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=2W3MVfdPSSdbN43H9coNlciJDA/QjymUCPpvcK+ZQU4=; b=tSDLK+vvW8bqI489x1GMFtKgc1nUJEtv5loerzbmGHQSJc9dIdPSuzuIZM6K17wWXc b0d7nsMllYMumCxR34bO4Cl99Y4aFsrOHLO7Z1bnqBHvwfvpLLyqWLNCjrIewkI8631R yHdHm61bJNtKulA13ozHMTqa0uKHxTMpAO6xdpbP6trlQbX3OJs22ZipAXSt+BSp7p6Q 5vdnC9BQ674KrtfuRbnR8OrrzJXPBJSkn33lP6h30ia6FwpwyElcIIAdYCp48RsIayJR b4ayq+bA/u3J1iKPOIEVz+MEFzF44HRXIWjvdLSS2xlvRchXlMaXGGnlp98yNUEgNN+x lygQ== X-Forwarded-Encrypted: i=1; AL+hErGo5oEkFfiJih1htRAPu18MvtWmACoLoV/UNWMwK+dvsVE+JrYVeHSiBCCL3vlxHYbgSKtrdVDSPaWPKMA=@vger.kernel.org X-Gm-Message-State: APuU4Z/SdV0FNcnyVWMn+56eeqACyMktr7y8I10d2vaqtCPkt2M9ensP qs4FsnUKwRLWr/exWOenNBZe84ozph8dJTZTtSIQXRvT1Tjkmmo+vWy4 X-Gm-Gg: AZFdTZd/YchsJW3x8CwsH19jWa3Qg+4raZVVdRZnw9O3nigbxilPvFI5MWE0GqBKKg+ JhU8XaExqas5Wk6LIXJapQLCGt6qaY/W0/tIbCP+p/Otj8lgaMifo/CaAunuFhdnAgX6Xr4KTXU ceVm+ICIhQdABHMj5aOO5ckC0dqtzEgnwMm5XSkvdWvn3jAKMh+LxUgRkq/VRsnipBEkOtEKEu7 Ud1bPNxnn//BKn5S3q4/rOdJ8lIqkph8Susp6vhXfaoJjgxv96s12Ty5UV+xsNKH5HAL1bc+X8G qXJoGnlLJ063Wzq60zWO0ocvJCmOsgmrYPdqANRCdSXZon4VwxlyXXu/tKQHJahrrBmrayF1Mul WtenBrXwOpA+MFm8LRhhCKBZPj2dsdAGyQOjHV+jvy4hZJnm5rxKPdcOy+JDJVKdmfiKWQkDLAQ GJmSazKUGznIb63dYa1JkbxunCTEUAM0Bfwq5wvwv3+k48ITk75hTzriR15ConBkXIpGvh2AjGk IRQaya7EZkhzL09i/a2BkwoGnK0PyP3Es+hx5LlshdSE7tk/WOrjuGWlPtraX0fh+b0r/LvvDr8 q3yGVeFQbZf0CzO17umicM55itS1rj28jpg= 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-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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