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: <20181219105252.686775a4@cakuba.netronome.com>
Date:   Wed, 19 Dec 2018 10:52:52 -0800
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Taeung Song <treeze.taeung@...il.com>
Cc:     Daniel Borkmann <daniel@...earbox.net>,
        Alexei Starovoitov <ast@...nel.org>, netdev@...r.kernel.org,
        Andrey Ignatov <rdna@...com>
Subject: Re: [PATCH bpf-next] libbpf: Show possible section(type) names on
 when failed to guess a type

On Wed, 19 Dec 2018 17:52:40 +0900, Taeung Song wrote:
> We need to let users check their wrong section name
> with proper section names when failed to get proper type from it.
> Because there is no knowing what kind of section name can be used.

# bpftool prog help
Usage: bpftool prog { show | list } [PROG]
	[...]
	TYPE := { socket | kprobe | kretprobe | classifier | action |
                 tracepoint | raw_tracepoint | xdp | perf_event | cgroup/skb |
                 cgroup/sock | cgroup/dev | lwt_in | lwt_out | lwt_xmit |
                 lwt_seg6local | sockops | sk_skb | sk_msg | lirc_mode2 |
                 sk_reuseport | flow_dissector |
                 cgroup/bind4 | cgroup/bind6 | cgroup/post_bind4 |
                 cgroup/post_bind6 | cgroup/connect4 | cgroup/connect6 |
                 cgroup/sendmsg4 | cgroup/sendmsg6 }
       ATTACH_TYPE := { msg_verdict | skb_verdict | skb_parse |
                        flow_dissector }
       OPTIONS := { {-j|--json} [{-p|--pretty}] | {-f|--bpffs} |
	            {-m|--mapcompat} | {-n|--nomount} }

Also in man bpftool-prog.

Perhaps we could just point users to that info?  IMHO having libraries
unconditionally print warnings is not great..

> For example, when a 'cgroup' section name of a BPF program is used,
> 
> Before:
> 
>     $ bpftool prog load bpf-prog.o /sys/fs/bpf/prog1
>     Error: failed to guess program type based on section name cgroup
> 
> After:
> 
>     libbpf: failed to guess program type based on section name 'cgroup'
>     libbpf: possible section(type) names are: socket kprobe/ kretprobe/ classifier action tracepoint/ raw_tracepoint/ xdp perf_event lwt_in lwt_out lwt_xmit lwt_seg6local cgroup_skb/ingress cgroup_skb/egress cgroup/skb cgroup/sock cgroup/post_bind4 cgroup/post_bind6 cgroup/dev sockops sk_skb/stream_parser sk_skb/stream_verdict sk_skb sk_msg lirc_mode2 flow_dissector cgroup/bind4 cgroup/bind6 cgroup/connect4 cgroup/connect6 cgroup/sendmsg4 cgroup/sendmsg6
> 
> Cc: Jakub Kicinski <jakub.kicinski@...ronome.com>
> Cc: Andrey Ignatov <rdna@...com>
> Signed-off-by: Taeung Song <treeze.taeung@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ