s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero
authorHendrik Brueckner <brueckner@linux.ibm.com>
Thu, 3 May 2018 13:56:15 +0000 (15:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 May 2018 14:57:57 +0000 (16:57 +0200)
commita03e14f09b40a1a10ce464d906814bb85ecd71ab
tree7a529ae00737fd46d7af1f5cb4c731d00d6a1a4f
parent252bbeb9688a3c6ede9ea997e93ecb5d05e60209
s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero

commit 4bbaf2584b86b0772413edeac22ff448f36351b1 upstream.

Correct a trinity finding for the perf_event_open() system call with
a perf event attribute structure that uses a frequency but has the
sampling frequency set to zero.  This causes a FP divide exception during
the sample rate initialization for the hardware sampling facility.

Fixes: 8c069ff4bd606 ("s390/perf: add support for the CPU-Measurement Sampling Facility")
Cc: stable@vger.kernel.org # 3.14+
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kernel/perf_cpum_sf.c