CVE-2024-36961: thermal/debugfs: Fix two locking issues with thermal zone debug
In the Linux kernel, the following vulnerability has been resolved:
thermal/debugfs: Fix two locking issues with thermal zone debug
The Linux kernel CVE team has assigned CVE-2024-36961 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024060344-CVE-2024-36961-58bb@gregkh/T
Other sources
In the Linux kernel, the following vulnerability has been resolved:
thermal/debugfs: Fix two locking issues with thermal zone debug
With the current thermal zone locking arrangement in the debugfs code, user space can open the "mitigations" file for a thermal zone before the zone's debugfs pointer is set which will result in a NULL pointer dereference in tzeseqstart().
Moreover, thermaldebugtzremove() is not called under the thermal zone lock, so it can run in parallel with the other functions accessing the thermal zone's struct thermaldebugfs object. Then, it may clear tz->debugfs after one of those functions has checked it and the struct thermaldebugfs object may be freed prematurely.
To address the first problem, pass a pointer to the thermal zone's struct thermaldebugfs object to debugfscreatefile() in thermaldebugtzadd() and make tzeseqstart(), tzeseqnext(), tzeseqstop(), and tzeseqshow() retrieve it from s->private instead of a pointer to the thermal zone object. This will ensure that tzdebugfs will be valid across the "mitigations" file accesses until thermaldebugfsremoveid() called by thermaldebugtzremove() removes that file.
To address the second problem, use tz->lock in thermaldebugtzremove() around the tz->debugfs value check (in case the same thermal zone is removed at the same time in two different threads) and its reset to NULL.
Cc :6.8+ <stable@vger.kernel.org> # 6.8+
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.133-1Fixed in 6.12.22-1Fixed in 6.12.25-1 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.8.10 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.9 - Upgrade
Upgrade
linux-kernelto a version that resolves this vulnerability.Patch CVE-2024-36961
Event History
Frequently Asked Questions
What is the severity of CVE-2024-36961?
CVE-2024-36961 has a moderate severity rating due to the potential impact on thermal zone debugging functions in the Linux kernel.
How do I fix CVE-2024-36961?
To address CVE-2024-36961, update to the recommended kernel versions provided by your distribution's security advisories.
What versions of Linux are affected by CVE-2024-36961?
CVE-2024-36961 affects various versions of the Linux kernel, specifically those prior to 6.8.10 for Red Hat and specific versions for Debian.
Is CVE-2024-36961 a local or remote vulnerability?
CVE-2024-36961 is considered a local vulnerability as it primarily impacts user space interactions with the thermal subsystem.
What components are involved in CVE-2024-36961?
CVE-2024-36961 involves debugging components within the thermal subsystem of the Linux kernel.