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]
Date:   Wed, 11 Mar 2020 16:42:14 -0700
From:   John Fastabend <john.fastabend@...il.com>
To:     Quentin Monnet <quentin@...valent.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>
Cc:     bpf@...r.kernel.org, netdev@...r.kernel.org,
        Quentin Monnet <quentin@...valent.com>,
        Andrii Nakryiko <andriin@...com>
Subject: RE: [PATCH bpf-next] tools: bpftool: restore message on failure to
 guess program type

Quentin Monnet wrote:
> In commit 4a3d6c6a6e4d ("libbpf: Reduce log level for custom section
> names"), log level for messages for libbpf_attach_type_by_name() and
> libbpf_prog_type_by_name() was downgraded from "info" to "debug". The
> latter function, in particular, is used by bpftool when attempting to
> load programs, and this change caused bpftool to exit with no hint or
> error message when it fails to detect the type of the program to load
> (unless "-d" option was provided).
> 
> To help users understand why bpftool fails to load the program, let's do
> a second run of the function with log level in "debug" mode in case of
> failure.
> 
> Before:
> 
>     # bpftool prog load sample_ret0.o /sys/fs/bpf/sample_ret0
>     # echo $?
>     255
> 
> Or really verbose with -d flag:
> 
>     # bpftool -d prog load sample_ret0.o /sys/fs/bpf/sample_ret0
>     libbpf: loading sample_ret0.o
>     libbpf: section(1) .strtab, size 134, link 0, flags 0, type=3

[...]

> After:
> 
>     # bpftool prog load sample_ret0.o /sys/fs/bpf/sample_ret0
>     libbpf: failed to guess program type from ELF section '.text'
>     libbpf: supported section(type) names are: socket sk_reuseport kprobe/ [...]
> 
> Signed-off-by: Quentin Monnet <quentin@...valent.com>

lgtm

Acked-by: John Fastabend <john.fastabend@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ