CVE-2024-50019: kthread: unpark only parked kthread
In the Linux kernel, the following vulnerability has been resolved:
kthread: unpark only parked kthread
Calling into kthread unparking unconditionally is mostly harmless when the kthread is already unparked. The wake up is then simply ignored because the target is not in TASKPARKED state.
However if the kthread is per CPU, the wake up is preceded by a call to kthreadbind() which expects the task to be inactive and in TASKPARKED state, which obviously isn't the case if it is unparked.
As a result, calling kthreadstop() on an unparked per-cpu kthread triggers such a warning:
WARNING: CPU: 0 PID: 11 at kernel/kthread.c:525 kthreadbindmask kernel/kthread.c:525 <TASK> kthreadstop+0x17a/0x630 kernel/kthread.c:707 destroyworkqueue+0x136/0xc40 kernel/workqueue.c:5810 wgdestruct+0x1e2/0x2e0 drivers/net/wireguard/device.c:257 netdevruntodo+0xe1a/0x1000 net/core/dev.c:10693 defaultdeviceexitbatch+0xa14/0xa90 net/core/dev.c:11769 opsexitlist net/core/netnamespace.c:178 [inline] cleanupnet+0x89d/0xcc0 net/core/netnamespace.c:640 processonework kernel/workqueue.c:3231 [inline] processscheduledworks+0xa2c/0x1830 kernel/workqueue.c:3312 workerthread+0x86d/0xd70 kernel/workqueue.c:3393 kthread+0x2f0/0x390 kernel/kthread.c:389 retfromfork+0x4b/0x80 arch/x86/kernel/process.c:147 retfromforkasm+0x1a/0x30 arch/x86/entry/entry64.S:244 </TASK>
Fix this with skipping unecessary unparking while stopping a kthread.
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-50019?
CVE-2024-50019 is rated as a moderate severity vulnerability in the Linux kernel.
How do I fix CVE-2024-50019?
To fix CVE-2024-50019, update the Linux kernel to one of the patched versions, such as 5.10.223-1 or 6.12.11-1.
Which Linux kernel versions are affected by CVE-2024-50019?
CVE-2024-50019 affects various versions of the Linux kernel, particularly those prior to the fixed versions listed in the vulnerability details.
What is the impact of CVE-2024-50019?
The impact of CVE-2024-50019 primarily involves the improper management of thread states within the kernel, which could lead to unintended behavior.
Which distributions are primarily affected by CVE-2024-50019?
Debian-based distributions are primarily affected by CVE-2024-50019, especially the packages related to the Linux kernel.