Public bug reported:

This is a follow-up from: https://discourse.ubuntu.com/t/ask-us-
anything-about-ubuntu-kernels/27664/142

Older Ubuntu distributions come with a kernel image that support eBPF
but are not built with a BTF file published (/sys/kernel/btf/vmlinux).
This BTF file is crucial when trying to run eBPF programs that were
built with CO-RE in mind such that a program can be compiled once and
run in any kernel (with some caveats) because the BPF loaders can use
the BTF file to relocate addresses of kernel fields at load time for the
currently running kernel. In the past I've used the debug symbols that
Ubuntu publishes to create BTF files using `pahole` for these older
kernels and then re-using that BTF file for any machine running that
kernel. This is not ideal but I had managed to work around it.

However, on distributions that are under ESM (Ubuntu 16 + Ubuntu 18)
there isn't a debug symbols repository from where to pull the debug
symbols packages to build their respective BTF file and no BTF file is
generated when the kernel is built. This essentially makes these ESM
kernels incompatible with eBPF programs that run using CO-RE (which is
more or less the norm nowadays). Based on my conversation on the
discourse link above it seems like ideally these ESM kernels should be
published with a BTF file.

P.S. I wasn't able to submit this through `ubuntu-bug linux` as it gave
me an error saying `Problem in linux-image-5.4.0-164-generic This is not
an official Ubuntu package. Please remove any third party package and
try again`. I am not sure why it says that as this is a Ubuntu VM
downloaded from the Ubuntu site, upgraded by doing `pro attach` and then
updated to the latest ESM kernel.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "cat /proc/version_signature"
   
https://bugs.launchpad.net/bugs/2038685/+attachment/5707462/+files/version.log

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/2038685

Title:
  Missing BTF file in Ubuntu ESM kernels

Status in linux package in Ubuntu:
  New

Bug description:
  This is a follow-up from: https://discourse.ubuntu.com/t/ask-us-
  anything-about-ubuntu-kernels/27664/142

  Older Ubuntu distributions come with a kernel image that support eBPF
  but are not built with a BTF file published (/sys/kernel/btf/vmlinux).
  This BTF file is crucial when trying to run eBPF programs that were
  built with CO-RE in mind such that a program can be compiled once and
  run in any kernel (with some caveats) because the BPF loaders can use
  the BTF file to relocate addresses of kernel fields at load time for
  the currently running kernel. In the past I've used the debug symbols
  that Ubuntu publishes to create BTF files using `pahole` for these
  older kernels and then re-using that BTF file for any machine running
  that kernel. This is not ideal but I had managed to work around it.

  However, on distributions that are under ESM (Ubuntu 16 + Ubuntu 18)
  there isn't a debug symbols repository from where to pull the debug
  symbols packages to build their respective BTF file and no BTF file is
  generated when the kernel is built. This essentially makes these ESM
  kernels incompatible with eBPF programs that run using CO-RE (which is
  more or less the norm nowadays). Based on my conversation on the
  discourse link above it seems like ideally these ESM kernels should be
  published with a BTF file.

  P.S. I wasn't able to submit this through `ubuntu-bug linux` as it
  gave me an error saying `Problem in linux-image-5.4.0-164-generic This
  is not an official Ubuntu package. Please remove any third party
  package and try again`. I am not sure why it says that as this is a
  Ubuntu VM downloaded from the Ubuntu site, upgraded by doing `pro
  attach` and then updated to the latest ESM kernel.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2038685/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to