[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190221103303.5a83229e@gandalf.local.home>
Date: Thu, 21 Feb 2019 10:33:03 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Song Liu <songliubraving@...com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Jann Horn <jannh@...gle.com>, Ingo Molnar <mingo@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] perf/core: use strndup_user() instead of buggy
open-coded version
On Thu, 21 Feb 2019 07:12:10 +0000
Song Liu <songliubraving@...com> wrote:
> > On Feb 20, 2019, at 4:20 PM, Masami Hiramatsu <mhiramat@...nel.org> wrote:
> >
> > Hi Jann,
> >
> > On Wed, 20 Feb 2019 17:54:43 +0100
> > Jann Horn <jannh@...gle.com> wrote:
> >
> >> The first version of this method was missing the check for
> >> `ret == PATH_MAX`; then such a check was added, but it didn't call kfree()
> >> on error, so there was still a small memory leak in the error case.
> >> Fix it by using strndup_user() instead of open-coding it.
> >>
> >
> > This looks good to me.
> >
> > Reviewed-by: Masami Hiramatsu <mhiramat@...nel.org>
> >
> > BTW, for stable, this is good. For the long term, I think we should
> > fix strndup_user() to return -E2BUG when the user string is longer
> > than max.
OK, I'll add a stable tag (but it wont go until the merge window).
It also shouldn't be called "perf/core" as its in the tracing
directory, and thus "tracing/perf" would be more appropriate. But I see
that's what the patch it fixes calls it too :-/
I'll pull it in.
Thanks everyone!
-- Steve
> >
> > Thank you,
> >
> >> Fixes: 0eadcc7a7bc0 ("perf/core: Fix perf_uprobe_init()")
> >> Signed-off-by: Jann Horn <jannh@...gle.com>
>
> Thanks for the fix!
>
> Acked-by: Song Liu <songliubraving@...com>
Powered by blists - more mailing lists