From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.224.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796124482; b=GPYhRU0i6RUYmoxK4DtymZsArMO0f5Y20LBNsT7eJnJo8ItcTaFSZajxCNS6uf6Mc+++ 0BiN7zYCP9HXSVORuJ7ysqTe0bCmAEUOVgNdKP0YY96u3LdNO7AbYLyOwj6JEHo2sc844 0TbohJcHs5TrN16FOmzM/IsprDwTI7E/yRtbzPad/HTHOwREivOCgelFxd5h2Q9Za1JZ1 DIYiQ58aCElP6jfOkCH7PgdH2eoeUUvkoEa15bnr0kmRhQINOwAF8MBi6ZUDRGXm2VXVO 4IL128NpEn4R+JCQthDnSp8Sa0hmf7rl3hBCzSuwMKRMyz5okdqpsByseBWkcLCZeHg== 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=YdDS2FAYkb+32XkXbsHOXNJdrjnZBXzh0bzTp16xAKBXd20cylGACf7jF1PGIO616/Fg gUe4/0KQgUMAt0ki2S537NZMESGXQAOCqpVr9SOdAkhJaKJvyLh0X4BiGYYpvizQHkjYc +1iseGj1GnbblSGBEqlX1glBEUtYcyJ0ukeiDx2KFNEBwFDQ0yfivStzZELUAaRRMTMti wn4HhU4Klt2KIQh8uqzuWtWDvxZv10asWmKsvRnisf4UjS66svMOA9u9u3AOOjasea65+ ZYyKQEwUgJzwXq3dz5oAG7hS5BQbeOXt5PaAcYRgbTP9XpCZ2H7nxqmEpzdjlfh2R5w== 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.131 Received: from mail-yx2-f3.google.com (mail-yx2-f3.google.com [74.125.224.131]) (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 0EDB5606A325 for ; Tue, 1 Dec 2026 11:28:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0EDB5606A325 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-f3.google.com with SMTP id 956f58d0204a3-67de22b31edso4755253d50.0 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=FYlAxNIxuB0K8CsjNEI9cQtYYzhQ3aslQYCa+nQboqCurnH1m8IcWusUIBcU8pdjEs 2t9V37m7KDWoyAJKwSeZ8FwZGE8Hlbzn3f+a7FGkJOgP6WKVdPDiGL/BfS2XYPuqbfNz qh7tzEFE7f2GsFQAgy7oFu3h8whtDyswUrW3ZiFiJwkNfMelawHjYzg81ZHVHuyvq0Kr of7h09UC+jcwLFWCXtBpc76c8p9Sp+OUUu5CIFt4sOZpRGsvWw6Ow8zPfqFYPY41rZrj jbiNhg2ZS7I8f1IfHCtGVi9jhb7RBxekrE2FWKhXIZ9ANrIuaX8LTWL+Ua2XoXtya6lz frkA== X-Forwarded-Encrypted: i=1; AL+hErHRVfvu4hIJyNb+QhJeBQA/YHUwgeF3L5MYaUu3v58XpepI0MBma6s56H0MOF6SRxNskjQT7+3p2FM1QslfTFY=@vger.kernel.org X-Gm-Message-State: APuU4Z9vzHtGT0AL2tanbgq1d282LIBuqim09r3hfm5powgcYINYU43Z j8vCgG7vgpuVOQ9fp+uWmLeWh3zQBp11FqlxG1XRuezqYVP2slg8Z4zo X-Gm-Gg: AZFdTZfe3fMVudVj/FXO0Z6nBlEvY5NvIwWwIG+T/DJKtO1kIwjgkM0eQBNZS5n9XSJ a/yBpy41gf9e3XQezS7ykRUvVQ6fGfh7cvxFq3zeKHjAAyafqG0Gh2Q/bYaJyBvVPl5YE1VBcoR bd5vezGIZ/+XH2qvYcWG8qT5ALbTMtsmDS1as16uEFGGUSsi+/as6Fbc95aJJ+jRNgrwX/CwuhI eQCsIoJhvGT9Q1Sq70Ue3hIQzrWit51lB4CjuktTPJDbsOGfokFN6gxalJSB0SG3soESa4GCmkD MdaW5vl6d/RCRssg/lbDKwsu7iUUBkZB33RvltAdzWu3HD3wIpYIKL6hCze56LfM6RMnEc4/VXO R0lSGnwgxaTqBAEhLNpjuhlOkv9i/ucAdRyXw/CKp5+P5eUFCCstKOqj7f/w/fYC/om3PHD5lxQ GiuUqPzTLMVjp4tO7xM+nOMjBwywW6Leh5kqnPTX8o4zcYoc5BffatVnq7XThTsm3YdUSXuX8Lt ViCroaZ47ysP8f6OxkHabt7NTWsXgOO3tK1C8yFidFJVHbkZ1kkB9uHKfqQKOuXHe7/bhFpDqyX CG6qYg3cXosZZeFVlTaMcIirg7q4BG0porI= 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-hardening@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