lkml.org 
[lkml]   [2018]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/3] perf: Return proper values for user stack errors
    Em Sun, Apr 15, 2018 at 11:23:50AM +0200, Jiri Olsa escreveu:
    > 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.

    Applied, together with a:

    Cc: Stephane Eranian <eranian@google.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Fixes: 60e2364e60e8 ("perf: Add ability to sample machine state on interrupt")

    > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
    > ---
    > kernel/events/core.c | 4 ++--
    > 1 file changed, 2 insertions(+), 2 deletions(-)
    >
    > diff --git a/kernel/events/core.c b/kernel/events/core.c
    > index fc1c330c6bd6..4d997bc064d2 100644
    > --- a/kernel/events/core.c
    > +++ b/kernel/events/core.c
    > @@ -10191,9 +10191,9 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
    > * __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_max_stack)
    > --
    > 2.13.6

    \
     
     \ /
      Last update: 2018-04-16 18:53    [W:3.352 / U:0.236 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site