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 AF0F516EC12 for ; Fri, 12 Jul 2024 12:34:14 +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=1720787654; cv=none; b=Z1Pb7AGbBqCNu6EzyeW8zGFujln3RIGzwEFZ4Widu+smKYlavxrjfuCEmt0jM4ur4HQ0m76HYWPURhzY5+zompm6Ms4JM7Nrxhb8WsnyldV/y9EbNwPUkQ52WerENL90ksEN7aDdLYmyo+1bwhNVWqsN78XV4xbeV8dIKuGlnYI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720787654; c=relaxed/simple; bh=G2zKJVTrGPYWYFrZpANL/0tPfv5CEU0YI8ErlEEHa1s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=awaTv7iUdOPTikAUamrR/SZ3s4rb7CwEdf13oTUfqGfyIrPlY+wmW8kuIYGXQZyBcdE61CclNDZGxy7trZ2jJNmuZUuR5Lh0loNECMgorOlxSRE6z5wR5A9mug8FiNq598eUxnn6o6ZL1nwxVCR6eLoJXVRn/F05sipe52eCOHY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oNzK6GJh; 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="oNzK6GJh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36C38C32782; Fri, 12 Jul 2024 12:34:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720787654; bh=G2zKJVTrGPYWYFrZpANL/0tPfv5CEU0YI8ErlEEHa1s=; h=From:To:Cc:Subject:Date:Reply-to:From; b=oNzK6GJhiu1RDnkp2IyURk9bODWT+NVOm45+Ur93XXhBQc0PqWnk/Fxvy4VFxtu5x m3XSnTynwiyXp+pCrSXwZUdJ/znNgnrPKbVqsopQZDEGM/Fj/XBVbfeKRFnfQEA/0e g54/7SwuVepYIoazRcmohM6IQH6bvIkSrowqgp8U= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-40975: platform/x86: x86-android-tablets: Unregister devices in reverse order Date: Fri, 12 Jul 2024 14:32:51 +0200 Message-ID: <2024071230-CVE-2024-40975-f7d8@gregkh> X-Mailer: git-send-email 2.45.2 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=3571; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=G2zKJVTrGPYWYFrZpANL/0tPfv5CEU0YI8ErlEEHa1s=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkTleLKHh898+Rmev7Ww183bObO71UXV+o0j7e6M33v1 MP6/zI5OmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiHh0MC+YpBd6v5AjYyh/5 kTfEy+HXniMzkxjmF0gbmfmYzdLqzPqe1/NO5UyQhLQpAA== 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: platform/x86: x86-android-tablets: Unregister devices in reverse order Not all subsystems support a device getting removed while there are still consumers of the device with a reference to the device. One example of this is the regulator subsystem. If a regulator gets unregistered while there are still drivers holding a reference a WARN() at drivers/regulator/core.c:5829 triggers, e.g.: WARNING: CPU: 1 PID: 1587 at drivers/regulator/core.c:5829 regulator_unregister Hardware name: Intel Corp. VALLEYVIEW C0 PLATFORM/BYT-T FFD8, BIOS BLADE_21.X64.0005.R00.1504101516 FFD8_X64_R_2015_04_10_1516 04/10/2015 RIP: 0010:regulator_unregister Call Trace: regulator_unregister devres_release_group i2c_device_remove device_release_driver_internal bus_remove_device device_del device_unregister x86_android_tablet_remove On the Lenovo Yoga Tablet 2 series the bq24190 charger chip also provides a 5V boost converter output for powering USB devices connected to the micro USB port, the bq24190-charger driver exports this as a Vbus regulator. On the 830 (8") and 1050 ("10") models this regulator is controlled by a platform_device and x86_android_tablet_remove() removes platform_device-s before i2c_clients so the consumer gets removed first. But on the 1380 (13") model there is a lc824206xa micro-USB switch connected over I2C and the extcon driver for that controls the regulator. The bq24190 i2c-client *must* be registered first, because that creates the regulator with the lc824206xa listed as its consumer. If the regulator has not been registered yet the lc824206xa driver will end up getting a dummy regulator. Since in this case both the regulator provider and consumer are I2C devices, the only way to ensure that the consumer is unregistered first is to unregister the I2C devices in reverse order of in which they were created. For consistency and to avoid similar problems in the future change x86_android_tablet_remove() to unregister all device types in reverse order. The Linux kernel CVE team has assigned CVE-2024-40975 to this issue. Affected and fixed versions =========================== Fixed in 6.9.7 with commit f0c982853d66 Fixed in 6.10-rc1 with commit 3de0f2627ef8 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-2024-40975 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: drivers/platform/x86/x86-android-tablets/core.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/f0c982853d665597d17e4995ff479fbbf79a9cf6 https://git.kernel.org/stable/c/3de0f2627ef849735f155c1818247f58404dddfe