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  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, 8 Nov 2019 15:16:45 -0800
From:   Andrii Nakryiko <>
To:     Toke Høiland-Jørgensen <>
Cc:     Daniel Borkmann <>,
        Alexei Starovoitov <>,
        Martin KaFai Lau <>,
        Song Liu <>, Yonghong Song <>,
        Jesper Dangaard Brouer <>,
        David Miller <>,
        Networking <>, bpf <>
Subject: Re: [PATCH bpf-next v2 6/6] libbpf: Add getter for program size

On Fri, Nov 8, 2019 at 1:33 PM Toke Høiland-Jørgensen <> wrote:
> From: Toke Høiland-Jørgensen <>
> This adds a new getter for the BPF program size (in bytes). This is useful
> for a caller that is trying to predict how much memory will be locked by
> loading a BPF object into the kernel.
> Acked-by: Song Liu <>
> Signed-off-by: Toke Høiland-Jørgensen <>
> ---

Can you add comment mentioning that this is size in bytes, not in
number of instructions? It's certainly will be a first question anyone
using this will ask.

I think it's good to have this, but I don't think you can really
predict how much memory will be used. I'd expect memory used by maps
(and not just based on element size and count, but some internal
bookkeeping stuff) would be much bigger factor and not easy to guess.
So beyond just stats dumping, I think this won't be that helpful.

Acked-by: Andrii Nakryiko <>

>  tools/lib/bpf/libbpf.c   |    5 +++++
>  tools/lib/bpf/libbpf.h   |    1 +
>  tools/lib/bpf/ |    1 +
>  3 files changed, 7 insertions(+)


Powered by blists - more mailing lists