From patchwork Tue Nov 3 20:34:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 316951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41580C388F7 for ; Tue, 3 Nov 2020 21:25:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E56E220757 for ; Tue, 3 Nov 2020 21:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604438720; bh=E9z3aHlxsNKSjY5o5d6slDJGnezVSrMBFH3spSDm8Ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Q0pJ3qYhZzXyIfU0FPhwIZ4UPaBQ0PsVw5xhs5msaRwJUgwOh+8ZdnShbfacMs47Q RWtxI8+Pon3hOnZieNtgfXyheWZYHhcjckc4wqeOnrTKxrOgZvTVDlHtBvF1BMPrKH byqw3N+4vgomMzlWw5rSjAf3l+XZY/mRtQaFwiKQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387845AbgKCVZT (ORCPT ); Tue, 3 Nov 2020 16:25:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:39930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387681AbgKCVCn (ORCPT ); Tue, 3 Nov 2020 16:02:43 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 835B120658; Tue, 3 Nov 2020 21:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437363; bh=E9z3aHlxsNKSjY5o5d6slDJGnezVSrMBFH3spSDm8Ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jDGDRzWcJcj0JJ0gJ4hs8Fh92EmrARfxT7dJTnATJTkKzJxlC0LEMeA6/XBTxpZMi r4JQl7/fJYkPlAkYWTP+J/2H65rjE9ePkfAxwpsVEiV82A2mdEa5mXnkwRRjvsSmv7 brcduNYxrg57J9pO3Sk5bnq1hRjruYDoFjAkOdzI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinay Kumar Yadav , Jakub Kicinski Subject: [PATCH 4.19 007/191] chelsio/chtls: fix deadlock issue Date: Tue, 3 Nov 2020 21:34:59 +0100 Message-Id: <20201103203233.613602306@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vinay Kumar Yadav [ Upstream commit 28e9dcd9172028263c8225c15c4e329e08475e89 ] 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: cc35c88ae4db ("crypto : chtls - CPL handler definition") Signed-off-by: Vinay Kumar Yadav Link: https://lore.kernel.org/r/20201025193538.31112-1-vinay.yadav@chelsio.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/chelsio/chtls/chtls_cm.c | 2 -- 1 file changed, 2 deletions(-) --- a/drivers/crypto/chelsio/chtls/chtls_cm.c +++ b/drivers/crypto/chelsio/chtls/chtls_cm.c @@ -1348,7 +1348,6 @@ static void add_to_reap_list(struct sock 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); @@ -1357,7 +1356,6 @@ static void add_to_reap_list(struct sock if (!csk->passive_reap_next) schedule_work(&reap_task); spin_unlock(&reap_list_lock); - bh_unlock_sock(sk); local_bh_enable(); }