提交 da1a039b 编写于 作者: V Vinay Kumar Yadav 提交者: Jakub Kicinski

chelsio/chtls: fix writing freed memory

When chtls_sock *csk is freed, same memory can be allocated
to different csk in chtls_sock_create().
csk->cdev = NULL; statement might ends up modifying wrong
csk, eventually causing kernel panic.
removing (csk->cdev = NULL) statement as it is not required.

Fixes: 3a0a9783 ("crypto/chtls: Fix chtls crash in connection cleanup")
Signed-off-by: NVinay Kumar Yadav <vinay.yadav@chelsio.com>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
上级 8580a61a
...@@ -483,7 +483,6 @@ void chtls_destroy_sock(struct sock *sk) ...@@ -483,7 +483,6 @@ void chtls_destroy_sock(struct sock *sk)
chtls_purge_write_queue(sk); chtls_purge_write_queue(sk);
free_tls_keyid(sk); free_tls_keyid(sk);
kref_put(&csk->kref, chtls_sock_release); kref_put(&csk->kref, chtls_sock_release);
csk->cdev = NULL;
if (sk->sk_family == AF_INET) if (sk->sk_family == AF_INET)
sk->sk_prot = &tcp_prot; sk->sk_prot = &tcp_prot;
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册