perf: Reject exited events as group leaders
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
1d3e1102273f09180262496658e7eeed8a5a7b59| No fix yet |
| Linux Linux |
| No fix yet |
In the Linux kernel, the following vulnerability has been resolved:
perf: Reject exited events as group leaders
perf_event_remove_on_exec() sets remove-on-exec events to the EXIT state and detaches their group relationships. The event's file descriptor can remain open, however, and perf_event_open() currently accepts that event as a group leader because its early validation rejects only REVOKED and DEAD events.
A new sibling can consequently be linked to the detached leader. When the leader is closed, perf_group_detach() observes that its PERF_ATTACH_GROUP bit is already clear and skips the new sibling. The sibling then retains a group_leader pointer to the freed event.
Reject group leaders in the EXIT state. Perform the check while holding the shared context mutex so that an exec in the target task cannot detach the leader between validation and group attachment.
[peterz: make the earlier test fully consistent]
From the CVE record · Linux
The Linux kernel's perf subsystem can accept an exited event as a group leader while its file descriptor remains open. A local caller using perf_event_open() can attach a new sibling to that leader; closing the leader then leaves the sibling pointing to freed memory. The input does not specify authentication requirements or user interaction.
Engineers running Linux kernels with the perf subsystem should check their kernel against the vendor advisory; affected versions are not specified.