Patch State
Viewing Patch 7809/1
Not logged in Login...
Please note: this is not a patch review system;
please submit all patches to the linux-arm-kernel mailing
list for community review prior to submission here.

NOTE: The patch system is currently running with workarounds due to a silly change made by MariaDB developers resulting in one of the library's APIs that reports the version number reporting a much smaller number. Links:

Debian BTS #1032074.
Code in Perl's MySQL DBD: mysql_get_client_version() user.
MariaDB discussion: Revert inappropriate libmariadb stable ABI version changes.

Update 31 December 2023: Debian have not resolved this in Bookworm, despite it apparently being resolved in upstream packages. Consequently, the workaround remains in place - which is the normal behaviour that I've come to expect from Linux distros. Bugs and regressions just don't get fixed, and yet again, it has been proven that it is utterly pointless reporting bugs to distros.

Go to patch:
Search summaries:
Add new patch Download this patch Help
Updated - Please read
(November 02, 2019)
ID Version From Date Status
7809/1 3.11-rc4 Will Deacon 7 Aug 2013 23:39:41 UTC Applied
Summary:  perf: fix event validation for software group leaders
Notes:  - - - Note 1 submitted by Will Deacon on 7 Aug 2013 23:39:41 (UTC) - - -
It is possible to construct an event group with a software event as a
group leader and then subsequently add a hardware event to the group.
This results in the event group being validated by adding all members
of the group to a fake PMU and attempting to allocate each event on
their respective PMU.

Unfortunately, for software events wthout a corresponding arm_pmu, this
results in a kernel crash attempting to dereference the ->get_event_idx
function pointer.

This patch fixes the problem by checking explicitly for software events
and ignoring those in event validation (since they can always be
scheduled). We will probably want to revisit this for 3.12, since the
validation checks don't appear to work correctly when dealing with
multiple hardware PMUs anyway.

Cc: <(address hidden)>
Reported-by: Vince Weaver <(address hidden)>
Tested-by: Vince Weaver <(address hidden)>
Tested-by: Mark Rutland <(address hidden)>
Signed-off-by: Will Deacon <(address hidden)>
- - - Note 2 submitted by Russell King on 13 Aug 2013 20:21:54 (UTC) - - -
Moved to applied

Applied to git-curr (fixes branch).
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index d9f5cd4..0500f10b 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -253,6 +253,9 @@ validate_event(struct pmu_hw_events *hw_events,
 	struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
 	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;