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 2EF3F611A for ; Sun, 28 May 2023 19:17:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B04EFC433EF; Sun, 28 May 2023 19:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1685301444; bh=NfjV9ehDFlQJJubqBbkTn1BaQmZxQIud71NXKf6dpWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oymxsmkm5qv7ueayYaGlf4oX7M/nMHZEBG4kn/qv1qH3Vz1ei5Xy5qggNtPiAzkkx vPyzv4hG8Tq4G7allPO+nsOhL1tT98KT5IWUFt4Dgn7IE4hYcSBak4zaAoaLOG3nq1 jTfjD/hvMxcjW6s43KAjwkyXGrlrXTYyQgQaJId0= 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 4.19 032/132] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp Date: Sun, 28 May 2023 20:09:31 +0100 Message-Id: <20230528190834.565617971@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230528190833.565872088@linuxfoundation.org> References: <20230528190833.565872088@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 1a68aad5737e1..94d40a20ab958 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -4392,7 +4392,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