Skip to content

[bpf-ci-bot] bpftool_maps_access test fails on s390x no_alu32 and aarch64 no_alu32 #486

Description

@kernel-patches-review-bot

Summary

The bpftool_maps_access test (converted from shell script to test_progs in commit 2d96bbdfd3b5) fails deterministically on s390x in test_progs_no_alu32 mode and intermittently on aarch64 in test_progs_no_alu32 mode. These failures cause the entire test_progs_no_alu32 CI job to report failure across all independent PRs.

Failure Details

Root Cause Analysis

s390x: unprotected_unpinned fails at read map btf data

The test calls bpftool btf dump map name not_prot_map and unconditionally asserts success (line 272-273 of bpftool_maps_access.c). On s390x in no_alu32 mode, this command fails with exit code 255.

The bpftool btf dump map command works by:

  1. Finding the map by name (map_fd_by_name in tools/bpf/bpftool/common.c:973)
  2. Getting the map's btf_id from bpf_map_info (tools/bpf/bpftool/btf.c:948)
  3. Loading BTF from kernel by that ID (btf__load_from_kernel_by_id_split at line 1140)

When the map has btf_id == 0 (no BTF associated), step 3 fails. On s390x no_alu32, the kernel apparently does not associate BTF with this map, causing the failure.

The original shell script (test_bpftool_map.sh) was never executed as part of test_progs_no_alu32 — it was a standalone test. The conversion to test_progs (commit 2d96bbdfd3b5) inadvertently exposed it to all test flavors without adding appropriate guards.

Error message: test_basic_access:FAIL:read map btf data unexpected error: 65280 (errno 95)

aarch64: nested_maps fails at create outer map with EEXIST

The test_create_nested_maps subtest calls bpftool map create /sys/fs/bpf/test_bpftool_map/outer_map_tt ... which fails with EEXIST (errno 17), meaning the pin path already exists.

This is a cleanup/isolation issue: if a previous execution was interrupted or if the test_progs retry mechanism re-runs the test, stale pins from the first run may remain.

Error message: test_create_nested_maps:FAIL:create outer map unexpected error: 65280 (errno 17)

Proposed Fix

See 0001-selftests-bpf-Fix-bpftool_maps_access-failures-on-s.patch.

Two changes:

  1. BTF guard (s390x fix): Add a map_has_btf() helper that queries the map's kernel info to check if btf_id != 0. Only assert BTF dump success when the map actually has BTF associated.

  2. Cleanup before nested map creation (aarch64 fix): Call delete_pinned_map() for both inner and outer maps before creating them, ensuring stale pins from prior interrupted runs don't cause EEXIST.

Impact

Without fix, every s390x test_progs_no_alu32 CI job reports a failure (1 FAILED in Summary), causing misleading CI signal across all PRs. The aarch64 failure similarly causes false positives in the no_alu32 test results.

References

  • Commit 2d96bbdfd3b5: "selftests/bpf: convert test_bpftool_map_access.sh into test_progs framework" (Jan 23, 2026)
  • tools/testing/selftests/bpf/prog_tests/bpftool_maps_access.c:272-273 (BTF dump assertion)
  • tools/bpf/bpftool/btf.c:948,1140 (bpftool BTF dump map implementation)

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