In the Linux kernel, the following vulnerability has been resolved:
perf/x86/intel: Improve validation and configuration of ACR masks
Currently there are several issues on the user space ACR mask validation and configuration.
- The validation for user space ACR mask (attr.config2) is incomplete,
- An early return on an invalid ACR mask caused all subsequent ACR groups
- The stale hardware ACR mask (hw.config1) is not cleared before setting
The following changes address all of the above issues.
- Figure out the event index group of an ACR group. Any bits in the
- Instead of an early return on invalid bits, drop only the invalid
- Explicitly clear the stale hardware ACR mask for each event prior to
Besides, a non-leader event member of ACR group could be disabled in theory. This could cause bit-shifting errors in the acr_mask of remaining group members. But since ACR sampling requires all events to be active, this should not be a big concern in real use case. Add a "FIXME" comment to notice this risk.