From 534bc413e46735f47e0c6ef7bc7fce5df5aabc11 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 24 Apr 2018 17:02:16 +0200 Subject: [PATCH] 4.4-stable patches added patches: perf-return-proper-values-for-user-stack-errors.patch --- ...-proper-values-for-user-stack-errors.patch | 46 +++++++++++++++++++ queue-4.4/series | 1 + 2 files changed, 47 insertions(+) create mode 100644 queue-4.4/perf-return-proper-values-for-user-stack-errors.patch diff --git a/queue-4.4/perf-return-proper-values-for-user-stack-errors.patch b/queue-4.4/perf-return-proper-values-for-user-stack-errors.patch new file mode 100644 index 00000000000..697585f3ce2 --- /dev/null +++ b/queue-4.4/perf-return-proper-values-for-user-stack-errors.patch @@ -0,0 +1,46 @@ +From 78b562fbfa2cf0a9fcb23c3154756b690f4905c1 Mon Sep 17 00:00:00 2001 +From: Jiri Olsa +Date: Sun, 15 Apr 2018 11:23:50 +0200 +Subject: perf: Return proper values for user stack errors + +From: Jiri Olsa + +commit 78b562fbfa2cf0a9fcb23c3154756b690f4905c1 upstream. + +Return immediately when we find issue in the user stack checks. The +error value could get overwritten by following check for +PERF_SAMPLE_REGS_INTR. + +Signed-off-by: Jiri Olsa +Cc: Alexander Shishkin +Cc: Andi Kleen +Cc: H. Peter Anvin +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Stephane Eranian +Cc: Thomas Gleixner +Cc: syzkaller-bugs@googlegroups.com +Cc: x86@kernel.org +Fixes: 60e2364e60e8 ("perf: Add ability to sample machine state on interrupt") +Link: http://lkml.kernel.org/r/20180415092352.12403-1-jolsa@kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/events/core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -8133,9 +8133,9 @@ static int perf_copy_attr(struct perf_ev + * __u16 sample size limit. + */ + if (attr->sample_stack_user >= USHRT_MAX) +- ret = -EINVAL; ++ return -EINVAL; + else if (!IS_ALIGNED(attr->sample_stack_user, sizeof(u64))) +- ret = -EINVAL; ++ return -EINVAL; + } + + if (attr->sample_type & PERF_SAMPLE_REGS_INTR) diff --git a/queue-4.4/series b/queue-4.4/series index 39435454351..3a0dc5960ef 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -1,2 +1,3 @@ cifs-do-not-allow-creating-sockets-except-with-smb1-posix-exensions.patch x86-tsc-prevent-32bit-truncation-in-calc_hpet_ref.patch +perf-return-proper-values-for-user-stack-errors.patch -- 2.47.3