linux/arch
David Carrillo-Cisneros b899142ce2 perf/x86: Set pmu->module in Intel PMU modules
[ Upstream commit 74545f6389 ]

The conversion of Intel PMU drivers into modules did not include reference
counting. The machine will crash when attempting to  access deleted code
if an event from a module PMU is started and the module removed before the
event is destroyed.

i.e. this crashes the machine:

	$ insmod intel-rapl-perf.ko
	$ perf stat -e power/energy-cores/ -C 0 &
	$ rmmod intel-rapl-perf.ko

Set THIS_MODULE to pmu->module in Intel module PMUs so that generic code
can handle reference counting and deny rmmod while an event still exists.

Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1482455860-116269-1-git-send-email-davidcc@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-08-06 18:59:49 -07:00
..
alpha osf_wait4(): fix infoleak 2017-05-25 15:44:47 +02:00
arc ARCv2: IRQ: Call entry/exit functions for chained handlers in MCIP 2017-08-06 18:59:49 -07:00
arm ARM: s3c2410_defconfig: Fix invalid values for NF_CT_PROTO_* 2017-08-06 18:59:47 -07:00
arm64 arm64: mm: fix show_pte KERN_CONT fallout 2017-08-06 18:59:48 -07:00
avr32 Merge branch 'akpm' (patches from Andrew) 2016-10-07 21:38:00 -07:00
blackfin ptrace: Don't allow accessing an undumpable mm 2017-01-06 10:40:13 +01:00
c6x c6x/ptrace: Remove useless PTRACE_SETREGSET implementation 2017-03-31 10:31:46 +02:00
cris cris: Only build flash rescue image if CONFIG_ETRAX_AXISFLASHMAP is selected 2017-01-12 11:39:24 +01:00
frv mm: larger stack guard gap, between vmas 2017-06-24 07:11:18 +02:00
h8300 h8300/ptrace: Fix incorrect register transfer count 2017-03-31 10:31:46 +02:00
hexagon nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00
ia64 ptrace: Don't allow accessing an undumpable mm 2017-01-06 10:40:13 +01:00
m32r mm: replace access_process_vm() write parameter with gup_flags 2016-10-19 08:31:25 -07:00
m68k m68k: Fix ndelay() macro 2016-10-30 10:13:55 +01:00
metag metag/uaccess: Check access_ok in strncpy_from_user 2017-05-25 15:44:46 +02:00
microblaze Merge branch 'work.uaccess2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-11 23:38:39 -07:00
mips MIPS: Fix a typo: s/preset/present/ in r2-to-r6 emulation error message 2017-07-27 15:08:05 -07:00
mn10300 mn10300: fix build error of missing fpu_save() 2017-06-17 06:41:56 +02:00
nios2 nios2: reserve boot memory for device tree 2017-04-12 12:41:14 +02:00
openrisc openrisc: Add _text symbol to fix ksym build error 2017-08-06 18:59:46 -07:00
parisc parisc: Suspend lockup detectors before system halt 2017-08-06 18:59:40 -07:00
powerpc Revert "powerpc/numa: Fix percpu allocations to be NUMA aware" 2017-08-06 18:59:41 -07:00
s390 s390/syscalls: Fix out of bounds arguments access 2017-07-27 15:08:02 -07:00
score Merge branch 'gup_flag-cleanups' 2016-10-19 08:39:47 -07:00
sh mm: larger stack guard gap, between vmas 2017-06-24 07:11:18 +02:00
sparc sparc64: Zero pages on allocation for mondo and error queues. 2017-07-05 14:40:19 +02:00
tile mm: larger stack guard gap, between vmas 2017-06-24 07:11:18 +02:00
um um: Fix to call read_initrd after init_bootmem 2017-05-25 15:44:47 +02:00
unicore32 unicore32: use simpler API for random address requests 2016-10-11 15:06:32 -07:00
x86 perf/x86: Set pmu->module in Intel PMU modules 2017-08-06 18:59:49 -07:00
xtensa mm: larger stack guard gap, between vmas 2017-06-24 07:11:18 +02:00
.gitignore arch: Ignore arch/i386 and arch/x86_64 2008-01-19 21:29:39 -08:00
Kconfig This adds a new gcc plugin named "latent_entropy". It is designed to 2016-10-15 10:03:15 -07:00