From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388533; b=XvhJ7wCyfvh2kmW5LzXuBCjK5oj8HqaIAlcnIYLWyWauJygVHMA0K169VPk1PwklLiqC RnWC87pWApbXalSLy2UHNvvw1GwAWyugYoU3nO0jzjJETGVXZXoQqtYofB+fqf7jjnFmd S+jvRREgztnLDMMAE339IFD0rNnAN0rzI2ghRyxe08VIivY3mVCUAxasDEaU+XUVGLfoA EUG/SZpxdlT3fn82fd4US7yX5UgUjaxuIfua52RxAaZiLEzrCe37Vo1Rv5dzsIKUeS8rt bEHiSsGwifcndRzbbCBqJ5vfjxuEUpn9c7Najx/RxvRCwAUMaER0w3KQARfTftRu5XQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388533; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=48Si2Ic14VAWNYkbxqzgTQG6kFLWyCkyppt3E4nVQH8=; b=TW7yA5uM8FDgC3roOre6n1iJH+FXhx2ctHghju/V1jUxdIPNr3WoXuLdRu3FMgE2IiJf bbBX/QGLJfVqBczs4Op9VWdkFPUIZUdK0dXzWY23gcq6Gzj6QUBXvDaB3ADuxV6senjRF WTs2OgFNYguLaww3DiFA2iXaID2bTtXuO09AVv3hobM/kUJONF3FK2ivjvG7Ml6ufuTdU LX6UTAU5PtS3zhdcN9nytRIsGkx9BzhdW7tBAOorKrSDaHlj2xl88r+VjzOlrBASX8+JZ ks2m6t6uSFIZHhW1J7Rb8I/QA3XejWx29jDfITTfE+K2HahT/HBAjUIfQP+JdesUa4w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Ip7i1OBE; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15A01606A322; Fri, 4 Dec 2026 12:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Ip7i1OBE Received: by smtp.kernel.org (Postfix) with ESMTPSA id 879671F000C2; Fri, 4 Dec 2026 12:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388532; bh=48Si2Ic14VAWNYkbxqzgTQG6kFLWyCkyppt3E4nVQH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ip7i1OBETW0KTCu/lnEAM2e8zOnIrTSGnTwrOW8MQKOSm+7icCRv6o3NePhIIxcDq N+omPgXcAR1LH//UakXGQ4t1p/9wQBoTdIRTLEqtbQpjPU5pLCHjo2ZCNrzkGkhd6Q B6F0Ybn0qkIJAB34SRikCrxslW1Q+ZtigMeYMu2Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pauli Virtanen , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.1 0653/1059] Bluetooth: L2CAP: hold l2cap_conn::lock in l2cap_connect_cfm() Date: Fri, 4 Dec 2026 19:03:04 +0900 Message-ID: <20261204100700.971594534@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pauli Virtanen [ Upstream commit 115e6a21c88a5f708b2b025f7567ab78a782a74f ] l2cap_new_connection() -> __l2cap_chan_add() modifies l2cap_conn::chan_l, which is guarded by l2cap_conn::lock. The lock is not held in l2cap_connect_cfm(). Fix by holding conn->lock in l2cap_connect_cfm() to make the locking systematic. Fixes: ab4eedb790ca ("Bluetooth: L2CAP: Fix corrupted list in hci_chan_del") Signed-off-by: Pauli Virtanen Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- net/bluetooth/l2cap_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 127c50ffba9b3..a9cfdae8ca935 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -7645,6 +7645,8 @@ static void l2cap_connect_cfm(struct hci_conn *hcon, u8 status) * we left off, because the list lock would prevent calling the * potentially sleeping l2cap_chan_lock() function. */ + mutex_lock(&conn->lock); + pchan = l2cap_global_fixed_chan(NULL, hcon); while (pchan) { struct l2cap_chan *chan, *next; @@ -7669,6 +7671,8 @@ static void l2cap_connect_cfm(struct hci_conn *hcon, u8 status) pchan = next; } + mutex_unlock(&conn->lock); + l2cap_conn_ready(conn); } -- 2.53.0