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:	Fri, 11 Dec 2015 17:59:04 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc:	Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
	vince@...ter.net, eranian@...gle.com,
	Arnaldo Carvalho de Melo <acme@...radead.org>,
	Mathieu Poirier <mathieu.poirier@...aro.org>
Subject: Re: [PATCH v0 3/5] perf: Introduce instruction trace filtering

On Fri, Dec 11, 2015 at 03:36:36PM +0200, Alexander Shishkin wrote:
> +static int
> +perf_event_set_itrace_filter(struct perf_event *event, char *filter_str)
> +{
> +	int ret = 0;
> +
> +	/*
> +	 * Since this is called in perf_ioctl() path, we're already holding
> +	 * ctx::mutex.
> +	 */
> +	lockdep_assert_held(&event->ctx->mutex);
> +
> +	/*
> +	 * For now, we only support filtering in per-task events; doing so
> +	 * for cpu-wide events requires additional context switching trickery,
> +	 * since same object code will be mapped at different virtual
> +	 * addresses in different processes.
> +	 */
> +	if (!event->ctx->task)
> +		return -EOPNOTSUPP;
> +
> +	/* remove existing filters, if any */
> +	perf_itrace_filters_clear(event);
> +
> +	ret = perf_event_parse_itrace_filter(event, filter_str);
> +	if (!ret) {
> +		perf_itrace_filters_apply(event);
> +
> +		ret = perf_event_itrace_filters_setup(event);
> +		if (ret)
> +			perf_itrace_filters_clear(event);

This is what I meant, if you try and set a 'wrong' filter while it
already has filters set, you'll not only error out, you'll also wipe the
current state.

This seems wrong.

> +	}
> +
> +	return ret;
> +}
--
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