diff options
| author | Junhao He <[email protected]> | 2023-10-24 19:36:30 +0800 |
|---|---|---|
| committer | Will Deacon <[email protected]> | 2023-10-24 13:30:02 +0100 |
| commit | b805cafc604bfdb671fae7347a57f51154afa735 (patch) | |
| tree | 3fbe50f0164872970248473af0d9ede4d9d56074 /lib/crypto/mpi/mpi-mul.c | |
| parent | 868f8a709874729998bcad3422124b678b18b755 (diff) | |
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.
Fixes: a0ab25cd82ee ("drivers/perf: hisi: Add support for HiSilicon PA PMU driver")
FIxes: 3bf30882c3c7 ("drivers/perf: hisi: Add support for HiSilicon SLLC PMU driver")
Signed-off-by: Junhao He <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions