perf: hisi: Fix use-after-free when register pmu fails
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
perf: hisi: Fix use-after-free when register pmu fails
When we fail to register the uncore pmu, the pmu context may not been allocated. The error handing will call cpuhp_state_remove_instance() to call uncore pmu offline callback, which migrate the pmu context. Since that's liable to lead to some kind of use-after-free.
Use cpuhp_state_remove_instance_nocalls() instead of cpuhp_state_remove_instance() so that the notifiers don't execute after the PMU device has been failed to register.
From the CVE record · Linux
The Linux kernel’s hisi perf PMU error path can trigger a use-after-free if uncore PMU registration fails and the offline callback runs. The input does not establish what an attacker could do or whether exploitation requires local access, authentication, or user interaction.
Engineers running Linux kernels with the hisi perf PMU should check their versions; affected versions were not provided.