linux-sg2042/drivers/perf
Junhao He b660420f44 perf: hisi: Fix use-after-free when register pmu fails
[ Upstream commit b805cafc60 ]

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:52:01 +01:00
..
hisilicon perf: hisi: Fix use-after-free when register pmu fails 2023-11-20 11:52:01 +01:00
Kconfig drivers/perf: ALIBABA_UNCORE_DRW_PMU should depend on ACPI 2022-10-07 14:47:44 +01:00
Makefile
alibaba_uncore_drw_pmu.c drivers/perf: fix return value check in ali_drw_pmu_probe() 2022-10-07 14:47:38 +01:00
apple_m1_cpu_pmu.c
arm-cci.c
arm-ccn.c
arm-cmn.c perf/arm-cmn: Fix DTC domain detection 2023-11-20 11:52:01 +01:00
arm_dmc620_pmu.c perf/arm_dmc620: Fix hotplug callback leak in dmc620_pmu_init() 2022-12-31 13:31:51 +01:00
arm_dsu_pmu.c perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init() 2022-12-31 13:31:51 +01:00
arm_pmu.c
arm_pmu_acpi.c
arm_pmu_platform.c
arm_smmuv3_pmu.c perf/smmuv3: Enable HiSilicon Erratum 162001900 quirk for HIP08/09 2023-09-23 11:11:00 +02:00
arm_spe_pmu.c Perf events updates for v6.1: 2022-10-10 09:27:46 -07:00
fsl_imx8_ddr_perf.c perf/imx_ddr: speed up overflow frequency of cycle 2023-09-23 11:11:00 +02:00
marvell_cn10k_ddr_pmu.c
marvell_cn10k_tad_pmu.c drivers: perf: marvell_cn10k: Fix hotplug callback leak in tad_pmu_init() 2022-12-31 13:31:51 +01:00
qcom_l2_pmu.c
qcom_l3_pmu.c
riscv_pmu.c perf: RISC-V: Remove PERF_HES_STOPPED flag checking in riscv_pmu_start() 2023-07-23 13:49:44 +02:00
riscv_pmu_legacy.c RISC-V Patches for the 6.1 Merge Window, Part 1 2022-10-09 13:24:01 -07:00
riscv_pmu_sbi.c RISC-V: Align SBI probe implementation with spec 2023-05-11 23:03:04 +09:00
thunderx2_pmu.c
xgene_pmu.c