kernel-fxtec-pro1x/arch/alpha/kernel
Will Deacon 6e22f8f2e8 alpha: perf: fix out-of-bounds array access triggered from raw event
Vince's perf fuzzer uncovered the following issue on Alpha:

Unable to handle kernel paging request at virtual address fffffbfe4e46a0e8
CPU 0 perf_fuzzer(1278): Oops 0
pc = [<fffffc000031fbc0>]  ra = [<fffffc000031ff54>]  ps = 0007    Not tainted
pc is at alpha_perf_event_set_period+0x60/0xf0
ra is at alpha_pmu_enable+0x1a4/0x1c0
v0 = 0000000000000000  t0 = 00000000000fffff  t1 = fffffc007b3f5800
t2 = fffffbff275faa94  t3 = ffffffffc9b9bd89  t4 = fffffbfe4e46a098
t5 = 0000000000000020  t6 = fffffbfe4e46a0b8  t7 = fffffc007f4c8000
s0 = 0000000000000000  s1 = fffffc0001b0c018  s2 = fffffc0001b0c020
s3 = fffffc007b3f5800  s4 = 0000000000000001  s5 = ffffffffc9b9bd85
s6 = 0000000000000001
a0 = 0000000000000006  a1 = fffffc007b3f5908  a2 = fffffbfe4e46a098
a3 = 00000005000108c0  a4 = 0000000000000000  a5 = 0000000000000000
t8 = 0000000000000001  t9 = 0000000000000001  t10= 0000000027829f6f
t11= 0000000000000020  pv = fffffc000031fb60  at = fffffc0000950900
gp = fffffc0000940900  sp = fffffc007f4cbca8
Disabling lock debugging due to kernel taint
Trace:
[<fffffc000031ff54>] alpha_pmu_enable+0x1a4/0x1c0
[<fffffc000039f4e8>] perf_pmu_enable+0x48/0x60
[<fffffc00003a0d6c>] __perf_install_in_context+0x15c/0x230
[<fffffc000039d1f0>] remote_function+0x80/0xa0
[<fffffc00003a0c10>] __perf_install_in_context+0x0/0x230
[<fffffc000037b7e4>] smp_call_function_single+0x1b4/0x1d0
[<fffffc000039bb70>] task_function_call+0x60/0x80
[<fffffc00003a0c10>] __perf_install_in_context+0x0/0x230
[<fffffc000039bb44>] task_function_call+0x34/0x80
[<fffffc000039d3fc>] perf_install_in_context+0x9c/0x150
[<fffffc00003a0c10>] __perf_install_in_context+0x0/0x230
[<fffffc00003a5100>] SYSC_perf_event_open+0x360/0xac0
[<fffffc00003110c4>] entSys+0xa4/0xc0

This is due to the raw event encoding being used as an index directly
into the ev67_mapping array, rather than being validated against the
ev67_pmc_event_type enumeration instead. Unlike other architectures,
which allow raw events to propagate into the hardware counters with
little interference, the limited number of events on Alpha and the
strict event <-> counter relationships mean that raw events actually
correspond to the Linux-specific Alpha events, rather than anything
defined by the architecture.

This patch adds a new callback to alpha_pmu_t for validating the raw
event encoding with the Linux event types for the PMU, preventing the
out-of-bounds array access.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Michael Cree <mcree@orcon.net.nz>
Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2013-11-16 16:37:10 -08:00
..
.gitignore
alpha_ksyms.c alpha: Eliminate compiler warning from memset macro 2013-11-16 16:33:09 -08:00
asm-offsets.c
binfmt_loader.c
console.c TTY:vt: convert remain take_over_console's users to do_take_over_console 2013-05-20 22:29:27 -07:00
core_apecs.c
core_cia.c
core_irongate.c
core_lca.c
core_marvel.c
core_mcpcia.c
core_polaris.c
core_t2.c
core_titan.c
core_tsunami.c
core_wildfire.c
entry.S alpha: Generate dwarf2 unwind info for various kernel entry points. 2013-07-19 13:54:25 -07:00
err_common.c
err_ev6.c
err_ev7.c
err_impl.h
err_marvel.c
err_titan.c
es1888.c
gct.c
head.S
io.c
irq.c alpha: irq: run all handlers with interrupts disabled 2013-04-07 12:59:30 -07:00
irq_alpha.c alpha: Use qemu+cserve provided high-res clock and alarm. 2013-11-16 16:33:21 -08:00
irq_i8259.c
irq_impl.h
irq_pyxis.c
irq_srm.c
machvec_impl.h alpha: Reorganize rtc handling 2013-11-16 16:33:16 -08:00
Makefile alpha: Reorganize rtc handling 2013-11-16 16:33:16 -08:00
module.c
osf_sys.c [readdir] constify ->actor 2013-06-29 12:57:05 +04:00
pc873xx.c
pc873xx.h
pci-noop.c
pci-sysfs.c hose_mmap_page_range(): io_remap_pfn_range() will set all those flags... 2013-06-29 12:46:37 +04:00
pci.c
pci_impl.h
pci_iommu.c
perf_event.c alpha: perf: fix out-of-bounds array access triggered from raw event 2013-11-16 16:37:10 -08:00
process.c alpha: Primitive support for CPU power down. 2013-11-16 16:33:15 -08:00
proto.h alpha: Use qemu+cserve provided high-res clock and alarm. 2013-11-16 16:33:21 -08:00
ptrace.c
rtc.c alpha: Reorganize rtc handling 2013-11-16 16:33:16 -08:00
setup.c alpha: Allow HZ to be configured 2013-11-16 16:33:13 -08:00
signal.c
smc37c93x.c
smc37c669.c
smp.c alpha: Switch to GENERIC_CLOCKEVENTS 2013-11-16 16:33:19 -08:00
srm_env.c srm_env: don't bother with pointer to srm_env_t 2013-04-09 14:13:33 -04:00
srmcons.c
sys_alcor.c
sys_cabriolet.c
sys_dp264.c alpha: Don't if-out dp264_device_interrupt. 2013-07-19 13:54:26 -07:00
sys_eb64p.c
sys_eiger.c
sys_jensen.c alpha: Reorganize rtc handling 2013-11-16 16:33:16 -08:00
sys_marvel.c alpha: Reorganize rtc handling 2013-11-16 16:33:16 -08:00
sys_miata.c
sys_mikasa.c
sys_nautilus.c mm: enhance free_reserved_area() to support poisoning memory with zero 2013-07-03 16:07:32 -07:00
sys_noritake.c
sys_rawhide.c
sys_ruffian.c
sys_rx164.c
sys_sable.c
sys_sio.c
sys_sx164.c
sys_takara.c
sys_titan.c alpha: irq: remove deprecated use of IRQF_DISABLED 2013-04-07 12:59:30 -07:00
sys_wildfire.c
systbls.S alpha: Add kcmp and finit_module syscalls 2013-07-19 13:54:23 -07:00
time.c alpha: Use qemu+cserve provided high-res clock and alarm. 2013-11-16 16:33:21 -08:00
traps.c alpha: Primitive support for CPU power down. 2013-11-16 16:33:15 -08:00
vmlinux.lds.S