From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp153-168.sina.com.cn (smtp153-168.sina.com.cn [61.135.153.168]) (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 38971389460 for ; Sat, 16 May 2026 22:40:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=61.135.153.168 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778971224; cv=none; b=GeQjxhbtiXShW9KWFfYZUfzdz3+q58UV9vaiJ0418ILC8vb8Jj5XmVuEJful6iNsfrioazmd+xdsAUIK36WECf/8lKPISI2NZmDn2dLyAp67eYsYcLGKXLI7ziTyr+bIZ5RZ0XEK4jzLLWmp68sW+bUxU/L4GYbQOA+pziPsnQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778971224; c=relaxed/simple; bh=MDwqzzPxpTpr7wvYUP7Ufir6bdMVkAztbi1Zb4r8XeM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cxa5BMuuhLUvV572ZlqnU4EIG/nrwWJ8B1nCJ3Ro0ZhqpGVLGJ8c+JTA27dyQ+ZYkHLOckXK4y6nBa8wuiKzjc31hAvONfuQJIKtxLg02TiXTLcOqG0lf4uNKnrel6sTqKKJIXI54FNSsOEH9PvYXtwFGk2uIVssWqFONW4oYiQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b=RGhm0WWw; arc=none smtp.client-ip=61.135.153.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b="RGhm0WWw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1778971217; bh=6+dytzmVokVDStxNbKqqHM9kTlgMW+5d48+NzqFuckA=; h=From:Subject:Date:Message-ID; b=RGhm0WWw657DQHfQ79YK3aQuQhWknd5KNBNi5IHfwEaDc46kOG2J92JP2ZSr/KI6N 7mqBqeVT3io0W9LAyuWE+Wp+W00NfHhHWjQAIGZkB3z7swJVHsiGVTYUV2CuSQuZbr qa5QEKnoxtyDiMRP98bMnzBjpZfzw6AZK4aqsdOg= X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([114.249.62.144]) by sina.com (10.54.253.33) with ESMTP id 6A08F24B00002E91; Sat, 17 May 2026 06:40:13 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 2650226685180 X-SMAIL-UIID: B2818D37D17A480695A921A8E0DDA772-20260517-064013-1 From: Hillf Danton To: Safa Karakus Cc: linux-bluetooth@vger.kernel.org, Luiz Augusto von Dentz , Marcel Holtmann , stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] Bluetooth: fix UAF in l2cap_sock_cleanup_listen() vs l2cap_conn_del() Date: Sun, 17 May 2026 06:40:00 +0800 Message-ID: <20260516224002.754-1-hdanton@sina.com> In-Reply-To: <20260516181504.3076260-1-safa.karakus@secunnix.com> References: <20260516092139.2618159-1-safa.karakus@secunnix.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Sat, 16 May 2026 21:15:04 +0300 Safa Karakus wrote: > bt_accept_dequeue() unlinks a not-yet-accepted child from the parent > accept queue and release_sock()s it before returning, so the returned > sk has no caller reference and is unlocked. > > l2cap_sock_cleanup_listen() walks these children on listening-socket > close. A concurrent HCI disconnect drives hci_rx_work -> > l2cap_conn_del() which runs l2cap_chan_del() + l2cap_sock_kill() and > frees the child sk and its l2cap_chan; cleanup_listen() then uses both: > > BUG: KASAN: slab-use-after-free in l2cap_sock_kill > l2cap_sock_kill / l2cap_sock_cleanup_listen / __x64_sys_close > Freed by: l2cap_conn_del -> l2cap_sock_close_cb -> l2cap_sock_kill > Feel free to add the regular KASAN uaf calltrace to help understand your fix.