Skip to content

libbpf-rs is unable to load eBPF programs on older kernel versions #1151

Closed
@olcarver

Description

@olcarver

Kernel version: 5.4.0-1125-aws
Distro: Ubuntu 18.04.6 LTS

After bumping our libbpf-rs version from 0.21.2->0.24.8, we ran into the following error when trying to run our program on a system running kernel 5.4

BPF map `bss` mmap pointer is NULL

The error is being thrown during the new function of the auto generated OpenXXXXMaps code in *.skel.rs. This error does not occur when we run our program but with libbpf-rs version 0.21.2.

How to reproduce:

Attempting to run the sample capable on a new EC2 instance with the same kernel/distro version yields the same error but for rodata.

$ sudo ./capable

thread 'main' panicked at /home/ssm-user/libbpf-rs/examples/capable/src/bpf/capable.skel.rs:165:26:
BPF map `rodata` mmap pointer is NULL
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions