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

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
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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) ||