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=1796384838; b=HLK6LV3WfN+P0OJ3JvShKQEU82AsmwJ08V3b2ToziWwXNKc1udNKW1Swtc7UDaH6BF3t +7HQG9WtjUkBHkAGRY4zmjIkGJza1mbR+hYAa82WIZ3QZSPRWbLe4uemuQ5gbop8YRy4b 7piP5im5YjuByWa9D72leD2Mjbyjtr5EU1IefKZx/5bsLvMWJwi8RDkbM/354mGU0qKDa 78yVfPZfKHLKSxCMkjB2h5Ea8I2E1e9uTrGBvpLyvqpwCVOLAk462mhEwTx6/QagdTc59 r3CpO12QVuQZL5RXXrGoJfpIGggxuPr7SABB+M2cAf3fndAZZnQqioFvtTMazNRGKOg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384838; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=upXSa5K6l2Bpb1KzF37guo5RviCXMVVNBv/VKP3/QoM=; b=HT2PTMXgmY5WKJVmfjm2wIedTRoE4OvgqH97yLRYTWQ8YrRkhZ7TUcpPf2vP0VB2VzeM 7Bp8ICsIn8cHzTvp2Qi8hUH1GZO58ea0srjhGmognE572UX62jICLK9uaW7N9tPjWOdCj vVx+uOXatkJZ+dtcC5aQm03/lwDVvKHPRT/Nt8s6Xx3PvwSM/lPdbOgwpg61Sc9Mm/NvS kFL4PnLCl8Vy68+f18U7r8h53zjjzrledIrmwHR4nmLu7C/t0Zdrb4QjM2VnOrhi/WX2X +JOMPC6aXvo9GnKcjvHctLHd+wT5H56Q6Z+bUo5DrdWIgahWBluH0MXxqnmmKq/8h7Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=rpD4zCE8; 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 ESMTPS id 1AD48606A322; Fri, 4 Dec 2026 11:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=rpD4zCE8 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AD871F000CE; Fri, 4 Dec 2026 11:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384838; bh=upXSa5K6l2Bpb1KzF37guo5RviCXMVVNBv/VKP3/QoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rpD4zCE8j29Efs//RZUBzaNrVg+yAGa1QIqleKGbkNeKWRj26P+D2CXckJK+rl6B+ QVw+kkOkBfcs5G5qh4yGhhXJ+vgmkIoaT/TrT5WrZOJtjBOaOalblQASo/LbQO+Y5p 94eUPCHflSARahMY4Tf5QIrZ83eqComXi5KJdoe0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Antoine Tenart , Thomas Huth , Herbert Xu , Sasha Levin Subject: [PATCH 6.6 0314/1167] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data Date: Fri, 4 Dec 2026 18:55:41 +0900 Message-ID: <20261204100710.195721653@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Huth [ Upstream commit 5c87bcb2f98dbfe08efa016af037b0f9701ba381 ] key_tmp[] in safexcel_xcbcmac_setkey() and consts[] / _const[] in safexcel_cmac_setkey() contain crypto key material that should not get exposed to the outside once the function is done. Scrub the arrays with memzero_explicit() to avoid that the data could leak via the stack. Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20260813134953.979481-1-thuth%40redhat.com Fixes: 38f21b4bab11f ("crypto: inside-secure - Added support for the AES XCBC ahash") Fixes: 7a627db9cafdb ("crypto: inside-secure - Added support for the AES-CMAC ahash") Acked-by: Antoine Tenart Signed-off-by: Thomas Huth Signed-off-by: Herbert Xu [ sashal: Context adapted because this tree uses aes_expandkey() where upstream context has aes_prepareenckey(); the three memzero_explicit() additions are identical. ] Signed-off-by: Sasha Levin --- drivers/crypto/inside-secure/safexcel_hash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index af4b978189e51..af2b97fcb27f4 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -2081,6 +2081,7 @@ static int safexcel_xcbcmac_setkey(struct crypto_ahash *tfm, const u8 *key, ret = aes_expandkey(ctx->aes, (u8 *)key_tmp + 2 * AES_BLOCK_SIZE, AES_MIN_KEY_SIZE); + memzero_explicit(key_tmp, sizeof(key_tmp)); if (ret) return ret; @@ -2192,6 +2193,8 @@ static int safexcel_cmac_setkey(struct crypto_ahash *tfm, const u8 *key, } ctx->cbcmac = false; + memzero_explicit(consts, sizeof(consts)); + memzero_explicit(_const, sizeof(_const)); return 0; } -- 2.53.0