ACK: [SRU][Xenial][Artful][Bionic][PATCH 1/1] s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero
Stefan Bader
stefan.bader at canonical.com
Tue Jun 5 00:41:55 UTC 2018
On 25.05.2018 04:38, Joseph Salisbury wrote:
> From: Hendrik Brueckner <brueckner at linux.ibm.com>
>
> BugLink: http://bugs.launchpad.net/bugs/1772593
>
> 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 at vger.kernel.org # 3.14+
> Reviewed-by: Heiko Carstens <heiko.carstens at de.ibm.com>
> Signed-off-by: Hendrik Brueckner <brueckner at linux.ibm.com>
> Signed-off-by: Martin Schwidefsky <schwidefsky at de.ibm.com>
> (cherry picked from commit 4bbaf2584b86b0772413edeac22ff448f36351b1)
> Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
> ---
> arch/s390/kernel/perf_cpum_sf.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
> index 3d8da1e..b79d514 100644
> --- a/arch/s390/kernel/perf_cpum_sf.c
> +++ b/arch/s390/kernel/perf_cpum_sf.c
> @@ -744,6 +744,10 @@ static int __hw_perf_event_init(struct perf_event *event)
> */
> rate = 0;
> if (attr->freq) {
> + if (!attr->sample_freq) {
> + err = -EINVAL;
> + goto out;
> + }
> rate = freq_to_sample_rate(&si, attr->sample_freq);
> rate = hw_limit_rate(&si, rate);
> attr->freq = 0;
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20180604/04582267/attachment.sig>
More information about the kernel-team
mailing list