Skip to content

Commit

Permalink
crypto/chtls: fix tls alert messages corrupted by tls data
Browse files Browse the repository at this point in the history
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: 6919a82 ("Crypto/chtls: add/delete TLS header in driver")
Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vinay Kumar Yadav authored and David S. Miller committed Jul 21, 2020
1 parent 4932893 commit c271042
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/crypto/chelsio/chtls/chtls_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,14 +1052,15 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
&record_type);
if (err)
goto out_err;

/* Avoid appending tls handshake, alert to tls data */
if (skb)
tx_skb_finalize(skb);
}

recordsz = size;
csk->tlshws.txleft = recordsz;
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) ||
Expand Down

0 comments on commit c271042

Please sign in to comment.