Netdev List
 help / color / mirror / Atom feed
* [PATCH v2 3/6] net/tcp-ao: clear the aes_cmac_key when done
       [not found] <20260807125845.1477067-1-thuth@redhat.com>
@ 2026-08-07 12:58 ` Thomas Huth
  2026-08-07 22:22   ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2026-08-07 12:58 UTC (permalink / raw)
  To: Eric Biggers, Eric Dumazet, Neal Cardwell, David S. Miller,
	Jakub Kicinski, Paolo Abeni
  Cc: Herbert Xu, linux-crypto, linux-kernel, Steve French, Namjae Jeon,
	Kuniyuki Iwashima, Simon Horman, netdev

From: Thomas Huth <thuth@redhat.com>

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 <thuth@redhat.com>
---
 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 e4ec60a334963..0626cbf60620c 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 3/6] net/tcp-ao: clear the aes_cmac_key when done
  2026-08-07 12:58 ` [PATCH v2 3/6] net/tcp-ao: clear the aes_cmac_key when done Thomas Huth
@ 2026-08-07 22:22   ` Jakub Kicinski
  2026-08-08 10:38     ` Thomas Huth
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2026-08-07 22:22 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Eric Biggers, Eric Dumazet, Neal Cardwell, David S. Miller,
	Paolo Abeni, Herbert Xu, linux-crypto, linux-kernel, Steve French,
	Namjae Jeon, Kuniyuki Iwashima, Simon Horman, netdev

On Fri,  7 Aug 2026 14:58:40 +0200 Thomas Huth wrote:
> -		struct aes_cmac_key k;
> +		struct aes_cmac_key k __cleanup(aes_cmac_zeroize_key);

Nak, we don't like the auto-cleanup stuff in networking.
If y'all need a garbage collector there're jobs programming in Java.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 3/6] net/tcp-ao: clear the aes_cmac_key when done
  2026-08-07 22:22   ` Jakub Kicinski
@ 2026-08-08 10:38     ` Thomas Huth
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2026-08-08 10:38 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Eric Biggers, Eric Dumazet, Neal Cardwell, David S. Miller,
	Paolo Abeni, Herbert Xu, linux-crypto, linux-kernel, Steve French,
	Namjae Jeon, Kuniyuki Iwashima, Simon Horman, netdev

On 08/08/2026 00.22, Jakub Kicinski wrote:
> On Fri,  7 Aug 2026 14:58:40 +0200 Thomas Huth wrote:
>> -		struct aes_cmac_key k;
>> +		struct aes_cmac_key k __cleanup(aes_cmac_zeroize_key);
> 
> Nak, we don't like the auto-cleanup stuff in networking.

Ok, if you don't like it, then let's drop this patch.

> If y'all need a garbage collector there're jobs programming in Java.
No need for derogatory statements, Jakub. That's really inappropriate.

  Thomas


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-08 10:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260807125845.1477067-1-thuth@redhat.com>
2026-08-07 12:58 ` [PATCH v2 3/6] net/tcp-ao: clear the aes_cmac_key when done Thomas Huth
2026-08-07 22:22   ` Jakub Kicinski
2026-08-08 10:38     ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox