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]
Message-ID: <20190920183118.GE4865@kernel.org>
Date:   Fri, 20 Sep 2019 15:31:18 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Masami Hiramatsu <mhiramat@...nel.org>
Cc:     Wang Nan <wangnan0@...wei.com>, Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [BUGFIX PATCH] perf/probe: Fix to clear tev->nargs in
 clear_probe_trace_event()

Em Mon, Sep 16, 2019 at 01:44:40AM +0900, Masami Hiramatsu escreveu:
> Since add_probe_trace_event() can reuse tf->tevs[i] after
> calling clear_probe_trace_event(), this can make perf-probe
> crash if the 1st attempt of probe event finding fails to find
> an event argument, and the 2nd attempt fails to find probe point.
> 
> E.g.
>   $ perf probe -D "task_pid_nr tsk"
>   Failed to find 'tsk' in this function.
>   Failed to get entry address of warn_bad_vsyscall
>   Segmentation fault (core dumped)

Thanks, tested and applied!

- Arnaldo
 
> 
> Fixes: 092b1f0b5f9f ("perf probe: Clear probe_trace_event when add_probe_trace_event() fails")
> Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> Cc: Wang Nan <wangnan0@...wei.com>
> ---
>  tools/perf/util/probe-event.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index b8e0967c5c21..91cab5f669d2 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -2331,6 +2331,7 @@ void clear_probe_trace_event(struct probe_trace_event *tev)
>  		}
>  	}
>  	zfree(&tev->args);
> +	tev->nargs = 0;
>  }
>  
>  struct kprobe_blacklist_node {

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ