Re: bpf: Question about odd BPF verifier behaviour

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2023-02-26 at 03:03 +0200, Eduard Zingerman wrote:
> On Sat, 2023-02-25 at 20:50 +0000, Matt Bobrowski wrote:
> > Sorry Eduard, I replied late last night although the email bounced due
> > to exceeding the mail char limit. Let's try attaching a compressed
> > variant of the requested files, which includes the compiled kernel's
> > BTF and the kernel's config.
> 
> Hi Matt,
> 
> I tried using your config but still can't reproduce the issue.
> Will try to do it using debian 12 chroot tomorrow or on Monday.

Hi Matt,

Short update:
I've reproduced the issue with multiple STRUCT 'linux_binprm' BTF IDs
in Debian testing chroot, thank you for providing all details.
Attaching the instructions in the end of the email.
Need some time to analyze pahole behavior.

Thanks,
Eduard

--

host root:
  mkdir bookworm
  sudo debootstrap testing bookworm/ http://deb.debian.org/debian/
  sudo mount -t proc proc bookworm/proc/
  sudo mount -t sysfs sys bookworm/sys/
  sudo chroot bookworm/ /bin/bash

bookworm root:
  apt install python3 bc build-essential git \
    cmake libdwarf-dev libdw-dev flex bison \
    kmod cpio libncurses5-dev libelf-dev libssl-dev
  adduser eddy
  sudo eddy

bookworm user:
  cd ~
  git clone git://git.kernel.org/pub/scm/devel/pahole/pahole.git
  mkdir build && \
    cd build && \
    cmake -D__LIB=lib .. && \
    make -j $(nproc)
  export PATH=/home/eddy/pahole/build/:$PATH
  cd ~
  git clone https://github.com/torvalds/linux.git && cd linux
  make defconfig && make kvm_guest.config
  scripts/config \
   -e BPF \
   -e BPF_SYSCALL \
   -e BPF_LSM \
   -e BPF_JIT \
   -e BPF_EVENTS \
   -e DEBUG_INFO \
   -e DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT \
   -e DEBUG_INFO_BTF \
   -e DEBUG_INFO_BTF_MODULES \
   -e PAHOLE_HAS_SPLIT_BTF \
   -e FTRACE \
   -e DYNAMIC_FTRACE \
   -e FUNCTION_TRACER
  make olddefconfig
  # Multiple warnings in the end:
  #   WARN: multiple IDs found for 'task_struct': 176, 23383 - using 176
  #   WARN: multiple IDs found for 'file': 638, 23422 - using 638
  #   ...
  
  make -C ./tools/bpf/bpftool
  ./tools/bpf/bpftool/bpftool btf dump file ./vmlinux | \
    grep -c linux_binprm
  # The output is 19 for me

Repository versions:
  - kernel:
    f3a2439f20d9 ("Merge tag 'rproc-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux")
  - pahole:
    431df45 ("btfdiff: Exclude Rust CUs since those are not yet being converted to BTF on the Linux kernel")




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux