From: Sasha Levin Date: Mon, 25 Mar 2024 11:33:27 +0000 (-0400) Subject: Drop selftests-bpf-add-global-subprog-context-passing-tes.patch X-Git-Tag: v6.8.2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ebff2591cd81f48184eaf855c41ca8b995f66904;p=thirdparty%2Fkernel%2Fstable-queue.git Drop selftests-bpf-add-global-subprog-context-passing-tes.patch Signed-off-by: Sasha Levin --- diff --git a/queue-6.1/selftests-bpf-add-global-subprog-context-passing-tes.patch b/queue-6.1/selftests-bpf-add-global-subprog-context-passing-tes.patch deleted file mode 100644 index cfa7691dcb8..00000000000 --- a/queue-6.1/selftests-bpf-add-global-subprog-context-passing-tes.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 265e24f101bcbe1b11579d24363f7bb3b8f6f81c Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 15 Feb 2023 20:59:54 -0800 -Subject: selftests/bpf: Add global subprog context passing tests - -From: Andrii Nakryiko - -[ Upstream commit e2b5cfc978f871996d1f8667515c0e06b33e620e ] - -Add tests validating that it's possible to pass context arguments into -global subprogs for various types of programs, including a particularly -tricky KPROBE programs (which cover kprobes, uprobes, USDTs, a vast and -important class of programs). - -Signed-off-by: Andrii Nakryiko -Signed-off-by: Daniel Borkmann -Acked-by: Stanislav Fomichev -Link: https://lore.kernel.org/bpf/20230216045954.3002473-4-andrii@kernel.org -Stable-dep-of: 879bbe7aa4af ("bpf: don't infer PTR_TO_CTX for programs with unnamed context type") -Signed-off-by: Sasha Levin ---- - .../bpf/prog_tests/test_global_funcs.c | 2 + - .../bpf/progs/test_global_func_ctx_args.c | 104 ++++++++++++++++++ - 2 files changed, 106 insertions(+) - create mode 100644 tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c - -diff --git a/tools/testing/selftests/bpf/prog_tests/test_global_funcs.c b/tools/testing/selftests/bpf/prog_tests/test_global_funcs.c -index 2ff4d5c7abfce..e0879df38639b 100644 ---- a/tools/testing/selftests/bpf/prog_tests/test_global_funcs.c -+++ b/tools/testing/selftests/bpf/prog_tests/test_global_funcs.c -@@ -18,6 +18,7 @@ - #include "test_global_func15.skel.h" - #include "test_global_func16.skel.h" - #include "test_global_func17.skel.h" -+#include "test_global_func_ctx_args.skel.h" - - void test_test_global_funcs(void) - { -@@ -38,4 +39,5 @@ void test_test_global_funcs(void) - RUN_TESTS(test_global_func15); - RUN_TESTS(test_global_func16); - RUN_TESTS(test_global_func17); -+ RUN_TESTS(test_global_func_ctx_args); - } -diff --git a/tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c b/tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c -new file mode 100644 -index 0000000000000..7faa8eef0598b ---- /dev/null -+++ b/tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c -@@ -0,0 +1,104 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */ -+#include "vmlinux.h" -+#include -+#include -+#include -+#include "bpf_misc.h" -+ -+char _license[] SEC("license") = "GPL"; -+ -+static long stack[256]; -+ -+/* -+ * KPROBE contexts -+ */ -+ -+__weak int kprobe_typedef_ctx_subprog(bpf_user_pt_regs_t *ctx) -+{ -+ return bpf_get_stack(ctx, &stack, sizeof(stack), 0); -+} -+ -+SEC("?kprobe") -+__success -+int kprobe_typedef_ctx(void *ctx) -+{ -+ return kprobe_typedef_ctx_subprog(ctx); -+} -+ -+#define pt_regs_struct_t typeof(*(__PT_REGS_CAST((struct pt_regs *)NULL))) -+ -+__weak int kprobe_struct_ctx_subprog(pt_regs_struct_t *ctx) -+{ -+ return bpf_get_stack((void *)ctx, &stack, sizeof(stack), 0); -+} -+ -+SEC("?kprobe") -+__success -+int kprobe_resolved_ctx(void *ctx) -+{ -+ return kprobe_struct_ctx_subprog(ctx); -+} -+ -+/* this is current hack to make this work on old kernels */ -+struct bpf_user_pt_regs_t {}; -+ -+__weak int kprobe_workaround_ctx_subprog(struct bpf_user_pt_regs_t *ctx) -+{ -+ return bpf_get_stack(ctx, &stack, sizeof(stack), 0); -+} -+ -+SEC("?kprobe") -+__success -+int kprobe_workaround_ctx(void *ctx) -+{ -+ return kprobe_workaround_ctx_subprog(ctx); -+} -+ -+/* -+ * RAW_TRACEPOINT contexts -+ */ -+ -+__weak int raw_tp_ctx_subprog(struct bpf_raw_tracepoint_args *ctx) -+{ -+ return bpf_get_stack(ctx, &stack, sizeof(stack), 0); -+} -+ -+SEC("?raw_tp") -+__success -+int raw_tp_ctx(void *ctx) -+{ -+ return raw_tp_ctx_subprog(ctx); -+} -+ -+/* -+ * RAW_TRACEPOINT_WRITABLE contexts -+ */ -+ -+__weak int raw_tp_writable_ctx_subprog(struct bpf_raw_tracepoint_args *ctx) -+{ -+ return bpf_get_stack(ctx, &stack, sizeof(stack), 0); -+} -+ -+SEC("?raw_tp") -+__success -+int raw_tp_writable_ctx(void *ctx) -+{ -+ return raw_tp_writable_ctx_subprog(ctx); -+} -+ -+/* -+ * PERF_EVENT contexts -+ */ -+ -+__weak int perf_event_ctx_subprog(struct bpf_perf_event_data *ctx) -+{ -+ return bpf_get_stack(ctx, &stack, sizeof(stack), 0); -+} -+ -+SEC("?perf_event") -+__success -+int perf_event_ctx(void *ctx) -+{ -+ return perf_event_ctx_subprog(ctx); -+} --- -2.43.0 - diff --git a/queue-6.1/series b/queue-6.1/series index 059c69b1d71..397abe58275 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -145,7 +145,6 @@ arm64-dts-mediatek-mt8192-fix-vencoder-clock-name.patch arm64-dts-mediatek-mt7622-add-missing-device_type-to.patch bpf-mark-bpf_spin_-lock-unlock-helpers-with-notrace-.patch selftests-bpf-convert-test_global_funcs-test-to-test.patch -selftests-bpf-add-global-subprog-context-passing-tes.patch arm-dts-qcom-msm8974-correct-qfprom-node-size.patch wifi-wilc1000-prevent-use-after-free-on-vif-when-cle.patch acpi-processor_idle-fix-memory-leak-in-acpi_processo.patch