CVE-2024-43869: perf: Fix event leak upon exec and file release
In the Linux kernel, the following vulnerability has been resolved:
perf: Fix event leak upon exec and file release
The perf pending task work is never waited upon the matching event release. In the case of a child event, released via freeevent() directly, this can potentially result in a leaked event, such as in the following scenario that doesn't even require a weak IRQ work implementation to trigger:
schedule() preparetaskswitch() =======> <NMI> perfeventoverflow() event->pendingsigtrap = ... irqworkqueue(&event->pendingirq) <======= </NMI> perfeventtaskschedout() eventschedout() event->pendingsigtrap = 0; atomiclongincnotzero(&event->refcount) taskworkadd(&event->pendingtask) finishlockswitch() =======> <IRQ> perfpendingirq() //do nothing, rely on pending task work <======= </IRQ>
beginnewexec() perfeventexittask() perfeventexitevent() // If is child event freeevent() WARN(atomiclongcmpxchg(&event->refcount, 1, 0) != 1) // event is leaked
Similar scenarios can also happen with perfeventremoveonexec() or simply against concurrent perfeventrelease().
Fix this with synchonizing against the possibly remaining pending task work while freeing the event, just like is done with remaining pending IRQ work. This means that the pending task callback neither need nor should hold a reference to the event, preventing it from ever beeing freed.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-43869?
CVE-2024-43869 is considered a medium severity vulnerability that can lead to potential information leaks.
How do I fix CVE-2024-43869?
To fix CVE-2024-43869, update the Linux kernel to one of the following versions: 5.10.223-1, 5.10.226-1, 6.1.119-1, 6.1.123-1, 6.12.10-1, or 6.12.11-1.
Which Linux kernel versions are affected by CVE-2024-43869?
CVE-2024-43869 affects multiple kernel versions, primarily those prior to the fixed versions mentioned in the remedy.
What can happen if I don't patch CVE-2024-43869?
Failure to patch CVE-2024-43869 can result in event leaks that may expose sensitive information during task execution.
Is CVE-2024-43869 specific to certain Linux distributions?
CVE-2024-43869 has been identified primarily in the Debian version of the Linux kernel.