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: <CAEf4BzYhTeehgbFKwOkrjEzXH5NkKF6BTvZyiS-PRTdXetKEUQ@mail.gmail.com>
Date:   Mon, 27 Jul 2020 23:03:29 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Roman Gushchin <guro@...com>
Cc:     bpf <bpf@...r.kernel.org>, Networking <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Kernel Team <kernel-team@...com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next v2 31/35] bpf: runqslower: don't touch RLIMIT_MEMLOCK

On Mon, Jul 27, 2020 at 12:24 PM Roman Gushchin <guro@...com> wrote:
>
> Since bpf is not using memlock rlimit for memory accounting,
> there are no more reasons to bump the limit.
>
> Signed-off-by: Roman Gushchin <guro@...com>
> ---
>  tools/bpf/runqslower/runqslower.c | 16 ----------------
>  1 file changed, 16 deletions(-)
>

This can go, I suppose, we still have a runqslower variant in BCC with
this logic, to show an example on what/how to do this for kernels
without this patch set applied.

Acked-by: Andrii Nakryiko <andriin@...com>

> diff --git a/tools/bpf/runqslower/runqslower.c b/tools/bpf/runqslower/runqslower.c
> index d89715844952..a3380b53ce0c 100644
> --- a/tools/bpf/runqslower/runqslower.c
> +++ b/tools/bpf/runqslower/runqslower.c
> @@ -88,16 +88,6 @@ int libbpf_print_fn(enum libbpf_print_level level,
>         return vfprintf(stderr, format, args);
>  }
>
> -static int bump_memlock_rlimit(void)
> -{
> -       struct rlimit rlim_new = {
> -               .rlim_cur       = RLIM_INFINITY,
> -               .rlim_max       = RLIM_INFINITY,
> -       };
> -
> -       return setrlimit(RLIMIT_MEMLOCK, &rlim_new);
> -}
> -
>  void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)
>  {
>         const struct event *e = data;
> @@ -134,12 +124,6 @@ int main(int argc, char **argv)
>
>         libbpf_set_print(libbpf_print_fn);
>
> -       err = bump_memlock_rlimit();
> -       if (err) {
> -               fprintf(stderr, "failed to increase rlimit: %d", err);
> -               return 1;
> -       }
> -
>         obj = runqslower_bpf__open();
>         if (!obj) {
>                 fprintf(stderr, "failed to open and/or load BPF object\n");
> --
> 2.26.2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ