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 4D3BC145355 for ; Tue, 21 May 2024 15:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305856; cv=none; b=mDXOVrfDNR84rLrv2SQPxNx/pHJLH808ZrcH3/ajSqT/cofa6jRPLBSiMdR2s1jWsk6VyrcKQD9ULJ5hQOTUOHqBMwCZo5unMCziCTZ/NjIUMmUQmXZjsdqlBsiKbMhAX+PVA03zjc/V0ouhomMeEZwGzxZ4EvWy8v0vD6xyR/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305856; c=relaxed/simple; bh=7QEevXk1FVJgNXZ2RpJcYV+w4ryWrhd0vtUWkZALXTo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=brTLmjNb/MiaCxnCXRBAPMD9u15TEFPP6IosoolQrfW7Zx/wwNMoLfuD2Cjha3EoYybA41nNp3UGX4DU8kvjdz5870dGfAkoyH0L7EVO4Fmco9GvFAG8QQkIgP2GU13xPdxmjoAhdNaE6hpOVo++7VyETQ6LZg+w/JbEQf1UgmU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=j9TdW7A5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="j9TdW7A5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C97DCC2BD11; Tue, 21 May 2024 15:37:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716305856; bh=7QEevXk1FVJgNXZ2RpJcYV+w4ryWrhd0vtUWkZALXTo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=j9TdW7A5KH+TI82PAXnvRBON6lRwBuV0TDXlhoppLKCNO2LI94F9i/flBFOCk9P0Y DzJhDZm2Dq8Iv8BuiLV+5kLhT7BhlRIVRwwcSenBTf5LVDy+kZxtiZVir9kW2Za2hK 31CB2JpYsOw0AB3XJxoe+bhKgQqF5aBwpg52hnQU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52830: Bluetooth: Fix double free in hci_conn_cleanup Date: Tue, 21 May 2024 17:32:06 +0200 Message-ID: <2024052108-CVE-2023-52830-529a@gregkh> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3182; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=7QEevXk1FVJgNXZ2RpJcYV+w4ryWrhd0vtUWkZALXTo=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk++2ws+0PKAx6JcLGvkuMKeR9ke3/WufV8d87q9+QL3 HW03STREcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABN5nskwv+jc83dZLe+7TPwV +jy+XdRRY3LsZ1jQyWD3n2tPu9C6Z/c/MkzSP/Fq+3Y2AA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: Bluetooth: Fix double free in hci_conn_cleanup syzbot reports a slab use-after-free in hci_conn_hash_flush [1]. After releasing an object using hci_conn_del_sysfs in the hci_conn_cleanup function, releasing the same object again using the hci_dev_put and hci_conn_put functions causes a double free. Here's a simplified flow: hci_conn_del_sysfs: hci_dev_put put_device kobject_put kref_put kobject_release kobject_cleanup kfree_const kfree(name) hci_dev_put: ... kfree(name) hci_conn_put: put_device ... kfree(name) This patch drop the hci_dev_put and hci_conn_put function call in hci_conn_cleanup function, because the object is freed in hci_conn_del_sysfs function. This patch also fixes the refcounting in hci_conn_add_sysfs() and hci_conn_del_sysfs() to take into account device_add() failures. This fixes CVE-2023-28464. The Linux kernel CVE team has assigned CVE-2023-52830 to this issue. Affected and fixed versions =========================== Fixed in 4.19.300 with commit 5c53afc766e0 Fixed in 5.4.262 with commit 3c4236f1b2a7 Fixed in 5.10.202 with commit 53d61daf35b1 Fixed in 5.15.140 with commit ba7088769800 Fixed in 6.1.64 with commit 87624b1f9b78 Fixed in 6.5.13 with commit fc666d1b4751 Fixed in 6.6.3 with commit 56a4fdde95ed Fixed in 6.7 with commit a85fb91e3d72 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-52830 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/bluetooth/hci_conn.c net/bluetooth/hci_sysfs.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/5c53afc766e07098429520b7677eaa164b593451 https://git.kernel.org/stable/c/3c4236f1b2a715e878a06599fa8b0cc21f165d28 https://git.kernel.org/stable/c/53d61daf35b1bbf3ae06e852ee107aa2f05b3776 https://git.kernel.org/stable/c/ba7088769800d9892a7e4f35c3137a5b3e65410b https://git.kernel.org/stable/c/87624b1f9b781549e69f92db7ede012a21cec275 https://git.kernel.org/stable/c/fc666d1b47518a18519241cae213de1babd4a4ba https://git.kernel.org/stable/c/56a4fdde95ed98d864611155f6728983e199e198 https://git.kernel.org/stable/c/a85fb91e3d728bdfc80833167e8162cce8bc7004