WSL2-Linux-Kernel/drivers/perf
Junhao He 0e1e88bba2 perf: hisi: Fix use-after-free when register pmu fails
[ Upstream commit b805cafc604bfdb671fae7347a57f51154afa735 ]

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: a0ab25cd82 ("drivers/perf: hisi: Add support for HiSilicon PA PMU driver")
FIxes: 3bf30882c3 ("drivers/perf: hisi: Add support for HiSilicon SLLC PMU driver")
Signed-off-by: Junhao He <hejunhao3@huawei.com>
Link: https://lore.kernel.org/r/20231024113630.13472-1-hejunhao3@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:08:21 +01:00
..
hisilicon perf: hisi: Fix use-after-free when register pmu fails 2023-11-20 11:08:21 +01:00
Kconfig
Makefile
arm-cci.c
arm-ccn.c
arm-cmn.c perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7 2023-10-19 23:05:32 +02:00
arm_dmc620_pmu.c perf/arm_dmc620: Fix hotplug callback leak in dmc620_pmu_init() 2022-12-31 13:13:58 +01:00
arm_dsu_pmu.c perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init() 2022-12-31 13:13:58 +01:00
arm_pmu.c arm_pmu: Validate single/group leader events 2022-04-27 14:39:00 +02:00
arm_pmu_acpi.c
arm_pmu_platform.c perf/arm_pmu_platform: fix tests for platform_get_irq() failure 2022-09-20 12:39:45 +02:00
arm_smmuv3_pmu.c perf/smmuv3: Enable HiSilicon Erratum 162001900 quirk for HIP08/09 2023-09-23 11:09:55 +02:00
arm_spe_pmu.c drivers/perf: arm_spe: Fix consistency of SYS_PMSCR_EL1.CX 2022-08-17 14:23:14 +02:00
fsl_imx8_ddr_perf.c perf/imx_ddr: speed up overflow frequency of cycle 2023-09-23 11:09:55 +02:00
qcom_l2_pmu.c
qcom_l3_pmu.c
thunderx2_pmu.c
xgene_pmu.c