GoogleGit

commit79b81c66544aacc5b317f1f7ea8947ecc4a57c0b[log][tgz]
authorJP Abgrall <jpa@google.com>Wed Oct 23 13:02:40 2013 -0700
committerJP Abgrall <jpa@google.com>Wed Oct 23 13:02:40 2013 -0700
tree8d26f3cff02a0ca9fef19415d330d1259709e820
parente5622822b402203b9eb819ab3b73f4874d0a2ea6[diff]
ARM: 7809/1: perf: fix event validation for software group leaders

commit c95eb3184ea1a3a2551df57190c81da695e2144b upstream.

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.

Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Tested-by: Vince Weaver <vincent.weaver@maine.edu>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


Conflicts:
	arch/arm/kernel/perf_event.c

Change-Id: I9845d08f1e36bda42d1c9ad0e508790710004ba5
1 file changed
tree: 8d26f3cff02a0ca9fef19415d330d1259709e820
  1. .gitignore
  2. .mailmap
  3. COPYING
  4. CREDITS
  5. Documentation/
  6. Kbuild
  7. Kconfig
  8. MAINTAINERS
  9. Makefile
  10. README
  11. REPORTING-BUGS
  12. android/
  13. arch/
  14. block/
  15. crypto/
  16. drivers/
  17. firmware/
  18. fs/
  19. include/
  20. init/
  21. ipc/
  22. kernel/
  23. lib/
  24. mm/
  25. net/
  26. samples/
  27. scripts/
  28. security/
  29. sound/
  30. tools/
  31. usr/
  32. virt/