From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99C5539B946 for ; Sun, 10 May 2026 15:43:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778427823; cv=none; b=mQNap/ZtJOL0uw+WljOJr7WmqCx5qc/3NiUdRqtxEQ0JkbtrIuQIyl2bah914dqf3pmupk20YaBG34cNigCElzzPXKY/hQuZAkh2a/tu3E1WW4w9mNwNfd6bXuZKEl69/EvK3jLPWwXP+Z+BgVY0NUCdzX5KLmHX/SJDbmcJHeQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778427823; c=relaxed/simple; bh=hz/LjC3ZGuhFkYhO1bH6MwkiJpUw5OTTE4NjH1FxHmo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cToMsRheuugRpR08csXZ8AuyXsZVLxRd2+Mtyn0a2nDbTtL3PxWEL8ERhivTMwCKXREfZfsmrfFJ7m3QuNpFr/k/DfEaHzzn0+eku0xlICijEosEpaUJ9BsyEGQH4QCdWftQKryTdWwUxXq41RJYWw68MnBUfAEcPLGHQ8lPKSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dMlnHyKb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dMlnHyKb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F37BEC2BCC7; Sun, 10 May 2026 15:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778427823; bh=hz/LjC3ZGuhFkYhO1bH6MwkiJpUw5OTTE4NjH1FxHmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dMlnHyKb60OCKV7w4KV8dVYGIjP5mWwvK7qvL7DekUOY4vOAPWEw8UB16vI7oQ4G/ 4+tx+ZIJMqsiaqvgBaMzlU3KDwcZ6UdOwredBGvSBPp2FcQBdyxZJZOdwOTso+irBS t8t0XR6e3wmDS5n/WWq6Yg3JU6KCiFqhs2g7LeFfmu9bUAaHzfiI9//tGfaGiUduKO hoitxpYxoNOE9aukXUGaUwu2E+NyJWef2BCAM7n1TtkSID6DSQq4jWHZDxzN8oP6U0 LFGujVrhCXhepB5cv4A9bYHMJ5F2IgqVQYjryY90d7FCgFyK5Z5uZfz6V3aF5T62Dm L9vK0SuS3Eu8w== From: Sasha Levin To: stable@vger.kernel.org Cc: Thorsten Blum , Herbert Xu , Sasha Levin Subject: [PATCH 5.10.y 2/2] crypto: caam - guard HMAC key hex dumps in hash_digest_key Date: Sun, 10 May 2026 11:43:38 -0400 Message-ID: <20260510154339.144690-2-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260510154339.144690-1-sashal@kernel.org> References: <2026050438-conical-landscape-5b4d@gregkh> <20260510154339.144690-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Thorsten Blum [ Upstream commit 177730a273b18e195263ed953853273e901b5064 ] Use print_hex_dump_devel() for dumping sensitive HMAC key bytes in hash_digest_key() to avoid leaking secrets at runtime when CONFIG_DYNAMIC_DEBUG is enabled. Fixes: 045e36780f11 ("crypto: caam - ahash hmac support") Fixes: 3f16f6c9d632 ("crypto: caam/qi2 - add support for ahash algorithms") Cc: stable@vger.kernel.org Signed-off-by: Thorsten Blum Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/caam/caamalg_qi2.c | 4 ++-- drivers/crypto/caam/caamhash.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c index 43bed47ce59be..c895bd861100f 100644 --- a/drivers/crypto/caam/caamalg_qi2.c +++ b/drivers/crypto/caam/caamalg_qi2.c @@ -3261,7 +3261,7 @@ static int hash_digest_key(struct caam_hash_ctx *ctx, u32 *keylen, u8 *key, dpaa2_fl_set_addr(out_fle, key_dma); dpaa2_fl_set_len(out_fle, digestsize); - print_hex_dump_debug("key_in@" __stringify(__LINE__)": ", + print_hex_dump_devel("key_in@" __stringify(__LINE__)": ", DUMP_PREFIX_ADDRESS, 16, 4, key, *keylen, 1); print_hex_dump_debug("shdesc@" __stringify(__LINE__)": ", DUMP_PREFIX_ADDRESS, 16, 4, desc, desc_bytes(desc), @@ -3281,7 +3281,7 @@ static int hash_digest_key(struct caam_hash_ctx *ctx, u32 *keylen, u8 *key, /* in progress */ wait_for_completion(&result.completion); ret = result.err; - print_hex_dump_debug("digested key@" __stringify(__LINE__)": ", + print_hex_dump_devel("digested key@" __stringify(__LINE__)": ", DUMP_PREFIX_ADDRESS, 16, 4, key, digestsize, 1); } diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index e8a6d8bc43b5d..0ddd50cdadddc 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -390,7 +390,7 @@ static int hash_digest_key(struct caam_hash_ctx *ctx, u32 *keylen, u8 *key, append_seq_store(desc, digestsize, LDST_CLASS_2_CCB | LDST_SRCDST_BYTE_CONTEXT); - print_hex_dump_debug("key_in@"__stringify(__LINE__)": ", + print_hex_dump_devel("key_in@"__stringify(__LINE__)": ", DUMP_PREFIX_ADDRESS, 16, 4, key, *keylen, 1); print_hex_dump_debug("jobdesc@"__stringify(__LINE__)": ", DUMP_PREFIX_ADDRESS, 16, 4, desc, desc_bytes(desc), @@ -405,7 +405,7 @@ static int hash_digest_key(struct caam_hash_ctx *ctx, u32 *keylen, u8 *key, wait_for_completion(&result.completion); ret = result.err; - print_hex_dump_debug("digested key@"__stringify(__LINE__)": ", + print_hex_dump_devel("digested key@"__stringify(__LINE__)": ", DUMP_PREFIX_ADDRESS, 16, 4, key, digestsize, 1); } -- 2.53.0