diff options
| author | Ricardo B. Marlière <rbm@suse.com> | 2026-06-02 16:02:59 +0300 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-06-06 00:20:58 +0300 |
| commit | b85e63cb65f96df373b034cc347b0e18231cb0d5 (patch) | |
| tree | c0af6c40693995892eeb35f0539093a0084baa87 /include | |
| parent | f813a4d6877e9197f6e85120c144738e3c1c3b80 (diff) | |
| download | linux-b85e63cb65f96df373b034cc347b0e18231cb0d5.tar.xz | |
selftests/bpf: Provide weak definitions for cross-test functions
Some test files reference functions defined in other translation units that
may not be compiled when skeletons are missing. Replace forward
declarations of uprobe_multi_func_{1,2,3}() with weak no-op stubs so the
linker resolves them regardless of which objects are present.
The stub bodies are `asm volatile ("")` rather than empty, matching the
shape of the strong definitions in prog_tests/uprobe_multi_test.c. This
keeps the weak and strong sides on the same footing for the optimiser
(noinline + asm-barrier), which is the form upstream already relies on
for these functions.
Move stack_mprotect() from test_lsm.c into testing_helpers.c so it is
always available. The previous weak-stub approach returned 0, which would
cause callers expecting -1/EPERM to fail their assertions
deterministically. Having the real implementation in a shared utility
avoids this problem entirely.
Include <alloca.h> for alloca() so the build does not rely on glibc's
implicit declaration via <stdlib.h>.
Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
Link: https://lore.kernel.org/r/20260602-selftests-bpf_misconfig-v12-10-27f898b3ba26@suse.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
