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: <20150428123230.GB22258@krava.redhat.com>
Date:	Tue, 28 Apr 2015 14:32:30 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Adrian Hunter <adrian.hunter@...el.com>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	linux-kernel@...r.kernel.org, David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Namhyung Kim <namhyung@...il.com>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH V3 04/25] perf tools: Add AUX area tracing index

On Fri, Apr 24, 2015 at 10:29:46PM +0300, Adrian Hunter wrote:

SNIP

> --- a/tools/perf/util/auxtrace.c
> +++ b/tools/perf/util/auxtrace.c
> @@ -344,6 +344,33 @@ out_err:
>  	return err;
>  }
>  
> +static int auxtrace_queues__add_indexed_event(struct auxtrace_queues *queues,
> +					      struct perf_session *session,
> +					      off_t file_offset, size_t sz)
> +{
> +	union perf_event *event;
> +	int err;
> +	char buf[PERF_SAMPLE_MAX_SIZE];
> +
> +	err = perf_session__peek_event(session, file_offset, buf,
> +				       PERF_SAMPLE_MAX_SIZE, &event, NULL);
> +	if (err)
> +		return err;
> +
> +	if (event->header.type == PERF_RECORD_AUXTRACE) {
> +		if (event->header.size != sizeof(struct auxtrace_event) ||
> +		    event->header.size != sz) {
> +			err = -EINVAL;

getting lost in here

as per auxtrace_mmap__read it looks like we store PERF_RECORD_AUXTRACE event with:
	ev.auxtrace.header.size = sizeof(ev.auxtrace);

and it's followed with more data with size:
	ev.auxtrace.size = size + padding;

so why the check for 'event->header.size != sz' ?

jirka

> +			goto out;
> +		}
> +		file_offset += event->header.size;
> +		err = auxtrace_queues__add_event(queues, session, event,
> +						 file_offset, NULL);
> +	}
> +out:
> +	return err;
> +}

SNIP
--
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