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 EF8A037058F for ; Tue, 16 Sep 2025 16:15:38 +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=1758039339; cv=none; b=Eq5OFV7bAZq0SU2Ctk12MptVMM+nmLI2B+vu86hd2xEm/tj6f6J+9pKMTmBECiRxY/yZwJpViM5+V7sb8yTbE4iAEj8ugFImp5qOeRW2SrX6jjFH1kNpw09yhzQ2PiJgLoSvTtrZZiCFQRZRnFQCGTz3N77z2PNLIWlEPsVm/Xo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758039339; c=relaxed/simple; bh=To388HHgtogo4RjTxyCmJUXr1QxzxMeqmdgyUmC76MI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LzV0CTjLOa1hmITtU5paqHeHS0EfBM3TfGaJBnwX54ybjfa5IohiSv6aSnkAGjhpKPK1CspxkMDvQC/u1MbYjd18tZPNMefxjeu4Wa8Ryy1zkuZpVX1+wylN0HsV+uSCncYXYTnsBfeZZBkzoaIC7QB+VSU4k2Wp3L0RVRT3rWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0Wx/W3+9; 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="0Wx/W3+9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E9C9C4CEEB; Tue, 16 Sep 2025 16:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758039338; bh=To388HHgtogo4RjTxyCmJUXr1QxzxMeqmdgyUmC76MI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=0Wx/W3+9O3G+Yq0SsroOSuXJFOhdVzdWnSvolRayNWeBTzPyywk/N+Uibs+JLPMoP GCZ2fa0JowKlav1FDOdmQ5hUQGc6WbjZYjJ6VKX7zJdpCTblYlwXaAZR2YxeZfK0cc xNl4XFxhurP/wo2G60H4Roj4DtSQ4x/SI1XblkRI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53310: power: supply: axp288_fuel_gauge: Fix external_power_changed race Date: Tue, 16 Sep 2025 18:11:55 +0200 Message-ID: <2025091642-CVE-2023-53310-8d40@gregkh> X-Mailer: git-send-email 2.51.0 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=2737; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=qb9lDrvkzmCCg+TyMrY9SJkYgNIzorAoEXvI7c+5kjU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkne+xShN5aKAk+nK6vei2+7su6CTOTBZd+87wpXJgof PWH+/opHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjAR1UiG+VXpf7iYDDR57+de Vw9+lGGRLbhgL8Nc6ZenzwUo/Fj6p3v1f9FXhdXr9PfnAQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: power: supply: axp288_fuel_gauge: Fix external_power_changed race fuel_gauge_external_power_changed() dereferences info->bat, which gets sets in axp288_fuel_gauge_probe() like this: info->bat = devm_power_supply_register(dev, &fuel_gauge_desc, &psy_cfg); As soon as devm_power_supply_register() has called device_add() the external_power_changed callback can get called. So there is a window where fuel_gauge_external_power_changed() may get called while info->bat has not been set yet leading to a NULL pointer dereference. Fixing this is easy. The external_power_changed callback gets passed the power_supply which will eventually get stored in info->bat, so fuel_gauge_external_power_changed() can simply directly use the passed in psy argument which is always valid. The Linux kernel CVE team has assigned CVE-2023-53310 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit 30abb3d07929137bf72327560e1595508a692c4e and fixed in 6.1.31 with commit 0456b912121e45b3ef54abe3135e5dcb541f956c Issue introduced in 5.18 with commit 30abb3d07929137bf72327560e1595508a692c4e and fixed in 6.3.5 with commit a636c6ba9ce898207f283271cb28511206ab739b Issue introduced in 5.18 with commit 30abb3d07929137bf72327560e1595508a692c4e and fixed in 6.4 with commit f8319774d6f1567d6e7d03653174ab0c82c5c66d 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-53310 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/power/supply/axp288_fuel_gauge.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/0456b912121e45b3ef54abe3135e5dcb541f956c https://git.kernel.org/stable/c/a636c6ba9ce898207f283271cb28511206ab739b https://git.kernel.org/stable/c/f8319774d6f1567d6e7d03653174ab0c82c5c66d