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)
committerJakub Kicinski <kuba@kernel.org>
Sat, 24 Oct 2020 01:34:10 +0000 (18:34 -0700)
commit4f3391ce8f5a69e7e6d66d0a3fc654eb6dbdc919
treebb9126d534152322e8c2169357d26b65bf1d5f1e
parentdf833050cced27e1b343cc8bc41f90191b289334
chelsio/chtls: fix tls record info to user

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>
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c