chelsio/chtls: fix tls record info to user
authorVinay Kumar Yadav <vinay.yadav@chelsio.com>
Thu, 22 Oct 2020 19:05:57 +0000 (00:35 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Nov 2020 11:45:38 +0000 (12:45 +0100)
commitb97638e0f3be40e7729780ab6ff109e9d21c41d9
treee9a71bf2f532ff5fa0a49c739d55375371f5bb49
parenteb592f2ae4786230611360000cd6844f741f8de9
chelsio/chtls: fix tls record info to user

[ Upstream commit 4f3391ce8f5a69e7e6d66d0a3fc654eb6dbdc919 ]

chtls_pt_recvmsg() receives a skb with tls header and subsequent
skb with data, need to finalize the data copy whenever next skb
with tls header is available. but here current tls header is
overwritten by next available tls header, ends up corrupting
user buffer data. fixing it by finalizing current record whenever
next skb contains tls header.

v1->v2:
- Improved commit message.

Fixes: 17a7d24aa89d ("crypto: chtls - generic handling of data and hdr")
Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
Link: https://lore.kernel.org/r/20201022190556.21308-1-vinay.yadav@chelsio.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/chelsio/chtls/chtls_io.c