From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 9D67A12B94 for ; Fri, 7 Aug 2026 07:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786086438; cv=none; b=impnPI1uE5cCzp/jcWIcClvs4V26Ro+g3t8Q4O+y/SqCJMl7HehheMi2ULzi4ecnnyehRyq1cjAiLUn1Z5GCQzTP/1o7KjGlqYpvvXXFoo7mtoXf5Bo2HNY0PG51puFgl1AHh1a+5J1deDiLZpsUAB7/1AOj6u+Y2OVmoPGle6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786086438; c=relaxed/simple; bh=vzZOFKBz/vS1L4OiBZo1G1l389pu1nVzeo0UGyLy+sw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uZrtQOsML/qCJg8SZrn43+7BwN2c39t/0cOGBqVwUb95ipMd6AL/XfsNyv5F75hipq7+QvsOoAlZ1XqVkwzs/raqin7CiC2eCXS05Z/AlaFnA/Raa4VpVxgoLmuf/vH7vXMNHCmvT9Kvg/sDf/BjiI8q8HA01I8+lI3tq2EW9o0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=FPI0N2w3; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FPI0N2w3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786086436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5/FP2iona05c4GGFGjhMtKYGShx3GCcZ6CaDckfTOnk=; b=FPI0N2w3ePxF46/Dobrj5Kd7/kj9Ljjc13rOgTkCKg6acNu5xarhNIEhfT98VpVwZPJx5c n2pvQ4KXEEAcailAk5fsl4mZP9SWupIt7RO/89KKa54rDDVZAlt1RuOmMuTiQ7LvPiVAxD A1X8lBYX0w+DMXQqWvpGez1Sn01gmbE= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-472-q9USIYrkOlK2hezRTxpaIA-1; Fri, 07 Aug 2026 03:07:13 -0400 X-MC-Unique: q9USIYrkOlK2hezRTxpaIA-1 X-Mimecast-MFC-AGG-ID: q9USIYrkOlK2hezRTxpaIA_1786086432 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F0E7A195608F; Fri, 7 Aug 2026 07:07:11 +0000 (UTC) Received: from thuth-p1g4.redhat.corp (headnet03.pony-001.prod.iad2.dc.redhat.com [10.2.32.114]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EC9A51956094; Fri, 7 Aug 2026 07:07:07 +0000 (UTC) From: Thomas Huth To: Herbert Xu , "David S. Miller" , Christian Marangi , Antoine Tenart Cc: linux-crypto@vger.kernel.org, Eric Biggers , linux-kernel@vger.kernel.org Subject: [PATCH v4 03/10] crypto: inside-secure/eip93 - clear the crypto_aes_ctx when done Date: Fri, 7 Aug 2026 09:06:30 +0200 Message-ID: <20260807070651.228713-4-thuth@redhat.com> In-Reply-To: <20260807070651.228713-1-thuth@redhat.com> References: <20260807070651.228713-1-thuth@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 From: Thomas Huth Clear the crypto_aes_ctx structure via __cleanup(aes_zeroize_ctx) when we're done with it to avoid that key data could leak on the stack. Signed-off-by: Thomas Huth --- drivers/crypto/inside-secure/eip93/eip93-aead.c | 2 +- drivers/crypto/inside-secure/eip93/eip93-cipher.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/inside-secure/eip93/eip93-aead.c b/drivers/crypto/inside-secure/eip93/eip93-aead.c index 2bbd0af7b0e0e..973cebef5df37 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-aead.c +++ b/drivers/crypto/inside-secure/eip93/eip93-aead.c @@ -92,7 +92,7 @@ static int eip93_aead_setkey(struct crypto_aead *ctfm, const u8 *key, struct crypto_tfm *tfm = crypto_aead_tfm(ctfm); struct eip93_crypto_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_authenc_keys keys; - struct crypto_aes_ctx aes; + struct crypto_aes_ctx aes __cleanup(aes_zeroize_ctx); struct sa_record *sa_record = ctx->sa_record; u32 nonce = 0; int ret; diff --git a/drivers/crypto/inside-secure/eip93/eip93-cipher.c b/drivers/crypto/inside-secure/eip93/eip93-cipher.c index 4dd7ab7503e85..7051b99ee6235 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-cipher.c +++ b/drivers/crypto/inside-secure/eip93/eip93-cipher.c @@ -116,7 +116,7 @@ static int eip93_skcipher_setkey(struct crypto_skcipher *ctfm, const u8 *key, } if (flags & EIP93_ALG_AES) { - struct crypto_aes_ctx aes; + struct crypto_aes_ctx aes __cleanup(aes_zeroize_ctx); ctx->blksize = AES_BLOCK_SIZE; ret = aes_expandkey(&aes, key, keylen); -- 2.55.0