From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795903007; b=K+zECZuwk8R7UOzOkDi1tza9yThNLiT1t5LhLmUoGgAoydFfTvOwqzr7sW+5+w5lVKXq mhBSBaCnKoA4oRHiS7DjfCea+ejU3N9OkBL6XnzxGXI2HiM7WeLG609Zg1TQodli8blNq W+EMVsKE4/lpk0YS+wUX2FnSjDcR8tVWu6iZ4wvtEgJxhSysTPV9GgmvPtVnrc5QqL5VB WA0hsv1/OZm7yMOFhjslw9muVpTPQmTt2TKUcfwACo0HQC4xftQAG2qEeW3v5GskpaL08 rd8WbtV5ZA66tdRptvIhwZHsAAeK8GD7pGPvfxFgPC1mlS5O/ZFBLMwEd/nD63q9GAQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795903007; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=c9BtdyPX+1xOZi0i5TVYJLdr5nzg2E2QiYi8F/eozzA=; b=2ycBAgqBWWlp3vDyzIOf3SqjuZJ1VUY3VL9Iq8F0IHqqdApsy7lX7RCzn2j4RiBLEcas Bh3nKimp7yQp7HCtbpsEfPwdEV7yUHnFmz9gnsjB2oXk0tuPtSlL9ZjSSLJFo1QNtRiHu cb3ovBqy8FOY1cwKkCfoCvsnce4nmUls762x3UAiwo6ZYz5n9qFzmTVqZqf9NW/Xopyqj 1/5TZtxBqZJMgYHWJec9dhhsRfIdBNaL/He9aiKuhVdW3yYnIZlYWGZVnWSCXaIHInwDW xocLOaXY9UnehCnTHJzAFAd6UW8XnAhy2nZ11fGoVT4SondZJwDE9omLOX/dm/n+gKQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=M20kEV6z; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with UTF8SMTPS id BDE41606A32A; Sat, 28 Nov 2026 21:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=M20kEV6z Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id DBCEF1F0089A; Sat, 28 Nov 2026 21:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795903007; bh=c9BtdyPX+1xOZi0i5TVYJLdr5nzg2E2QiYi8F/eozzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=M20kEV6z8+opkjMj1UeuiEJHYy4wSTvr4wM6hEKvssFGTgkswONDdPuJfEAlaVH/C wt/ODrPt9kpal3/qij21EvHn06N9tj7PrMUOyEqtvii8QKf+0cLqj838hf4jTjCX+O IOvyn9wOuWDwLiXlt3JUng0zOgWMv99+IPxyWIO21hMIsN01nvSxucYkV7M5S0InT5 a4mC3EF/OmnY+yF2WCpMepl0aI+On3OpQOQntkvYWR/CZcefeYVEvIz5PDWoXFa4Km cf+zBrvSChiihBQ3Qgg1AQKxkjD/af+kdEsyupOXOVGOJzWWdMNcRim85LTqS8PqKS 1XddF7Zpm7isQ== From: Jarkko Sakkinen To: keyrings@vger.kernel.org Cc: Jarkko Sakkinen , dm-devel@lists.linux.dev, linux-crypto@vger.kernel.org, linux-doc@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Ahmad Fatoum , Alasdair Kergon , Andrew Morton , Benjamin Marzinski , David Gstir , David Howells , David Laight , "David S. Miller" , David Woodhouse , Eric Biggers , Herbert Xu , Ignat Korchagin , James Bottomley , James Morris , James Prestwood , Jason Gunthorpe , Jonathan Corbet , Jonathan McDowell , Lukas Wunner , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Mike Snitzer , Mikulas Patocka , Mimi Zohar , Paul Moore , Peter Huewe , Randy Dunlap , "Serge E. Hallyn" , Shuah Khan , Sumit Garg , stable@vger.kernel.org Subject: [PATCH v6 03/18] tpm2-sessions: Drop TPM2_NAME_SIZE Date: Sat, 28 Nov 2026 23:56:05 +0200 Message-ID: <20261128215621.2253928-4-jarkko@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261128215621.2253928-1-jarkko@kernel.org> References: <20261128215621.2253928-1-jarkko@kernel.org> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit TPM2_NAME_SIZE was left to include/linux/tpm.h when the base definitions were consolidated. Switch struct tpm2_auth to TPM2_MAX_NAME_SIZE and convert TPM2_NAME_SIZE users to TPM2_NULL_NAME_SIZE, removing the redundant TPM2_NAME_SIZE definition. Cc: stable@vger.kernel.org # v7.3+ Fixes: 88c5a62c3af7 ("tpm: Move TPM common base definitions to the command header") Reviewed-by: Jonathan McDowell Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-sysfs.c | 2 +- drivers/char/tpm/tpm2-sessions.c | 2 +- include/linux/tpm.h | 8 +------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c index d915307ae833..0f726cf65189 100644 --- a/drivers/char/tpm/tpm-sysfs.c +++ b/drivers/char/tpm/tpm-sysfs.c @@ -318,7 +318,7 @@ static ssize_t null_name_show(struct device *dev, struct device_attribute *attr, char *buf) { struct tpm_chip *chip = to_tpm_chip(dev); - int size = TPM2_NAME_SIZE; + int size = TPM2_NULL_NAME_SIZE; bin2hex(buf, chip->null_key_name, size); size *= 2; diff --git a/drivers/char/tpm/tpm2-sessions.c b/drivers/char/tpm/tpm2-sessions.c index 2aaaad69760d..7afcfaaf84d9 100644 --- a/drivers/char/tpm/tpm2-sessions.c +++ b/drivers/char/tpm/tpm2-sessions.c @@ -137,7 +137,7 @@ struct tpm2_auth { * we must compute and remember */ u32 name_h[AUTH_MAX_NAMES]; - u8 name[AUTH_MAX_NAMES][2 + SHA512_DIGEST_SIZE]; + u8 name[AUTH_MAX_NAMES][TPM2_MAX_NAME_SIZE]; }; #ifdef CONFIG_TCG_TPM2_HMAC diff --git a/include/linux/tpm.h b/include/linux/tpm.h index 0db277af45c3..84c8fe226235 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h @@ -94,12 +94,6 @@ struct tpm_chip_seqops { /* Fixed define for the curve we use which is NIST_P256 */ #define EC_PT_SZ 32 -/* - * fixed define for the size of a name. This is actually HASHALG size - * plus 2, so 32 for SHA256 - */ -#define TPM2_NAME_SIZE 34 - /* * The maximum size for an object context */ @@ -166,7 +160,7 @@ struct tpm_chip { /* saved context for NULL seed */ u8 null_key_context[TPM2_MAX_CONTEXT_SIZE]; /* name of NULL seed */ - u8 null_key_name[TPM2_NAME_SIZE]; + u8 null_key_name[TPM2_NULL_NAME_SIZE]; u8 null_ec_key_x[EC_PT_SZ]; u8 null_ec_key_y[EC_PT_SZ]; struct tpm2_auth *auth; -- 2.47.3