Commit e243e51
Sabrina Dubroca
tls: don't reset prot->aad_size and prot->tail_size for TLS_HW
JIRA: https://issues.redhat.com/browse/RHEL-14902
commit b7c4f57
Author: Sabrina Dubroca <[email protected]>
Date: Fri Oct 20 16:00:55 2023 +0200
tls: don't reset prot->aad_size and prot->tail_size for TLS_HW
Prior to commit 1a074f7 ("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: 1a074f7 ("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]>
Signed-off-by: Sabrina Dubroca <[email protected]>1 parent 22422ec commit e243e51
3 files changed
+4
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
| 145 | + | |
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1113 | 1113 | | |
1114 | 1114 | | |
1115 | 1115 | | |
1116 | | - | |
| 1116 | + | |
1117 | 1117 | | |
1118 | 1118 | | |
1119 | 1119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2640 | 2640 | | |
2641 | 2641 | | |
2642 | 2642 | | |
2643 | | - | |
2644 | | - | |
| 2643 | + | |
2645 | 2644 | | |
2646 | 2645 | | |
2647 | 2646 | | |
| |||
2654 | 2653 | | |
2655 | 2654 | | |
2656 | 2655 | | |
2657 | | - | |
2658 | | - | |
2659 | | - | |
2660 | | - | |
2661 | | - | |
2662 | 2656 | | |
2663 | 2657 | | |
2664 | 2658 | | |
| |||
2718 | 2712 | | |
2719 | 2713 | | |
2720 | 2714 | | |
2721 | | - | |
| 2715 | + | |
2722 | 2716 | | |
2723 | 2717 | | |
2724 | 2718 | | |
| |||
0 commit comments