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: <20150324110754.GF27134@krava.brq.redhat.com>
Date:	Tue, 24 Mar 2015 12:07:54 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Adrian Hunter <adrian.hunter@...el.com>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	linux-kernel@...r.kernel.org, David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Namhyung Kim <namhyung@...il.com>,
	Paul Mackerras <paulus@...ba.org>,
	Stephane Eranian <eranian@...gle.com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH V6 02/25] perf evlist: Add initial support for mmapping
 an AUX area buffer

On Mon, Mar 16, 2015 at 02:41:24PM +0200, Adrian Hunter wrote:

SNIP

> +#include <linux/bitops.h>
> +#include <linux/log2.h>
> +
> +#include "../perf.h"
> +#include "util.h"
> +#include "evlist.h"
> +#include "cpumap.h"
> +#include "thread_map.h"
> +#include "auxtrace.h"
> +
> +int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
> +			struct auxtrace_mmap_params *mp,
> +			void *userpg, int fd)
> +{
> +#if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT)
> +	pr_err("Cannot use AUX area tracing mmaps\n");
> +	return -1;
> +#endif
> +
> +	mm->userpg = userpg;
> +	mm->mask = mp->mask;
> +	mm->len = mp->len;
> +	mm->prev = 0;
> +	mm->idx = mp->idx;
> +	mm->tid = mp->tid;
> +	mm->cpu = mp->cpu;
> +
> +	if (!mp->len) {
> +		mm->base = NULL;

is it just for safety, or could mm->base be != NULL in here?
maybe good place to use WARN_ON check?

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