[PATCH 0/1] [SRU][R] selftests/bpf: fix FTBFS with clang 23 / gcc 15

Paolo Pisati paolo.pisati at canonical.com
Wed May 27 09:51:40 UTC 2026


BugLink: https://bugs.launchpad.net/bugs/2154343

[Impact]

Resolute kernel BPF selftest FTBFS like this:

tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c:117:12: error: assigning to 'char *' from 'const char *'
discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]

[Fix]

Apply the v7.1-rc1 upstream fix:

```
commit ca0f39a369c5f927c3d004e63a5a778b08a9df94
Author: Varun R Mallya <varunrmallya at gmail.com>
Date: Fri Mar 6 03:51:32 2026 +0530

    selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c

    Building selftests with
    clang 23.0.0 (6fae863eba8a72cdd82f37e7111a46a70be525e0) triggers
    the following error:

      tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c:117:12:
      error: assigning to 'char *' from 'const char *' discards qualifiers
      [-Werror,-Wincompatible-pointer-types-discards-qualifiers]

    The variable `tgt_name` is declared as `char *`, but it stores the
    result of strstr(prog_name[i], "/"). Since `prog_name[i]` is a
    `const char *`, the returned pointer should also be treated as
    const-qualified.

    Update `tgt_name` to `const char *` to match the type of the underlying
    string and silence the compiler warning.
```

[How to reproduce]

Run the test again after applying the patch

[Regression potential]

Low: clean upstream cherry-pick for a known issue.

Varun R Mallya (1):
  selftests/bpf: Fix const qualifier warning in fexit_bpf2bpf.c

 tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.43.0




More information about the kernel-team mailing list