From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 94FCD391E51; Sat, 17 Oct 2026 17:05:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792256740; cv=none; b=ivz96zI92itoFQ0MWUQ8qd5ELDeDtzTjRCtxd9R47Sy+BEIkLSLEbdED+9dLmHLelf3moXOKlP18LepxohC1ITbfA/9DCgzB0kRl6qJpVPSwsLRVtkfLgwqBN9wXlvRn8J8jCjp3U6ieE1s0w4y5ctivhrGsM8l0Hb9UNijvc08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792256740; c=relaxed/simple; bh=SBfc5s3z9/lzEd/hUCfVdUW7xHYiXXRKgtms0LLUa5M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hM3Ks8d28v/VzD4dwmS4CtkkCS3I3XqACWMlQtUGaCZ73lo1tetfAYUi/nr9+WljE7M1BmBD0HBgDEdavTYuaSCnRYVQUBxiTLAdqdvVuJsOLtMVURCgSeJXU3aN9Cxayw7rzi8qYEFqKAOx5dU1GJsAHYHDiDiBBDCLCc81AeQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=G+KDavyd; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="G+KDavyd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC04F1F000C4; Sat, 17 Oct 2026 17:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792256739; bh=YhNg3DtUxbC3IBCpQ4wxcxkGPFnAgSPY17giSDkr9HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=G+KDavydQlnfIjL0Gh7CbMYeNut2qeFWFRHifl0KfpNXYf9l7XvxQ8FBo6h8NOLD9 f5mwDGHx4DVtdu6io42kMbz3f4nfYoXSEcGI7omYWuvROVlpsik/7q7DpDYQPV2i79 dEQQ2XIPtzhbBm2NHXOt1BYQOaphZ0xjf4FKXws8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Chengfeng Ye , Luiz Augusto von Dentz Subject: [PATCH 6.6 0299/1674] Bluetooth: hci_core: Serialize fragmented ISO packet queueing Date: Sat, 17 Oct 2026 17:42:51 +0200 Message-ID: <20261017160438.794837438@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160431.119607952@linuxfoundation.org> References: <20261017160431.119607952@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chengfeng Ye commit 1a572db43c057566771b485598ad2e66cb390821 upstream. The fragmented path in hci_queue_iso() calls __skb_queue_tail() without holding conn->data_q.lock. The socket lock serializes senders, but the transmit worker can concurrently remove packets from this queue using skb_dequeue(). After an insertion saves the old tail pointer, hci_sched_iso() can dequeue that packet and pass it to the driver. The driver can free the packet before the insertion resumes and writes to the old tail's next pointer, causing a use-after-free. Concurrent updates can also corrupt the queue. KASAN reported: BUG: KASAN: slab-use-after-free in hci_send_iso+0xc7d/0xe10 Call Trace: hci_send_iso+0xc7d/0xe10 iso_sock_sendmsg+0x710/0x900 __sys_sendto+0x34a/0x3a0 Allocated by task 86: __alloc_skb+0xdd/0x820 alloc_skb_with_frags+0x7e/0x770 sock_alloc_send_pskb+0x67a/0x820 bt_skb_sendmsg.constprop.0+0xc0/0x6c0 iso_sock_sendmsg+0x44e/0x900 Freed by task 90: kmem_cache_free+0xcb/0x3d0 vhci_read+0x33f/0x4d0 vfs_read+0x177/0xa20 Hold the queue lock across the entire fragment batch, as hci_queue_acl() does, to serialize insertion against dequeue while preserving fragment ordering. Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") Cc: stable@vger.kernel.org Signed-off-by: Chengfeng Ye Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/hci_core.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3296,6 +3296,8 @@ static void hci_queue_iso(struct hci_con skb_shinfo(skb)->frag_list = NULL; + spin_lock_bh(&queue->lock); + __skb_queue_tail(queue, skb); do { @@ -3310,6 +3312,8 @@ static void hci_queue_iso(struct hci_con __skb_queue_tail(queue, skb); } while (list); + + spin_unlock_bh(&queue->lock); } }