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 F407B3515D1 for ; Wed, 5 Aug 2026 14:36:39 +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=1785940604; cv=none; b=OqIFk35AOAvwcO0087btapuAwaDlqCEr4SFkqVZ7f6l9jvyEB72maM6SCjcE2PozbnMO4c4/1+cjU3W+TvBfJJLZ5TRjRvCf1MWuGWlxJPIVnEpAKqxqU6/zwWWxylbjMlO9/iuC8DJpnwTFwbwCsKiIJvPCq7slp8Kpmm0QjrQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785940604; c=relaxed/simple; bh=Va4ivm8VFtFpcxvPb6V6ItS1fIrbnCGVzIWgl1id4oQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pGU7w/WWcgD/z72Hk50nu4PioY34qGiQsJdXusbITbuboecGZRCmGdlXiZaaojUeMN670iI0qRJi+rOD9aIdR8iLvY83VizDC/CyITkcMCVLRzyyUafCTKrBbMZ7uNqIRsU5KNlx5qHnLbZC9g7MFIomEDzumHl2rVq04bNDU68= 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=G4zHL0tn; 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="G4zHL0tn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785940596; 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=EEtweso52u7DPd5Sbq00gxh4t8XgpNwiiYdVWx3jMpU=; b=G4zHL0tnxOqQVmqNHnqcUZy9lmITM0ZNzMcKsKeDRa4XpjUx7dfj3bapsBC+rwbbWpNe64 7kQ8d2MuSKhPPyzTb0571z/JgbBflCTachi722crWIY3qAASuc+2KDxyFeLUFheHFT7W/x hvbx1Y0vzwRcVi1aTXTVMlccGuKV04I= Received: from mx-prod-mc-03.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-524-NHoGUniKNH-wvTHsUNYRTg-1; Wed, 05 Aug 2026 10:36:30 -0400 X-MC-Unique: NHoGUniKNH-wvTHsUNYRTg-1 X-Mimecast-MFC-AGG-ID: NHoGUniKNH-wvTHsUNYRTg_1785940588 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 77B011955F24; Wed, 5 Aug 2026 14:36:28 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.48.209]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D311D1800598; Wed, 5 Aug 2026 14:36:24 +0000 (UTC) From: Thomas Huth To: Herbert Xu , "David S. Miller" , Eric Biggers , Eric Dumazet , Neal Cardwell , Jakub Kicinski , Paolo Abeni Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Kuniyuki Iwashima , Simon Horman , netdev@vger.kernel.org Subject: [PATCH 3/6] net/tcp-ao: clear the aes_cmac_key when done Date: Wed, 5 Aug 2026 16:36:06 +0200 Message-ID: <20260805143611.818559-4-thuth@redhat.com> In-Reply-To: <20260805143611.818559-1-thuth@redhat.com> References: <20260805143611.818559-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.4.1 on 10.30.177.93 From: Thomas Huth Clear the local aes_cmac_key structure via __cleanup() function when we're done with it to avoid that sensitive data could leak on the stack. Signed-off-by: Thomas Huth --- net/ipv4/tcp_ao.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_ao.c b/net/ipv4/tcp_ao.c index a56bb79e15e0e..12c724fed8a26 100644 --- a/net/ipv4/tcp_ao.c +++ b/net/ipv4/tcp_ao.c @@ -141,7 +141,7 @@ void tcp_ao_calc_traffic_key(const struct tcp_ao_key *mkt, u8 *traffic_key, traffic_key); return; case TCP_AO_ALGO_AES_128_CMAC: { - struct aes_cmac_key k; + struct aes_cmac_key k __cleanup(aes_cmac_zeroize_key); aes_cmac_preparekey(&k, mkt->key, AES_KEYSIZE_128); aes_cmac(&k, input, input_len, traffic_key); -- 2.55.0