linux-yocto/tools/testing/selftests/bpf/bpf_test_no_cfi/Makefile
Kui-Feng Lee e9bbda13a7 selftests/bpf: Test case for lacking CFI stub functions.
Ensure struct_ops rejects the registration of struct_ops types without
proper CFI stub functions.

bpf_test_no_cfi.ko is a module that attempts to register a struct_ops type
called "bpf_test_no_cfi_ops" with cfi_stubs of NULL and non-NULL value.
The NULL one should fail, and the non-NULL one should succeed. The module
can only be loaded successfully if these registrations yield the expected
results.

Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Link: https://lore.kernel.org/r/20240222021105.1180475-3-thinker.li@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
2024-02-22 12:26:41 -08:00

356 B

BPF_TEST_NO_CFI_DIR := $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))) KDIR ?= $(abspath $(BPF_TEST_NO_CFI_DIR)/../../../../..)

ifeq ($(V),1) Q = else Q = @ endif

MODULES = bpf_test_no_cfi.ko

obj-m += bpf_test_no_cfi.o

all: +$(Q)make -C $(KDIR) M=$(BPF_TEST_NO_CFI_DIR) modules

clean: +$(Q)make -C $(KDIR) M=$(BPF_TEST_NO_CFI_DIR) clean