]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
chelsio/chtls: fix panic during unload reload chtls
authorVinay Kumar Yadav <vinay.yadav@chelsio.com>
Wed, 25 Nov 2020 21:49:14 +0000 (03:19 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Dec 2020 09:18:55 +0000 (10:18 +0100)
[ Upstream commit e3d5e971d2f83d8ddd4b91a50cea4517fb488383 ]

there is kernel panic in inet_twsk_free() while chtls
module unload when socket is in TIME_WAIT state because
sk_prot_creator was not preserved on connection socket.

Fixes: cc35c88ae4db ("crypto : chtls - CPL handler definition")
Signed-off-by: Udai Sharma <udai.sharma@chelsio.com>
Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
Link: https://lore.kernel.org/r/20201125214913.16938-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_cm.c

index 35116cdb5e389ac3fca69868a5ffaae6b84e3e8f..35d6bd1b309935c7dc3c127d4694b308ab5a676d 100644 (file)
@@ -1079,6 +1079,7 @@ static struct sock *chtls_recv_sock(struct sock *lsk,
 
        oreq->ts_recent = PASS_OPEN_TID_G(ntohl(req->tos_stid));
        sk_setup_caps(newsk, dst);
+       newsk->sk_prot_creator = lsk->sk_prot_creator;
        csk->sk = newsk;
        csk->passive_reap_next = oreq;
        csk->tx_chan = cxgb4_port_chan(ndev);