netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] chelsio/chtls: fix tls record info to user
@ 2020-10-20 19:39 Vinay Kumar Yadav
  2020-10-22  4:08 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Vinay Kumar Yadav @ 2020-10-20 19:39 UTC (permalink / raw)
  To: netdev, davem, kuba; +Cc: secdev, Vinay Kumar Yadav

tls record header is not getting updated correctly causing
application to close the connection in between data copy.
fixing it by finalizing current record whenever tls header
received.

Fixes: 17a7d24aa89d ("crypto: chtls - generic handling of data and hdr")
Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
---
 .../net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
index 9fb5ca6682ea..a5dcc576ba3c 100644
--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
+++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
@@ -1585,6 +1585,7 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
 			tp->urg_data = 0;
 
 		if ((avail + offset) >= skb->len) {
+			struct sk_buff *next_skb;
 			if (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_TLS_HDR) {
 				tp->copied_seq += skb->len;
 				hws->rcvpld = skb->hdr_len;
@@ -1595,9 +1596,12 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
 			chtls_free_skb(sk, skb);
 			buffers_freed++;
 			hws->copied_seq = 0;
-			if (copied >= target &&
-			    !skb_peek(&sk->sk_receive_queue))
+			next_skb = skb_peek(&sk->sk_receive_queue);
+			if (copied >= target && !next_skb)
 				break;
+			if (ULP_SKB_CB(next_skb)->flags & ULPCB_FLAG_TLS_HDR)
+				break;
+
 		}
 	} while (len > 0);
 
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] chelsio/chtls: fix tls record info to user
  2020-10-20 19:39 [PATCH net] chelsio/chtls: fix tls record info to user Vinay Kumar Yadav
@ 2020-10-22  4:08 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2020-10-22  4:08 UTC (permalink / raw)
  To: Vinay Kumar Yadav; +Cc: netdev, davem, secdev

On Wed, 21 Oct 2020 01:09:31 +0530 Vinay Kumar Yadav wrote:
> tls record header is not getting updated correctly causing
> application to close the connection in between data copy.
> fixing it by finalizing current record whenever tls header
> received.

Please improve this commit message.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-22  4:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 19:39 [PATCH net] chelsio/chtls: fix tls record info to user Vinay Kumar Yadav
2020-10-22  4:08 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).