[SRU][Xenial][Artful][Bionic][PATCH 0/1] s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][Xenial][Artful][Bionic][PATCH 0/1] s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero

Joseph Salisbury-3
BugLink: http://bugs.launchpad.net/bugs/1772593

== SRU Justification ==
A regression was introduced by commit 8c069ff4bd606 in v3.14-rc1.  IBM
is requested commit 4bbaf2584b86 in all Ubuntu kernels to resolve this
isue.  

Bug Description: cpum_sf: ensure sample freq is non-zero
Symptom: A kernel crash might occur.
Problem: An FP divide exception during the sample rate
              initialization for the hardware sampling facility.
Solution: Ensure that the sample frequency of the perf
              event attribute is non-zero.

== Fix ==
4bbaf2584b86 ("s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero")

== Regression Potential ==
Low.  Fix is specific to s390.

== Test Case ==
A test kernel was built with this patch and tested by the original bug reporter.
The bug reporter states the test kernel resolved the bug.

Hendrik Brueckner (1):
  s390/cpum_sf: ensure sample frequency of perf event attributes is
    non-zero

 arch/s390/kernel/perf_cpum_sf.c | 4 ++++
 1 file changed, 4 insertions(+)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][Xenial][Artful][Bionic][PATCH 1/1] s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero

Joseph Salisbury-3
From: Hendrik Brueckner <[hidden email]>

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: [hidden email] # 3.14+
Reviewed-by: Heiko Carstens <[hidden email]>
Signed-off-by: Hendrik Brueckner <[hidden email]>
Signed-off-by: Martin Schwidefsky <[hidden email]>
(cherry picked from commit 4bbaf2584b86b0772413edeac22ff448f36351b1)
Signed-off-by: Joseph Salisbury <[hidden email]>
---
 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;
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Xenial][Artful][Bionic][PATCH 1/1] s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero

Kleber Sacilotto de Souza
On 05/25/18 04:38, Joseph Salisbury wrote:

> From: Hendrik Brueckner <[hidden email]>
>
> 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: [hidden email] # 3.14+
> Reviewed-by: Heiko Carstens <[hidden email]>
> Signed-off-by: Hendrik Brueckner <[hidden email]>
> Signed-off-by: Martin Schwidefsky <[hidden email]>
> (cherry picked from commit 4bbaf2584b86b0772413edeac22ff448f36351b1)
> Signed-off-by: Joseph Salisbury <[hidden email]>

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

> ---
>  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;
>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Xenial][Artful][Bionic][PATCH 1/1] s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero

Stefan Bader-2
In reply to this post by Joseph Salisbury-3
On 25.05.2018 04:38, Joseph Salisbury wrote:

> From: Hendrik Brueckner <[hidden email]>
>
> 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: [hidden email] # 3.14+
> Reviewed-by: Heiko Carstens <[hidden email]>
> Signed-off-by: Hendrik Brueckner <[hidden email]>
> Signed-off-by: Martin Schwidefsky <[hidden email]>
> (cherry picked from commit 4bbaf2584b86b0772413edeac22ff448f36351b1)
> Signed-off-by: Joseph Salisbury <[hidden email]>
Acked-by: Stefan Bader <[hidden email]>

> ---
>  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;
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU][Xenial][Artful][Bionic][PATCH 0/1] s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero

Khaled Elmously
In reply to this post by Joseph Salisbury-3
Applied to X/A/B

On 2018-05-25 07:38:50 , Joseph Salisbury wrote:

> BugLink: http://bugs.launchpad.net/bugs/1772593
>
> == SRU Justification ==
> A regression was introduced by commit 8c069ff4bd606 in v3.14-rc1.  IBM
> is requested commit 4bbaf2584b86 in all Ubuntu kernels to resolve this
> isue.  
>
> Bug Description: cpum_sf: ensure sample freq is non-zero
> Symptom: A kernel crash might occur.
> Problem: An FP divide exception during the sample rate
>               initialization for the hardware sampling facility.
> Solution: Ensure that the sample frequency of the perf
>               event attribute is non-zero.
>
> == Fix ==
> 4bbaf2584b86 ("s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero")
>
> == Regression Potential ==
> Low.  Fix is specific to s390.
>
> == Test Case ==
> A test kernel was built with this patch and tested by the original bug reporter.
> The bug reporter states the test kernel resolved the bug.
>
> Hendrik Brueckner (1):
>   s390/cpum_sf: ensure sample frequency of perf event attributes is
>     non-zero
>
>  arch/s390/kernel/perf_cpum_sf.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> --
> 2.7.4
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team