Bug#1016586: bpftool: Dump of jited version of the BPF program requires libbfd support

2022-08-05 Thread Ben Hutchings
Control: tag -1 wontfix

On Wed, 2022-08-03 at 18:01 +0200, Emmanuel Fleury wrote:
[...]
> I suppose that the support for BPF must be add to libbfd in the binutils-dev 
> package by default.
> 
> Feel free to ask for more details if I was not clear in my report.

We don't and can't link with libbfd because of licence incompatibility.
Sorry.

Ben.

-- 
Ben Hutchings
Make three consecutive correct guesses and you will be considered
an expert.


signature.asc
Description: This is a digitally signed message part


Bug#1016586: bpftool: Dump of jited version of the BPF program requires libbfd support

2022-08-03 Thread Emmanuel Fleury

Package: bpftool
Version: 6.8.0+5.18.14-1
Severity: normal

Dear Maintainer,

I was trying to dump the jited version of a BPF program that was pinned in 
/sys/fs/bpf but I received a warning about libbpf that it wasn't supported.


Here is the content of the minimalist BPF program:

==
#include 
#include 

SEC("socket")
int bpf_prog (struct __sk_buff *skb)
{
  return 1;
}
==

Built with:

#> clang -target bpf -o basic.o -c basic.c

Inserted and pinned:

#(root)> bpftool prog load basic.o /sys/fs/bpf/bar

Checking that it is present in the loaded BPF programs:

#(root)> bpftool prog list

...
37: type 31  name bpf_prog  tag cba989f8e5d0e900
loaded_at 2022-08-02T16:31:18+0200  uid 0
xlated 24B  jited 29B  memlock 4096B


Dump the BPF format:

#(root)> bpftool prog dump xlated id 37
   0: (7b) *(u64 *)(r10 -8) = r1
   1: (b7) r0 = 1
   2: (95) exit


Attempt to dump the jitted format:

#(root)> bpftool prog dump jited pinned /sys/fs/bpf/foo

Error: No libbfd support


I suppose that the support for BPF must be add to libbfd in the binutils-dev 
package by default.


Feel free to ask for more details if I was not clear in my report.


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.18.0-3-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:\
en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages bpftool depends on:
ii  libc62.33-8
ii  libcap2  1:2.44-1
ii  libelf1  0.187-1
ii  zlib1g   1:1.2.11.dfsg-4

bpftool recommends no packages.

bpftool suggests no packages.

-- no debconf information



OpenPGP_0x926F8BC41D699DBC.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature