{"id":"CVE-2024-36961","published":"2024-06-03T07:49:59Z","modified":"2026-08-05T11:32:15Z","title":"thermal/debugfs: Fix two locking issues with thermal zone debug","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nthermal/debugfs: Fix two locking issues with thermal zone debug\n\nWith the current thermal zone locking arrangement in the debugfs code,\nuser space can open the \"mitigations\" file for a thermal zone before\nthe zone's debugfs pointer is set which will result in a NULL pointer\ndereference in tze_seq_start().\n\nMoreover, thermal_debug_tz_remove() is not called under the thermal\nzone lock, so it can run in parallel with the other functions accessing\nthe thermal zone's struct thermal_debugfs object.  Then, it may clear\ntz->debugfs after one of those functions has checked it and the\nstruct thermal_debugfs object may be freed prematurely.\n\nTo address the first problem, pass a pointer to the thermal zone's\nstruct thermal_debugfs object to debugfs_create_file() in\nthermal_debug_tz_add() and make tze_seq_start(), tze_seq_next(),\ntze_seq_stop(), and tze_seq_show() retrieve it from s->private\ninstead of a pointer to the thermal zone object.  This will ensure\nthat tz_debugfs will be valid across the \"mitigations\" file accesses\nuntil thermal_debugfs_remove_id() called by thermal_debug_tz_remove()\nremoves that file.\n\nTo address the second problem, use tz->lock in thermal_debug_tz_remove()\naround the tz->debugfs value check (in case the same thermal zone is\nremoved at the same time in two different threads) and its reset to NULL.\n\nCc :6.8+ <stable@vger.kernel.org> # 6.8+","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00219,"percentile":0.07144,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/6c57bdd0505422d5ccd2df541d993aec978c842e","tags":[]},{"url":"https://git.kernel.org/stable/c/c7f7c37271787a7f77d7eedc132b0b419a76b4c8","tags":[]}],"priority":{"score":6.9,"factors":[{"name":"EPSS percentile","points":1.43},{"name":"CVSS severity","points":5.46}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 7ef01f228c9f54c6260319858be138a8a7e9e704, < 6c57bdd0505422d5ccd2df541d993aec978c842e",">= 7ef01f228c9f54c6260319858be138a8a7e9e704, < c7f7c37271787a7f77d7eedc132b0b419a76b4c8"]},{"vendor":"Linux","product":"Linux","versions":["6.8"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-09-10T17:15:32.309097Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2024-36311","exploited":false,"provenance":"source"}}