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: <20141217140042.GA11607@kernel.org>
Date:	Wed, 17 Dec 2014 11:00:42 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
	Adrian Hunter <adrian.hunter@...el.com>,
	Borislav Petkov <bp@...e.de>, David Ahern <dsahern@...il.com>,
	Don Zickus <dzickus@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Mike Galbraith <efault@....de>,
	Namhyung Kim <namhyung@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 05/18] perf evlist: Do not use hard coded value for a
 mmap_pages default

Em Wed, Dec 17, 2014 at 02:23:30PM +0100, Jiri Olsa escreveu:
> On Tue, Dec 16, 2014 at 01:57:07PM -0300, Arnaldo Carvalho de Melo wrote:
> > +	if (pages == UINT_MAX) {
> > +		int max;
> > +
> > +		if (sysctl__read_int("kernel/perf_event_mlock_kb", &max) < 0) {
> > +			/*
> > +			 * Pick a once upon a time good value, i.e. things look
> > +			 * strange since we can't read a sysctl value, but lets not
> > +			 * die yet...
> > +			 */
> > +			max = 512;
> > +		} else {
> > +			max -= (page_size / 1024);
> > +		}
 
> so this way you depend on value in perf_event_mlock_kb being power 2,
> otherwise:

> # echo 1000 > /proc/sys/kernel/perf_event_mlock_kb
> $ perf record ls
> failed to mmap with 22 (Invalid argument)

Right, I thought that perf_event_mlock_kb input was validated, realized
that it is not, see the following patchkit that makes it validate that
after reading, using rounddown_pow_of_two if not.

- Arnaldo
 
> maybe you could use the logic/code from parse_pages_arg function
> 
> 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