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: <20131001071646.GA20023@gmail.com>
Date:	Tue, 1 Oct 2013 09:16:46 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Namhyung Kim <namhyung.kim@....com>,
	LKML <linux-kernel@...r.kernel.org>,
	Jiri Olsa <jolsa@...hat.com>, David Ahern <dsahern@...il.com>,
	Sonny Rao <sonnyrao@...omium.org>
Subject: Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file


* Namhyung Kim <namhyung@...nel.org> wrote:

> --- a/tools/perf/util/header.c
> +++ b/tools/perf/util/header.c
> @@ -2753,6 +2753,15 @@ int perf_session__read_header(struct perf_session *session)
>  	if (perf_file_header__read(&f_header, header, fd) < 0)
>  		return -EINVAL;
>  
> +	/*
> +	 * Sanity check that perf.data was written cleanly; data size is
> +	 * initialized to 0 and updated only if the on_exit function is run.
> +	 * If data size is still 0 then the file contains only partial
> +	 * information.  Just warn user and process it as much as it can.
> +	 */
> +	if (f_header.data.size == 0)
> +		pr_warning("Data size is 0. Was the record command properly terminated?\n");

Just a detail: it would be nice to make all the user facing messages in 
tools/perf/util/header.c more specific and more structured. For example 
prefixing it with 'perf header:' would be fine:

	WARNING: perf/header: Data size is 0. Was the 'perf record' command properly terminated?

or something like that.

etc.

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ