In the Linux kernel, the following vulnerability has been resolved:
thermal: core: call putdevice() only after deviceregister() fails
putdevice() shouldn't be called before a prior call to deviceregister(). _thermalcoolingdeviceregister() doesn't follow that properly and needs fixing. Also thermalcoolingdevicedestroysysfs() is getting called unnecessarily on few error paths.
Fix all this by placing the calls at the right place.
Based on initial work done by Caleb Connolly.
[ { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2846a7412f6246fd5171f51011bf76dfebcec0ee", "target": { "file": "drivers/thermal/thermal_core.c" }, "signature_type": "Line", "deprecated": false, "digest": { "line_hashes": [ "225473092673254236156490147909662066642", "120721697035180907146148569999773962742", "267351938578111763933992043176068767092", "214443950284950398100090344872907329678", "113463597761268244078483942766530007831", "200039613525190514699015919293518523079", "141005992226772385263879959210522526632", "86601813211580242797021144541844960350", "177780585314492683489847070029657009259", "97596566609780518461377976301072401873", "10642474066886626710974778764121598609", "264780755843295822094563628568098754500", "298792139989680829559535720053308719340", "55943795548143188538843312571782686569", "324514261220453714232809088550261105343" ], "threshold": 0.9 }, "signature_version": "v1", "id": "CVE-2023-53012-3075633d" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2846a7412f6246fd5171f51011bf76dfebcec0ee", "target": { "function": "__thermal_cooling_device_register", "file": "drivers/thermal/thermal_core.c" }, "signature_type": "Function", "deprecated": false, "digest": { "function_hash": "277683336238622767671890286677340168099", "length": 1755.0 }, "signature_version": "v1", "id": "CVE-2023-53012-3884ad78" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a7d736cc3c6cb0d7498bbfb56515d414e35e9510", "target": { "function": "__thermal_cooling_device_register", "file": "drivers/thermal/thermal_core.c" }, "signature_type": "Function", "deprecated": false, "digest": { "function_hash": "236131459333629517567293778233680771979", "length": 1763.0 }, "signature_version": "v1", "id": "CVE-2023-53012-6491a143" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6c54b7bc8a31ce0f7cc7f8deef05067df414f1d8", "target": { "file": "drivers/thermal/thermal_core.c" }, "signature_type": "Line", "deprecated": false, "digest": { "line_hashes": [ "225473092673254236156490147909662066642", "120721697035180907146148569999773962742", "267351938578111763933992043176068767092", "214443950284950398100090344872907329678", "113463597761268244078483942766530007831", "200039613525190514699015919293518523079", "141005992226772385263879959210522526632", "86601813211580242797021144541844960350", "177780585314492683489847070029657009259", "97596566609780518461377976301072401873", "10642474066886626710974778764121598609", "264780755843295822094563628568098754500", "298792139989680829559535720053308719340", "55943795548143188538843312571782686569", "324514261220453714232809088550261105343" ], "threshold": 0.9 }, "signature_version": "v1", "id": "CVE-2023-53012-746d2472" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a7d736cc3c6cb0d7498bbfb56515d414e35e9510", "target": { "file": "drivers/thermal/thermal_core.c" }, "signature_type": "Line", "deprecated": false, "digest": { "line_hashes": [ "225473092673254236156490147909662066642", "120721697035180907146148569999773962742", "267351938578111763933992043176068767092", "214443950284950398100090344872907329678", "113463597761268244078483942766530007831", "200039613525190514699015919293518523079", "141005992226772385263879959210522526632", "86601813211580242797021144541844960350", "177780585314492683489847070029657009259", "97596566609780518461377976301072401873", "10642474066886626710974778764121598609", "264780755843295822094563628568098754500", "298792139989680829559535720053308719340", "55943795548143188538843312571782686569", "75374352963463764075465696637078791814" ], "threshold": 0.9 }, "signature_version": "v1", "id": "CVE-2023-53012-b3ef6cc5" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6c54b7bc8a31ce0f7cc7f8deef05067df414f1d8", "target": { "function": "__thermal_cooling_device_register", "file": "drivers/thermal/thermal_core.c" }, "signature_type": "Function", "deprecated": false, "digest": { "function_hash": "277683336238622767671890286677340168099", "length": 1755.0 }, "signature_version": "v1", "id": "CVE-2023-53012-d4ba2463" } ]