From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04F0F171A1 for ; Mon, 22 May 2023 19:15:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7487EC433D2; Mon, 22 May 2023 19:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684782928; bh=EfgmZvaJyLYUFwhi4Ji+9XYIRtmquCM7KCGk7HAPPJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nzMhiV3DlKlkE6UxD+g6vcu5GXG1iq5cfmt1jJyxw4e1elwmv7eMqAYCrkhj4uKsg SLNq0DhtN4Rekj0fI2PKN8hiMac+1iLy1MlOMV7/9oOhO/tDbGnCXz6eKrriNPV7G3 VERuQoUnXuA6pRznh7aBl23w+5FLlxFZMT0EuBZw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+9519d6b5b79cf7787cf3@syzkaller.appspotmail.com, Min Li , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 5.15 077/203] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp Date: Mon, 22 May 2023 20:08:21 +0100 Message-Id: <20230522190357.121225701@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230522190354.935300867@linuxfoundation.org> References: <20230522190354.935300867@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Min Li [ Upstream commit 25e97f7b1866e6b8503be349eeea44bb52d661ce ] conn->chan_lock isn't acquired before l2cap_get_chan_by_scid, if l2cap_get_chan_by_scid returns NULL, then 'bad unlock balance' is triggered. Reported-by: syzbot+9519d6b5b79cf7787cf3@syzkaller.appspotmail.com Link: https://lore.kernel.org/all/000000000000894f5f05f95e9f4d@google.com/ Signed-off-by: Min Li Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- net/bluetooth/l2cap_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 446343348329f..f01b77b037878 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -4694,7 +4694,6 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, chan = l2cap_get_chan_by_scid(conn, scid); if (!chan) { - mutex_unlock(&conn->chan_lock); return 0; } -- 2.39.2