Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6371203pxv; Thu, 29 Jul 2021 12:54:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOL83l0inJQfFRVuXHb64mB8tLhu2KTXootOY8W9Ep4i+6jmxH+BKZE8IQpSxQTQ42EZ8Q X-Received: by 2002:a5d:8996:: with SMTP id m22mr5318535iol.6.1627588487269; Thu, 29 Jul 2021 12:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627588487; cv=none; d=google.com; s=arc-20160816; b=EwnZgbNmBaR0sLmcdxOl0RTIV808EAIwee9uUsi/OVYudBRazlCCWzGPlbOvEgLtgI pueeE2oggk3E8yxCJkj0K7TuLYGJNQjIZoBKX2V2oVILXtdqEiGO9qQaLTyz205gI8vQ N9Fyw19xMaNxA9NI8z13rJicBiHf3ONjR1doEuvnqVoldH8hC9d3VWQPhS1xst3EQhWx FvP+1fO1BamPx5Taaz7cRTaVL1DxRWgDh/12bTAZWUh33fnSujnmsHO5n6/ANJxUI46+ ATkJuwUeCxY49/C5Zp5dNlJeUwszBrDf/yyfeiXDpol3Eptnl24HDyiA7QviqPCcSn3a nTQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=YrEEkYCLo3M/PuVAZ+Vr8rsIAdgRagvFbTdW3mYwe0c=; b=d5o51bW/BnD9h8OrL2cYm3UzIK9AQO84QoXlKo5rvSR5hjYqU2UAeX2Ycx6eTol4mj dTPoNmw9JoWI1B3J917YWydGAC/lQN7ur+C+r8tx1bmpuSqgqAuSLmoLcR4sQDRCA+vw dSsIO097B38jLKcAirIzUA3HDC1uezAVvj0Dsy1NSG5r/r7WRcNQIyZ3FraL/LtFQlMw kO77bkKcJ4n6zlthCoKJqUcamec2uGktKoTjNcdEKPYt6OqeROf5G1EW5QAxKxS+zTxB mKI4k2OSBv9SGf+1rAAjVxaTyEw2u7gYOv2GvX2mvqoULnzAMRsEkLXy8gv+QrXZRuU+ xVJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si4672993ilu.14.2021.07.29.12.54.33; Thu, 29 Jul 2021 12:54:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229735AbhG2TxZ convert rfc822-to-8bit (ORCPT + 99 others); Thu, 29 Jul 2021 15:53:25 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:54829 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbhG2TxY (ORCPT ); Thu, 29 Jul 2021 15:53:24 -0400 Received: from smtpclient.apple (p5b3d23f8.dip0.t-ipconnect.de [91.61.35.248]) by mail.holtmann.org (Postfix) with ESMTPSA id 994FFCED1E; Thu, 29 Jul 2021 21:53:19 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: [PATCH v3 2/2] Bluetooth: fix inconsistent lock state in rfcomm_connect_ind From: Marcel Holtmann In-Reply-To: <20210721093832.78081-3-desmondcheongzx@gmail.com> Date: Thu, 29 Jul 2021 21:53:19 +0200 Cc: Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Jakub Kicinski , Matthieu Baerts , Stefan Schmidt , linux-bluetooth , "open list:NETWORKING [GENERAL]" , open list , skhan@linuxfoundation.org, Greg Kroah-Hartman , linux-kernel-mentees@lists.linuxfoundation.org Content-Transfer-Encoding: 8BIT Message-Id: <06E57598-5723-459D-9CE3-4DD8D3145D86@holtmann.org> References: <20210721093832.78081-1-desmondcheongzx@gmail.com> <20210721093832.78081-3-desmondcheongzx@gmail.com> To: Desmond Cheong Zhi Xi X-Mailer: Apple Mail (2.3654.100.0.2.22) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Desmond, > Commit fad003b6c8e3d ("Bluetooth: Fix inconsistent lock state with > RFCOMM") fixed a lockdep warning due to sk->sk_lock.slock being > acquired without disabling softirq while the lock is also used in > softirq context. This was done by disabling interrupts before calling > bh_lock_sock in rfcomm_sk_state_change. > > Later, this was changed in commit e6da0edc24ee ("Bluetooth: Acquire > sk_lock.slock without disabling interrupts") to disable softirqs > only. > > However, there is another instance of sk->sk_lock.slock being acquired > without disabling softirq in rfcomm_connect_ind. This patch fixes this > by disabling local bh before the call to bh_lock_sock. back in the days, the packet processing was done in a tasklet, but these days it is done in a workqueue. So shouldn’t this be just converted into a lock_sock(). Am I missing something? Regards Marcel