[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <YJunyKKpMGnT/Ms/@mwanda>
Date: Wed, 12 May 2021 13:02:48 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Ayush Sawal <ayush.sawal@...lsio.com>,
Rohit Maheshwari <rohitm@...lsio.com>
Cc: Vinay Kumar Yadav <vinay.yadav@...lsio.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH net] chelsio/chtls: unlock on error in chtls_pt_recvmsg()
This error path needs to release some memory and call release_sock(sk);
before returning.
Fixes: 6919a8264a32 ("Crypto/chtls: add/delete TLS header in driver")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c | 6 ++++--
1 file changed, 4 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 188d871f6b8c..c320cc8ca68d 100644
--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
+++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
@@ -1564,8 +1564,10 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
cerr = put_cmsg(msg, SOL_TLS, TLS_GET_RECORD_TYPE,
sizeof(thdr->type), &thdr->type);
- if (cerr && thdr->type != TLS_RECORD_TYPE_DATA)
- return -EIO;
+ if (cerr && thdr->type != TLS_RECORD_TYPE_DATA) {
+ copied = -EIO;
+ break;
+ }
/* don't send tls header, skip copy */
goto skip_copy;
}
--
2.30.2
Powered by blists - more mailing lists