lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 10 Jul 2018 09:04:17 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Jiri Olsa <jolsa@...nel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>
Cc:     lkml <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Song Liu <songliubraving@...com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Yonghong Song <yhs@...com>, Josef Bacik <jbacik@...com>,
        daniel@...earbox.net, davem@...emloft.net,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] tracing/kprobe: Release kprobe print_fmt properly

On Mon,  9 Jul 2018 16:19:06 +0200
Jiri Olsa <jolsa@...nel.org> wrote:

> We don't release tk->tp.call.print_fmt when destroying
> local uprobe. Also there's missing print_fmt kfree in
> create_local_trace_kprobe error path.

OK, I finished testing and I'm all ready to push, but then I noticed
that Masami wasn't Cc'd. I like to get his ack before pushing to Linus.

-- Steve


> 
> Fixes: e12f03d7031a ("perf/core: Implement the 'perf_kprobe' PMU")
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
>  kernel/trace/trace_kprobe.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index daa81571b22a..21f718472942 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -1480,8 +1480,10 @@ create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
>  	}
>  
>  	ret = __register_trace_kprobe(tk);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		kfree(tk->tp.call.print_fmt);
>  		goto error;
> +	}
>  
>  	return &tk->tp.call;
>  error:
> @@ -1501,6 +1503,8 @@ void destroy_local_trace_kprobe(struct trace_event_call *event_call)
>  	}
>  
>  	__unregister_trace_kprobe(tk);
> +
> +	kfree(tk->tp.call.print_fmt);
>  	free_trace_kprobe(tk);
>  }
>  #endif /* CONFIG_PERF_EVENTS */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ