diff options
| author | Sabrina Dubroca <[email protected]> | 2023-10-20 14:00:55 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2023-10-23 17:15:09 +0000 |
| commit | b7c4f5730a9fa258c8e79f6387a03f3a95c681a2 (patch) | |
| tree | d9af609b0c7f1087558c6476cd77354cfb18f616 /net/tls/tls_device.c | |
| parent | net: lan966x: remove useless code in lan966x_xtr_irq_handler (diff) | |
| download | kernel-b7c4f5730a9fa258c8e79f6387a03f3a95c681a2.tar.gz kernel-b7c4f5730a9fa258c8e79f6387a03f3a95c681a2.zip | |
tls: don't reset prot->aad_size and prot->tail_size for TLS_HW
Prior to commit 1a074f7618e8 ("tls: also use init_prot_info in
tls_set_device_offload"), setting TLS_HW on TX didn't touch
prot->aad_size and prot->tail_size. They are set to 0 during context
allocation (tls_prot_info is embedded in tls_context, kzalloc'd by
tls_ctx_create).
When the RX key is configured, tls_set_sw_offload is called (for both
TLS_SW and TLS_HW). If the TX key is configured in TLS_HW mode after
the RX key has been installed, init_prot_info will now overwrite the
correct values of aad_size and tail_size, breaking SW decryption and
causing -EBADMSG errors to be returned to userspace.
Since TLS_HW doesn't use aad_size and tail_size at all (for TLS1.2,
tail_size is always 0, and aad_size is equal to TLS_HEADER_SIZE +
rec_seq_size), we can simply drop this hunk.
Fixes: 1a074f7618e8 ("tls: also use init_prot_info in tls_set_device_offload")
Signed-off-by: Sabrina Dubroca <[email protected]>
Acked-by: Jakub Kicinski <[email protected]>
Tested-by: Ran Rozenstein <[email protected]>
Link: https://lore.kernel.org/r/979d2f89a6a994d5bb49cae49a80be54150d094d.1697653889.git.sd@queasysnail.net
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/tls/tls_device.c')
| -rw-r--r-- | net/tls/tls_device.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index f01543557a60..bf8ed36b1ad6 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -1099,7 +1099,7 @@ int tls_set_device_offload(struct sock *sk) goto release_netdev; } - rc = init_prot_info(prot, crypto_info, cipher_desc, TLS_HW); + rc = init_prot_info(prot, crypto_info, cipher_desc); if (rc) goto release_netdev; |
