Skip to content

Commit

Permalink
chelsio/chtls: fix deadlock issue
Browse files Browse the repository at this point in the history
[ Upstream commit 28e9dcd ]

In chtls_pass_establish() we hold child socket lock using bh_lock_sock
and we are again trying bh_lock_sock in add_to_reap_list, causing deadlock.
Remove bh_lock_sock in add_to_reap_list() as lock is already held.

Fixes: cc35c88 ("crypto : chtls - CPL handler definition")
Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
Link: https://lore.kernel.org/r/20201025193538.31112-1-vinay.yadav@chelsio.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
vinaychelsio authored and gregkh committed Nov 1, 2020
1 parent c4fd583 commit 6e3163c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/crypto/chelsio/chtls/chtls_cm.c
Expand Up @@ -1514,7 +1514,6 @@ static void add_to_reap_list(struct sock *sk)
struct chtls_sock *csk = sk->sk_user_data;

local_bh_disable();
bh_lock_sock(sk);
release_tcp_port(sk); /* release the port immediately */

spin_lock(&reap_list_lock);
Expand All @@ -1523,7 +1522,6 @@ static void add_to_reap_list(struct sock *sk)
if (!csk->passive_reap_next)
schedule_work(&reap_task);
spin_unlock(&reap_list_lock);
bh_unlock_sock(sk);
local_bh_enable();
}

Expand Down

0 comments on commit 6e3163c

Please sign in to comment.