CVE-2024-35968: pds_core: Fix pdsc_check_pci_health function to use work thread
In the Linux kernel, the following vulnerability has been resolved:
pdscore: Fix pdsccheckpcihealth function to use work thread
When the driver notices fwstatus == 0xff it tries to perform a PCI reset on itself via pciresetfunction() in the context of the driver's health thread. However, pdscresetprepare calls pdscstophealththread(), which attempts to stop/flush the health thread. This results in a deadlock because the stop/flush will never complete since the driver called pciresetfunction() from the health thread context. Fix by changing the pdsccheckpcihealthfunction() to queue a newly introduced pdscpciresetthread() on the pdsc's work queue.
Unloading the driver in the fwdown/dead state uncovered another issue, which can be seen in the following trace:
WARNING: CPU: 51 PID: 6914 at kernel/workqueue.c:1450 queuework+0x358/0x440 [...] RIP: 0010:queuework+0x358/0x440 [...] Call Trace: <TASK> ? warn+0x85/0x140 ? queuework+0x358/0x440 ? reportbug+0xfc/0x1e0 ? handlebug+0x3f/0x70 ? excinvalidop+0x17/0x70 ? asmexcinvalidop+0x1a/0x20 ? queuework+0x358/0x440 queueworkon+0x28/0x30 pdscdevcmdlocked+0x96/0xe0 [pdscore] pdscdevcmdreset+0x71/0xb0 [pdscore] pdscteardown+0x51/0xe0 [pdscore] pdscremove+0x106/0x200 [pdscore] pcideviceremove+0x37/0xc0 devicereleasedriverinternal+0xae/0x140 driverdetach+0x48/0x90 busremovedriver+0x6d/0xf0 pciunregisterdriver+0x2e/0xa0 pdsccleanupmodule+0x10/0x780 [pdscore] x64sysdeletemodule+0x142/0x2b0 ? syscalltraceenter.isra.18+0x126/0x1a0 dosyscall64+0x3b/0x90 entrySYSCALL64afterhwframe+0x72/0xdc RIP: 0033:0x7fbd9d03a14b [...]
Fix this by preventing the devcmd reset if the FW is not running.
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.135-1Fixed in 6.12.22-1Fixed in 6.12.25-1 - Configuration
Modify pds_core: make pdsc_check_pci_health function queue a newly introduced pdsc_pci_reset_thread() on the pdsc's work queue, so pci_reset_function() is not called from the health thread context (prevents deadlock with pdsc_stop_health_thread() stop/flush).
pds_core (pdsc) pdsc_check_pci_health_function() = queue work to use work thread instead of performing pci_reset_function() from the health thread context - Configuration
Change devcmd reset logic to prevent the devcmd reset if the FW is not running; specifically do not trigger the PCI reset path when fw_status == 0xff.
pds_core (pdsc) devcmd reset gating = prevent devcmd reset when FW is not running (fw_status == 0xff)
Event History
Frequently Asked Questions
What is the severity of CVE-2024-35968?
CVE-2024-35968 has a moderate severity rating that could potentially lead to performance issues or system instability in the Linux kernel.
How do I fix CVE-2024-35968?
To remediate CVE-2024-35968, upgrade to the latest patched version of the Linux kernel such as 6.12.17 or equivalent.
Which versions of the Linux kernel are affected by CVE-2024-35968?
CVE-2024-35968 affects Linux kernel versions between 6.6.16 and 6.8.7, including specific release candidates.
Is there a workaround for CVE-2024-35968 if I can't upgrade?
Currently, there are no specific workarounds recommended for CVE-2024-35968 other than applying the available patches.
What should I do if I encounter symptoms related to CVE-2024-35968?
If you experience performance issues or instability potentially linked to CVE-2024-35968, it is advisable to update your kernel immediately.