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 21328611A for ; Sun, 28 May 2023 19:14:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4A33C433EF; Sun, 28 May 2023 19:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1685301276; bh=XK2jckxn7goA5rrfx5GMbq6wI1FUq3RW3PpLAeR04DA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e4wRmWZsFnlose53smdi3AfHGm7cHD9U3lxZYJ9Iu/QKnnF1c/pqsAHqusV3ijK3O Hb4I1uVspylKhag5VHfCMylSBo35en/xNejrnMI0FfJy6iHYVdIUf6PX38F0GPwLBR r+wo9TQX9ZLUfBd+E94hdYle3wP5oLQho9+A0SAs= 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.14 24/86] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp Date: Sun, 28 May 2023 20:09:58 +0100 Message-Id: <20230528190829.453022139@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230528190828.564682883@linuxfoundation.org> References: <20230528190828.564682883@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 6f47cb69775d6..b0bb4cf52a7ee 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