perf: arm_pmuv3: Zero initialize hw_id branch stack field
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.527.2.67.3In the Linux kernel, the following vulnerability has been resolved:
perf: arm_pmuv3: Zero initialize hw_id branch stack field
PERF_SAMPLE_BRANCH_HW_INDEX is supported by BRBE so hw_id is passed to userspace, but it's never set by the BRBE driver. Zero initialize it as it should be according to the docs:
* For the architectures whose raw branch records are * already stored in age order, the hw_idx should be 0.
It's probably too risky to remove PERF_SAMPLE_BRANCH_HW_INDEX from BRBE now in case anyone is setting it and reading the value, but zero initializing the whole struct also protects against the same issue with new fields that are added in the future.
From the CVE record · Linux
The arm_pmuv3 BRBE driver passes a branch-stack hardware index field to userspace without initializing it. A user collecting BRBE branch samples with PERF_SAMPLE_BRANCH_HW_INDEX may receive an uninitialized value; the input does not specify authentication or other access requirements.
Engineers running Linux kernels with the arm_pmuv3 BRBE driver should check their kernel; affected versions are not specified.