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: <20170503005314.7oovr764r3e4elzd@ast-mbp>
Date:   Tue, 2 May 2017 17:53:16 -0700
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Jesper Dangaard Brouer <brouer@...hat.com>
Cc:     kafai@...com, netdev@...r.kernel.org, eric@...it.org,
        Daniel Borkmann <borkmann@...earbox.net>
Subject: Re: [net-next PATCH 1/4] samples/bpf: adjust rlimit RLIMIT_MEMLOCK
 for traceex2, tracex3 and tracex4

On Tue, May 02, 2017 at 02:31:50PM +0200, Jesper Dangaard Brouer wrote:
> Needed to adjust max locked memory RLIMIT_MEMLOCK for testing these bpf samples
> as these are using more and larger maps than can fit in distro default 64Kbytes limit.
> 
> Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com>
...
> +	struct rlimit r = {1024*1024, RLIM_INFINITY};
...
> +	struct rlimit r = {1024*1024, RLIM_INFINITY};

why magic numbers?
All other samples do
struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
 
> +	if (setrlimit(RLIMIT_MEMLOCK, &r)) {
> +		perror("setrlimit(RLIMIT_MEMLOCK)");

ip_tunnel.c test does:
perror("setrlimit(RLIMIT_MEMLOCK, RLIM_INFINITY)");
Few others do:
assert(!setrlimit(RLIMIT_MEMLOCK, &r));
and the rest just:
setrlimit(RLIMIT_MEMLOCK, &r);

We probalby need to move this to a helper.

> +	struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};

here it's consistent :)

> +	if (setrlimit(RLIMIT_MEMLOCK, &r)) {
> +		perror("setrlimit(RLIMIT_MEMLOCK, RLIM_INFINITY)");

but with different perror ?
Let's do a common helper for all?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ