From 73fb8cea7269334df6d2996b3a2a09c56d94e4e7 Mon Sep 17 00:00:00 2001 From: Mykola Lysenko Date: Mon, 21 Sep 2026 00:58:50 -0700 Subject: [PATCH] selftests/bpf: Generate the signing key and certificate once genkey produces the private key and certificate together, but an ordinary multi-target rule can run it twice concurrently when both outputs are required. Only the certificate is currently a prerequisite; the runner split will require both. Use an implicitly grouped pattern rule, as test_kmods already does, to support make versions before 4.3. Signed-off-by: Mykola Lysenko Acked-by: Eduard Zingerman Link: https://lore.kernel.org/bpf/20260921075855.2065871-5-nickolay.lysenko@gmail.com Signed-off-by: Kumar Kartikeya Dwivedi --- tools/testing/selftests/bpf/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 11bd8997aea5..5bcb762dc3fc 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -783,7 +783,10 @@ VERIFY_SIG_HDR := verification_cert.h VERIFICATION_CERT := $(BUILD_DIR)/signing_key.der PRIVATE_KEY := $(BUILD_DIR)/signing_key.pem -$(VERIFICATION_CERT) $(PRIVATE_KEY): $(VERIFY_SIG_SETUP) +# genkey writes both outputs. Pattern rules group them even on make +# versions before 4.3, preventing concurrent genkey invocations. +# Restrict the pattern to *_key files because genkey uses fixed names. +$(BUILD_DIR)/%_key.pem $(BUILD_DIR)/%_key.der: $(VERIFY_SIG_SETUP) $(Q)mkdir -p $(BUILD_DIR) $(Q)$(VERIFY_SIG_SETUP) genkey $(BUILD_DIR) -- knotmirror 0.0.1