mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
arm64: perf: fix event validation for software group leaders
commitee7538a008upstream. This is a port ofc95eb3184e("ARM: 7809/1: perf: fix event validation for software group leaders") to arm64, which fixes a panic in the arm64 perf backend found as a result of Vince's fuzzing tool. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit6c6f6c7166) Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
@@ -322,6 +322,9 @@ validate_event(struct pmu_hw_events *hw_events,
|
||||
struct hw_perf_event fake_event = event->hw;
|
||||
struct pmu *leader_pmu = event->group_leader->pmu;
|
||||
|
||||
if (is_software_event(event))
|
||||
return 1;
|
||||
|
||||
if (event->pmu != leader_pmu || event->state <= PERF_EVENT_STATE_OFF)
|
||||
return 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user