Messages in this thread | | | Date | Thu, 21 Feb 2019 10:33:03 -0500 | From | Steven Rostedt <> | 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@fb.com> wrote:
> > On Feb 20, 2019, at 4:20 PM, Masami Hiramatsu <mhiramat@kernel.org> wrote: > > > > Hi Jann, > > > > On Wed, 20 Feb 2019 17:54:43 +0100 > > Jann Horn <jannh@google.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@kernel.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@google.com> > > Thanks for the fix! > > Acked-by: Song Liu <songliubraving@fb.com>
| |