提交 c68a28a9 编写于 作者: R Rohit Maheshwari 提交者: Jakub Kicinski

ch_ktls: Correction in trimmed_len calculation

trimmed length calculation goes wrong if skb has only tag part
to send. It should be zero if there is no data bytes apart from
TAG.

Fixes: dc05f3df ("chcr: Handle first or middle part of record")
Signed-off-by: NRohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
上级 687823d2
......@@ -1729,10 +1729,13 @@ static int chcr_short_record_handler(struct chcr_ktls_info *tx_info,
if (remaining_record > 0 &&
remaining_record < TLS_CIPHER_AES_GCM_128_TAG_SIZE) {
int trimmed_len = data_len -
(TLS_CIPHER_AES_GCM_128_TAG_SIZE - remaining_record);
/* don't process the pkt if it is only a partial tag */
if (data_len < TLS_CIPHER_AES_GCM_128_TAG_SIZE)
int trimmed_len = 0;
if (tls_end_offset > TLS_CIPHER_AES_GCM_128_TAG_SIZE)
trimmed_len = data_len -
(TLS_CIPHER_AES_GCM_128_TAG_SIZE -
remaining_record);
if (!trimmed_len)
goto out;
WARN_ON(trimmed_len > data_len);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册