Commit c271042e authored by Vinay Kumar Yadav's avatar Vinay Kumar Yadav Committed by David S. Miller

crypto/chtls: fix tls alert messages corrupted by tls data

When tls data skb is pending for Tx and tls alert comes , It
is wrongly overwrite the record type of tls data to tls alert
record type. fix the issue correcting it.

v1->v2:
- Correct submission tree.
- Add fixes tag.

Fixes: 6919a826 ("Crypto/chtls: add/delete TLS header in driver")
Signed-off-by: default avatarVinay Kumar Yadav <vinay.yadav@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 49328939
...@@ -1052,14 +1052,15 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -1052,14 +1052,15 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
&record_type); &record_type);
if (err) if (err)
goto out_err; goto out_err;
/* Avoid appending tls handshake, alert to tls data */
if (skb)
tx_skb_finalize(skb);
} }
recordsz = size; recordsz = size;
csk->tlshws.txleft = recordsz; csk->tlshws.txleft = recordsz;
csk->tlshws.type = record_type; csk->tlshws.type = record_type;
if (skb)
ULP_SKB_CB(skb)->ulp.tls.type = record_type;
} }
if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) || if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment