| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/07/30 11:26 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"BPF_SYSCALL",
"BPF_JIT"
],
"FocusSymbols": [
"arch_prepare_bpf_trampoline",
"arch_bpf_trampoline_size",
"bpf_struct_ops_desc_init",
"bpf_check_attach_target",
"bpf_check_attach_btf_id_multi"
],
"Reasoning": "The patch modifies the BPF verifier, JIT compiler, and struct_ops initialization to properly handle functions with arguments or return values larger than 8 bytes (e.g., `__int128`). It fixes how trampoline registers are calculated and rejects unsupported \u003e8 byte return values for certain attach types and struct_ops. These are functional changes in the core BPF subsystem reachable from userspace via the `bpf()` syscall.",
"WorthFuzzing": true
} |
| 1/1 | 2026/07/30 11:26 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 24ce14d3d0c85ff90636a417e0460df94bfe6442\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Thu Jul 30 11:26:16 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c\nindex b2feec81e2312..01e7ce569c1ed 100644\n--- a/arch/x86/net/bpf_jit_comp.c\n+++ b/arch/x86/net/bpf_jit_comp.c\n@@ -3369,11 +3369,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im\n \tWARN_ON_ONCE((flags \u0026 BPF_TRAMP_F_INDIRECT) \u0026\u0026\n \t\t (flags \u0026 ~(BPF_TRAMP_F_INDIRECT | BPF_TRAMP_F_RET_FENTRY_RET)));\n \n-\t/* extra registers for struct arguments */\n-\tfor (i = 0; i \u003c m-\u003enr_args; i++) {\n-\t\tif (m-\u003earg_flags[i] \u0026 BTF_FMODEL_STRUCT_ARG)\n-\t\t\tnr_regs += (m-\u003earg_size[i] + 7) / 8 - 1;\n-\t}\n+\tfor (i = 0; i \u003c m-\u003enr_args; i++)\n+\t\tnr_regs += (m-\u003earg_size[i] + 7) / 8 - 1;\n \n \t/* x86-64 supports up to MAX_BPF_FUNC_ARGS arguments. 1-6\n \t * are passed through regs, the remains are through stack.\ndiff --git a/kernel/bpf/bpf_struct_ops.c b/kernel/bpf/bpf_struct_ops.c\nindex 51b16e5f5534e..4e7a48c02be5c 100644\n--- a/kernel/bpf/bpf_struct_ops.c\n+++ b/kernel/bpf/bpf_struct_ops.c\n@@ -445,6 +445,18 @@ int bpf_struct_ops_desc_init(struct bpf_struct_ops_desc *st_ops_desc,\n \t\t\tgoto errout;\n \t\t}\n \n+\t\t/*\n+\t\t * A \u003e8 byte return value is passed back in a register pair,\n+\t\t * which the struct_ops trampoline does not preserve (only\n+\t\t * 8 bytes of the return value are saved and restored).\n+\t\t */\n+\t\tif (st_ops-\u003efunc_models[i].ret_size \u003e 8) {\n+\t\t\tpr_warn(\"func ptr %s in struct %s has a \u003e8 byte return value, which is not supported\\n\",\n+\t\t\t\tmname, st_ops-\u003ename);\n+\t\t\terr = -EOPNOTSUPP;\n+\t\t\tgoto errout;\n+\t\t}\n+\n \t\tstub_func_addr = *(void **)(st_ops-\u003ecfi_stubs + moff);\n \t\terr = prepare_arg_info(btf, st_ops-\u003ename, mname,\n \t\t\t\t func_proto, stub_func_addr,\ndiff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c\nindex e6f35f4e715b6..8d0635ee48c7e 100644\n--- a/kernel/bpf/verifier.c\n+++ b/kernel/bpf/verifier.c\n@@ -19027,6 +19027,20 @@ btf_attach_func_proto(struct bpf_verifier_log *log, struct btf *btf, u32 func_id\n \treturn btf_type_by_id(btf, func-\u003etype);\n }\n \n+static bool attach_uses_trampoline_retval(enum bpf_attach_type type)\n+{\n+\tswitch (type) {\n+\tcase BPF_MODIFY_RETURN:\n+\tcase BPF_TRACE_FEXIT:\n+\tcase BPF_TRACE_FEXIT_MULTI:\n+\tcase BPF_TRACE_FSESSION:\n+\tcase BPF_TRACE_FSESSION_MULTI:\n+\t\treturn true;\n+\tdefault:\n+\t\treturn false;\n+\t}\n+}\n+\n int bpf_check_attach_target(struct bpf_verifier_log *log,\n \t\t\t const struct bpf_prog *prog,\n \t\t\t const struct bpf_prog *tgt_prog,\n@@ -19291,6 +19305,14 @@ int bpf_check_attach_target(struct bpf_verifier_log *log,\n \t\tif (ret \u003c 0)\n \t\t\treturn ret;\n \n+\t\tif (tgt_info-\u003efmodel.ret_size \u003e 8 \u0026\u0026\n+\t\t attach_uses_trampoline_retval(prog-\u003eexpected_attach_type)) {\n+\t\t\tbpf_log(log,\n+\t\t\t\t\"Attach to function %s with a \u003e8 byte return value is not supported for this attach type\\n\",\n+\t\t\t\ttname);\n+\t\t\treturn -EOPNOTSUPP;\n+\t\t}\n+\n \t\t/*\n \t\t * *.multi programs don't need an address during program\n \t\t * verification, we just take the module ref if needed.\n@@ -19565,6 +19587,9 @@ int bpf_check_attach_btf_id_multi(struct btf *btf, struct bpf_prog *prog, u32 bt\n \terr = btf_distill_func_proto(NULL, btf, t, tname, \u0026tgt_info-\u003efmodel);\n \tif (err \u003c 0)\n \t\treturn err;\n+\tif (tgt_info-\u003efmodel.ret_size \u003e 8 \u0026\u0026\n+\t attach_uses_trampoline_retval(prog-\u003eexpected_attach_type))\n+\t\treturn -EOPNOTSUPP;\n \tif (btf_is_module(btf)) {\n \t\t/* The bpf program already holds reference to module. */\n \t\tif (WARN_ON_ONCE(!prog-\u003eaux-\u003emod))\ndiff --git a/tools/testing/selftests/bpf/prog_tests/tracing_failure.c b/tools/testing/selftests/bpf/prog_tests/tracing_failure.c\nindex f9f9e1cb87bf1..eb585918f0d43 100644\n--- a/tools/testing/selftests/bpf/prog_tests/tracing_failure.c\n+++ b/tools/testing/selftests/bpf/prog_tests/tracing_failure.c\n@@ -76,6 +76,24 @@ static void test_fexit_noreturns(void)\n \t\t\t \"Attaching fexit/fsession/fmod_ret to __noreturn function 'do_exit' is rejected.\");\n }\n \n+static void test_fexit_int128_ret(void)\n+{\n+\t/*\n+\t * __int128 is returned in a register pair on x86_64 and arm64, so\n+\t * bpf_testmod_test_int128_ret() is BTF-encoded and attachable and the\n+\t * verifier can reject its \u003e8 byte return value. Other architectures\n+\t * return a __int128 differently (e.g. s390x returns larger values by\n+\t * reference, which makes pahole skip BTF encoding of the function), so\n+\t * only exercise this on x86_64 and arm64.\n+\t */\n+#if defined(__x86_64__) || defined(__aarch64__)\n+\ttest_tracing_fail_prog(\"fexit_int128_ret\",\n+\t\t\t \"with a \u003e8 byte return value is not supported for this attach type\");\n+#else\n+\ttest__skip();\n+#endif\n+}\n+\n void test_tracing_failure(void)\n {\n \tif (test__start_subtest(\"bpf_spin_lock\"))\n@@ -86,4 +104,6 @@ void test_tracing_failure(void)\n \t\ttest_tracing_deny();\n \tif (test__start_subtest(\"fexit_noreturns\"))\n \t\ttest_fexit_noreturns();\n+\tif (test__start_subtest(\"fexit_int128_ret\"))\n+\t\ttest_fexit_int128_ret();\n }\ndiff --git a/tools/testing/selftests/bpf/prog_tests/tracing_struct.c b/tools/testing/selftests/bpf/prog_tests/tracing_struct.c\nindex 6f8c0bfb04155..15b95d0235b52 100644\n--- a/tools/testing/selftests/bpf/prog_tests/tracing_struct.c\n+++ b/tools/testing/selftests/bpf/prog_tests/tracing_struct.c\n@@ -4,6 +4,7 @@\n #include \u003ctest_progs.h\u003e\n #include \"tracing_struct.skel.h\"\n #include \"tracing_struct_many_args.skel.h\"\n+#include \"tracing_struct_int128.skel.h\"\n \n static void test_struct_args(void)\n {\n@@ -112,6 +113,39 @@ static void test_struct_many_args(void)\n \ttracing_struct_many_args__destroy(skel);\n }\n \n+static void test_int128_args(void)\n+{\n+\t/*\n+\t * __int128 arguments are passed in a register pair on x86_64 and\n+\t * arm64, which the trampoline packs into two context slots. Other\n+\t * architectures pass a __int128 differently (e.g. s390x passes larger\n+\t * arguments by reference), so only exercise this on x86_64 and arm64.\n+\t */\n+#if defined(__x86_64__) || defined(__aarch64__)\n+\tstruct tracing_struct_int128 *skel;\n+\tint err;\n+\n+\tskel = tracing_struct_int128__open_and_load();\n+\tif (!ASSERT_OK_PTR(skel, \"tracing_struct_int128__open_and_load\"))\n+\t\treturn;\n+\n+\terr = tracing_struct_int128__attach(skel);\n+\tif (!ASSERT_OK(err, \"tracing_struct_int128__attach\"))\n+\t\tgoto destroy_skel;\n+\n+\tASSERT_OK(trigger_module_test_read(256), \"trigger_read\");\n+\n+\tASSERT_EQ(skel-\u003ebss-\u003et_b, 2, \"t:b\");\n+\tASSERT_EQ(skel-\u003ebss-\u003et_c, 3, \"t:c\");\n+\tASSERT_EQ(skel-\u003ebss-\u003et_ret, 6, \"t ret\");\n+\n+destroy_skel:\n+\ttracing_struct_int128__destroy(skel);\n+#else\n+\ttest__skip();\n+#endif\n+}\n+\n static void test_union_args(void)\n {\n \tstruct tracing_struct *skel;\n@@ -145,6 +179,8 @@ void test_tracing_struct(void)\n \t\ttest_struct_args();\n \tif (test__start_subtest(\"struct_many_args\"))\n \t\ttest_struct_many_args();\n+\tif (test__start_subtest(\"int128_args\"))\n+\t\ttest_int128_args();\n \tif (test__start_subtest(\"union_args\"))\n \t\ttest_union_args();\n }\ndiff --git a/tools/testing/selftests/bpf/progs/tracing_failure.c b/tools/testing/selftests/bpf/progs/tracing_failure.c\nindex 65e485c4468c6..f7a0957676795 100644\n--- a/tools/testing/selftests/bpf/progs/tracing_failure.c\n+++ b/tools/testing/selftests/bpf/progs/tracing_failure.c\n@@ -30,3 +30,9 @@ int BPF_PROG(fexit_noreturns)\n {\n \treturn 0;\n }\n+\n+SEC(\"?fexit/bpf_testmod_test_int128_ret\")\n+int BPF_PROG(fexit_int128_ret)\n+{\n+\treturn 0;\n+}\ndiff --git a/tools/testing/selftests/bpf/progs/tracing_struct_int128.c b/tools/testing/selftests/bpf/progs/tracing_struct_int128.c\nnew file mode 100644\nindex 0000000000000..4638dfec1f38e\n--- /dev/null\n+++ b/tools/testing/selftests/bpf/progs/tracing_struct_int128.c\n@@ -0,0 +1,18 @@\n+// SPDX-License-Identifier: GPL-2.0\n+/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */\n+#include \u003cvmlinux.h\u003e\n+#include \u003cbpf/bpf_tracing.h\u003e\n+#include \u003cbpf/bpf_helpers.h\u003e\n+\n+long t_b, t_c, t_ret;\n+\n+SEC(\"fexit/bpf_testmod_test_int128_arg\")\n+int test_int128_arg_fexit(unsigned long long *ctx)\n+{\n+\tt_b = (int)ctx[2];\n+\tt_c = (long)ctx[3];\n+\tt_ret = (long)ctx[4];\n+\treturn 0;\n+}\n+\n+char _license[] SEC(\"license\") = \"GPL\";\ndiff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c\nindex 30f1cd23093cb..eb0f9b5e18d85 100644\n--- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c\n+++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c\n@@ -161,6 +161,33 @@ bpf_testmod_test_arg_ptr_to_struct(struct bpf_testmod_struct_arg_1 *a) {\n \treturn bpf_testmod_test_struct_arg_result;\n }\n \n+#ifdef __SIZEOF_INT128__\n+noinline __int128\n+bpf_testmod_test_int128_ret(int a)\n+{\n+\tbpf_testmod_test_struct_arg_result = a;\n+\treturn (__int128)a;\n+}\n+\n+/*\n+ * The __int128 'a' is the first argument on purpose. On arm64 a 16-byte\n+ * argument must start in an even-numbered register pair, so placing it\n+ * after a single-register scalar would leave a padding register (x1)\n+ * unused. pahole maps parameters to registers positionally and would then\n+ * see the following argument in an \"unexpected\" register and skip BTF\n+ * encoding of the whole function, making it unattachable. Keeping the\n+ * __int128 first (x0:x1) avoids the padding while still exercising the\n+ * trampoline packing of a 128-bit argument together with the trailing\n+ * int and long arguments.\n+ */\n+noinline long\n+bpf_testmod_test_int128_arg(__int128 a, int b, long c)\n+{\n+\tbpf_testmod_test_struct_arg_result = (long)a + b + c;\n+\treturn bpf_testmod_test_struct_arg_result;\n+}\n+#endif\n+\n __weak noinline void bpf_testmod_looooooooooooooooooooooooooooooong_name(void)\n {\n }\n@@ -514,6 +541,11 @@ bpf_testmod_test_read(struct file *file, struct kobject *kobj,\n \n \t(void)bpf_testmod_test_arg_ptr_to_struct(\u0026struct_arg1_2);\n \n+#ifdef __SIZEOF_INT128__\n+\t(void)bpf_testmod_test_int128_ret(i);\n+\t(void)bpf_testmod_test_int128_arg((__int128)1, 2, 3);\n+#endif\n+\n \t(void)trace_bpf_testmod_test_raw_tp_null_tp(NULL);\n \n \tbpf_testmod_test_struct_ops3();\n"
} |
| 2/1 | 2026/07/30 11:26 | agent | patch-evaluator |
0mModel:best-expensive Args: null Results: {
"EnableConfigs": [
"BPF_SYSCALL",
"BPF_JIT"
],
"FocusSymbols": [
"arch_prepare_bpf_trampoline",
"arch_bpf_trampoline_size",
"bpf_struct_ops_desc_init",
"bpf_check_attach_target",
"bpf_check_attach_btf_id_multi"
],
"Reasoning": "The patch modifies the BPF verifier, JIT compiler, and struct_ops initialization to properly handle functions with arguments or return values larger than 8 bytes (e.g., `__int128`). It fixes how trampoline registers are calculated and rejects unsupported \u003e8 byte return values for certain attach types and struct_ops. These are functional changes in the core BPF subsystem reachable from userspace via the `bpf()` syscall.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 24ce14d3d0c85ff90636a417e0460df94bfe6442
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Jul 30 11:26:16 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index b2feec81e2312..01e7ce569c1ed 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -3369,11 +3369,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im
WARN_ON_ONCE((flags & BPF_TRAMP_F_INDIRECT) &&
(flags & ~(BPF_TRAMP_F_INDIRECT | BPF_TRAMP_F_RET_FENTRY_RET)));
- /* extra registers for struct arguments */
- for (i = 0; i < m->nr_args; i++) {
- if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG)
- nr_regs += (m->arg_size[i] + 7) / 8 - 1;
- }
+ for (i = 0; i < m->nr_args; i++)
+ nr_regs += (m->arg_size[i] + 7) / 8 - 1;
/* x86-64 supports up to MAX_BPF_FUNC_ARGS arguments. 1-6
* are passed through regs, the remains are through stack.
diff --git a/kernel/bpf/bpf_struct_ops.c b/kernel/bpf/bpf_struct_ops.c
index 51b16e5f5534e..4e7a48c02be5c 100644
--- a/kernel/bpf/bpf_struct_ops.c
+++ b/kernel/bpf/bpf_struct_ops.c
@@ -445,6 +445,18 @@ int bpf_struct_ops_desc_init(struct bpf_struct_ops_desc *st_ops_desc,
goto errout;
}
+ /*
+ * A >8 byte return value is passed back in a register pair,
+ * which the struct_ops trampoline does not preserve (only
+ * 8 bytes of the return value are saved and restored).
+ */
+ if (st_ops->func_models[i].ret_size > 8) {
+ pr_warn("func ptr %s in struct %s has a >8 byte return value, which is not supported\n",
+ mname, st_ops->name);
+ err = -EOPNOTSUPP;
+ goto errout;
+ }
+
stub_func_addr = *(void **)(st_ops->cfi_stubs + moff);
err = prepare_arg_info(btf, st_ops->name, mname,
func_proto, stub_func_addr,
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index e6f35f4e715b6..8d0635ee48c7e 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -19027,6 +19027,20 @@ btf_attach_func_proto(struct bpf_verifier_log *log, struct btf *btf, u32 func_id
return btf_type_by_id(btf, func->type);
}
+static bool attach_uses_trampoline_retval(enum bpf_attach_type type)
+{
+ switch (type) {
+ case BPF_MODIFY_RETURN:
+ case BPF_TRACE_FEXIT:
+ case BPF_TRACE_FEXIT_MULTI:
+ case BPF_TRACE_FSESSION:
+ case BPF_TRACE_FSESSION_MULTI:
+ return true;
+ default:
+ return false;
+ }
+}
+
int bpf_check_attach_target(struct bpf_verifier_log *log,
const struct bpf_prog *prog,
const struct bpf_prog *tgt_prog,
@@ -19291,6 +19305,14 @@ int bpf_check_attach_target(struct bpf_verifier_log *log,
if (ret < 0)
return ret;
+ if (tgt_info->fmodel.ret_size > 8 &&
+ attach_uses_trampoline_retval(prog->expected_attach_type)) {
+ bpf_log(log,
+ "Attach to function %s with a >8 byte return value is not supported for this attach type\n",
+ tname);
+ return -EOPNOTSUPP;
+ }
+
/*
* *.multi programs don't need an address during program
* verification, we just take the module ref if needed.
@@ -19565,6 +19587,9 @@ int bpf_check_attach_btf_id_multi(struct btf *btf, struct bpf_prog *prog, u32 bt
err = btf_distill_func_proto(NULL, btf, t, tname, &tgt_info->fmodel);
if (err < 0)
return err;
+ if (tgt_info->fmodel.ret_size > 8 &&
+ attach_uses_trampoline_retval(prog->expected_attach_type))
+ return -EOPNOTSUPP;
if (btf_is_module(btf)) {
/* The bpf program already holds reference to module. */
if (WARN_ON_ONCE(!prog->aux->mod))
diff --git a/tools/testing/selftests/bpf/prog_tests/tracing_failure.c b/tools/testing/selftests/bpf/prog_tests/tracing_failure.c
index f9f9e1cb87bf1..eb585918f0d43 100644
--- a/tools/testing/selftests/bpf/prog_tests/tracing_failure.c
+++ b/tools/testing/selftests/bpf/prog_tests/tracing_failure.c
@@ -76,6 +76,24 @@ static void test_fexit_noreturns(void)
"Attaching fexit/fsession/fmod_ret to __noreturn function 'do_exit' is rejected.");
}
+static void test_fexit_int128_ret(void)
+{
+ /*
+ * __int128 is returned in a register pair on x86_64 and arm64, so
+ * bpf_testmod_test_int128_ret() is BTF-encoded and attachable and the
+ * verifier can reject its >8 byte return value. Other architectures
+ * return a __int128 differently (e.g. s390x returns larger values by
+ * reference, which makes pahole skip BTF encoding of the function), so
+ * only exercise this on x86_64 and arm64.
+ */
+#if defined(__x86_64__) || defined(__aarch64__)
+ test_tracing_fail_prog("fexit_int128_ret",
+ "with a >8 byte return value is not supported for this attach type");
+#else
+ test__skip();
+#endif
+}
+
void test_tracing_failure(void)
{
if (test__start_subtest("bpf_spin_lock"))
@@ -86,4 +104,6 @@ void test_tracing_failure(void)
test_tracing_deny();
if (test__start_subtest("fexit_noreturns"))
test_fexit_noreturns();
+ if (test__start_subtest("fexit_int128_ret"))
+ test_fexit_int128_ret();
}
diff --git a/tools/testing/selftests/bpf/prog_tests/tracing_struct.c b/tools/testing/selftests/bpf/prog_tests/tracing_struct.c
index 6f8c0bfb04155..15b95d0235b52 100644
--- a/tools/testing/selftests/bpf/prog_tests/tracing_struct.c
+++ b/tools/testing/selftests/bpf/prog_tests/tracing_struct.c
@@ -4,6 +4,7 @@
#include <test_progs.h>
#include "tracing_struct.skel.h"
#include "tracing_struct_many_args.skel.h"
+#include "tracing_struct_int128.skel.h"
static void test_struct_args(void)
{
@@ -112,6 +113,39 @@ static void test_struct_many_args(void)
tracing_struct_many_args__destroy(skel);
}
+static void test_int128_args(void)
+{
+ /*
+ * __int128 arguments are passed in a register pair on x86_64 and
+ * arm64, which the trampoline packs into two context slots. Other
+ * architectures pass a __int128 differently (e.g. s390x passes larger
+ * arguments by reference), so only exercise this on x86_64 and arm64.
+ */
+#if defined(__x86_64__) || defined(__aarch64__)
+ struct tracing_struct_int128 *skel;
+ int err;
+
+ skel = tracing_struct_int128__open_and_load();
+ if (!ASSERT_OK_PTR(skel, "tracing_struct_int128__open_and_load"))
+ return;
+
+ err = tracing_struct_int128__attach(skel);
+ if (!ASSERT_OK(err, "tracing_struct_int128__attach"))
+ goto destroy_skel;
+
+ ASSERT_OK(trigger_module_test_read(256), "trigger_read");
+
+ ASSERT_EQ(skel->bss->t_b, 2, "t:b");
+ ASSERT_EQ(skel->bss->t_c, 3, "t:c");
+ ASSERT_EQ(skel->bss->t_ret, 6, "t ret");
+
+destroy_skel:
+ tracing_struct_int128__destroy(skel);
+#else
+ test__skip();
+#endif
+}
+
static void test_union_args(void)
{
struct tracing_struct *skel;
@@ -145,6 +179,8 @@ void test_tracing_struct(void)
test_struct_args();
if (test__start_subtest("struct_many_args"))
test_struct_many_args();
+ if (test__start_subtest("int128_args"))
+ test_int128_args();
if (test__start_subtest("union_args"))
test_union_args();
}
diff --git a/tools/testing/selftests/bpf/progs/tracing_failure.c b/tools/testing/selftests/bpf/progs/tracing_failure.c
index 65e485c4468c6..f7a0957676795 100644
--- a/tools/testing/selftests/bpf/progs/tracing_failure.c
+++ b/tools/testing/selftests/bpf/progs/tracing_failure.c
@@ -30,3 +30,9 @@ int BPF_PROG(fexit_noreturns)
{
return 0;
}
+
+SEC("?fexit/bpf_testmod_test_int128_ret")
+int BPF_PROG(fexit_int128_ret)
+{
+ return 0;
+}
diff --git a/tools/testing/selftests/bpf/progs/tracing_struct_int128.c b/tools/testing/selftests/bpf/progs/tracing_struct_int128.c
new file mode 100644
index 0000000000000..4638dfec1f38e
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/tracing_struct_int128.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
+#include <vmlinux.h>
+#include <bpf/bpf_tracing.h>
+#include <bpf/bpf_helpers.h>
+
+long t_b, t_c, t_ret;
+
+SEC("fexit/bpf_testmod_test_int128_arg")
+int test_int128_arg_fexit(unsigned long long *ctx)
+{
+ t_b = (int)ctx[2];
+ t_c = (long)ctx[3];
+ t_ret = (long)ctx[4];
+ return 0;
+}
+
+char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
index 30f1cd23093cb..eb0f9b5e18d85 100644
--- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
+++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
@@ -161,6 +161,33 @@ bpf_testmod_test_arg_ptr_to_struct(struct bpf_testmod_struct_arg_1 *a) {
return bpf_testmod_test_struct_arg_result;
}
+#ifdef __SIZEOF_INT128__
+noinline __int128
+bpf_testmod_test_int128_ret(int a)
+{
+ bpf_testmod_test_struct_arg_result = a;
+ return (__int128)a;
+}
+
+/*
+ * The __int128 'a' is the first argument on purpose. On arm64 a 16-byte
+ * argument must start in an even-numbered register pair, so placing it
+ * after a single-register scalar would leave a padding register (x1)
+ * unused. pahole maps parameters to registers positionally and would then
+ * see the following argument in an "unexpected" register and skip BTF
+ * encoding of the whole function, making it unattachable. Keeping the
+ * __int128 first (x0:x1) avoids the padding while still exercising the
+ * trampoline packing of a 128-bit argument together with the trailing
+ * int and long arguments.
+ */
+noinline long
+bpf_testmod_test_int128_arg(__int128 a, int b, long c)
+{
+ bpf_testmod_test_struct_arg_result = (long)a + b + c;
+ return bpf_testmod_test_struct_arg_result;
+}
+#endif
+
__weak noinline void bpf_testmod_looooooooooooooooooooooooooooooong_name(void)
{
}
@@ -514,6 +541,11 @@ bpf_testmod_test_read(struct file *file, struct kobject *kobj,
(void)bpf_testmod_test_arg_ptr_to_struct(&struct_arg1_2);
+#ifdef __SIZEOF_INT128__
+ (void)bpf_testmod_test_int128_ret(i);
+ (void)bpf_testmod_test_int128_arg((__int128)1, 2, 3);
+#endif
+
(void)trace_bpf_testmod_test_raw_tp_null_tp(NULL);
bpf_testmod_test_struct_ops3();
|
| 3/2 | 2026/07/30 11:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 6046 output: 46 thoughts: 928 Thoughts: **BPF Trampoline and Struct Ops Modification Deep Dive** Okay, so I'm looking at this patch that fundamentally tweaks the BPF trampoline and how struct operations are handled. My initial thought is, this is pretty significant, potentially impacting performance and, more importantly, correctness, so this is definitely worth my detailed attention. First, I see a change in `arch/x86/net/bpf_jit_comp.c`. The modification is to `__arch_prepare_bpf_trampoline`, specifically how `nr_regs` is computed. The original code only considered struct arguments when calculating extra registers, but now, it accounts for *all* arguments larger than 8 bytes, which seems like a much cleaner and potentially more correct approach. This is a fundamental change in register allocation, so I need to verify its impact on various architectures and program types. Next, there's a restriction added in `kernel/bpf/bpf_struct_ops.c`. It's rejecting struct ops functions that return values larger than 8 bytes. That makes perfect sense; 8 bytes is the standard register size, and handling larger returns adds significant complexity, which is something I definitely support. It simplifies the design and likely improves the overall stability of the system. Finally, in `kernel/bpf/verifier.c`, the patch adds checks within `bpf_check_attach_target` and `bpf_check_attach_btf_id_multi`, to prevent attaching to functions that have a return size > 8 bytes, for certain attach types like `BPF_MODIFY_RETURN` and `BPF_TRACE_FEXIT`. This makes perfect sense, preventing any unexpected behavior in the kernel. So, in essence, this patch imposes stricter size limits on struct operations and retvals. This is a core BPF verifier and JIT change that can be reached from user space via the `bpf()` syscall. This means it's a prime target for fuzzing. I'll need to focus my fuzzing efforts on the specific entry points: `__arch_prepare_bpf_trampoline`, `bpf_struct_ops_desc_init`, `bpf_check_attach_target` and `bpf_check_attach_btf_id_multi`. I see `__arch_prepare_bpf_trampoline` is called by `arch_prepare_bpf_trampoline`, so I need to make sure I understand the full call graph to verify there are no hidden interactions. |
| 4/2 | 2026/07/30 11:26 | tool | grepper |
0mArgs:{
"Expression": "__arch_prepare_bpf_trampoline",
"PathPrefix": "arch/x86/net/bpf_jit_comp.c"
}Results: {
"Output": "arch/x86/net/bpf_jit_comp.c=3244=static int invoke_bpf_mod_ret(const struct btf_func_model *m, u8 **pprog,\n--\narch/x86/net/bpf_jit_comp.c-3345- */\narch/x86/net/bpf_jit_comp.c:3346:static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_image,\narch/x86/net/bpf_jit_comp.c-3347-\t\t\t\t\t void *rw_image_end, void *image,\n--\narch/x86/net/bpf_jit_comp.c=3666=int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *image_end,\n--\narch/x86/net/bpf_jit_comp.c-3681-\narch/x86/net/bpf_jit_comp.c:3682:\tret = __arch_prepare_bpf_trampoline(im, rw_image, rw_image + size, image, m,\narch/x86/net/bpf_jit_comp.c-3683-\t\t\t\t\t flags, tnodes, func_addr);\n--\narch/x86/net/bpf_jit_comp.c=3695=int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\n--\narch/x86/net/bpf_jit_comp.c-3701-\narch/x86/net/bpf_jit_comp.c:3702:\t/* Allocate a temporary buffer for __arch_prepare_bpf_trampoline().\narch/x86/net/bpf_jit_comp.c-3703-\t *\n--\narch/x86/net/bpf_jit_comp.c-3711-\narch/x86/net/bpf_jit_comp.c:3712:\tret = __arch_prepare_bpf_trampoline(\u0026im, image, image + PAGE_SIZE, image,\narch/x86/net/bpf_jit_comp.c-3713-\t\t\t\t\t m, flags, tnodes, func_addr);\n"
} |
| 5/2 | 2026/07/30 11:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8154 output: 43 thoughts: 48 Thoughts: Okay, here's my take on those thoughts, framed as my own: **Analyzing BPF Trampoline Preparation** Alright, let's see, the key non-static functions related to the BPF trampoline seem to be `arch_prepare_bpf_trampoline` and `arch_bpf_trampoline_size`. I need to understand how these pieces fit together. They are the entry points for architecture-specific trampoline setup, so I'll need to double check how they interface with the generic core. Now, let me pivot over to inspecting `bpf_struct_ops_desc_init`, as that's probably where the data structures that inform the trampoline generation are initialized. It's likely that function holds critical information about what's actually being injected. I want to understand how the architecture-specific requirements are handled. |
| 6/2 | 2026/07/30 11:26 | tool | grepper |
0mArgs:{
"Expression": "bpf_struct_ops_desc_init",
"PathPrefix": "kernel/bpf/bpf_struct_ops.c"
}Results: {
"Output": "kernel/bpf/bpf_struct_ops.c=324=int bpf_struct_ops_supported(const struct bpf_struct_ops *st_ops, u32 moff)\n--\nkernel/bpf/bpf_struct_ops.c-330-\nkernel/bpf/bpf_struct_ops.c:331:int bpf_struct_ops_desc_init(struct bpf_struct_ops_desc *st_ops_desc,\nkernel/bpf/bpf_struct_ops.c-332-\t\t\t struct btf *btf,\n"
} |
| 7/2 | 2026/07/30 11:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8578 output: 36 thoughts: 48 Thoughts: Here's my take on the thought process, as if it were my own: **Investigating `bpf_struct_ops_desc_init` Accessibility** Okay, so I'm looking at `bpf_struct_ops_desc_init`. The first thing I note is that it's *not* declared as `static`. That immediately piques my interest. Non-static means it's potentially visible and callable from outside the current compilation unit. That suggests it might be part of an interface, or at least used more widely than a strictly local function. To understand its significance in the bigger picture, I need to trace its usage. The next logical step is to delve into the code that *uses* it. Specifically, I should examine `bpf_check_attach_target` and `bpf_check_attach_btf_id_multi`, to see how they interact with `bpf_struct_ops_desc_init`. These seem like the most likely candidates given the context. I'll check these out in detail to figure out where it's being used and in what context. This will lead to a better overall understanding of what that function is doing. |
| 8/2 | 2026/07/30 11:26 | tool | grepper |
0mArgs:{
"Expression": "bpf_check_attach_target",
"PathPrefix": "kernel/bpf/verifier.c"
}Results: {
"Output": "kernel/bpf/verifier.c=11964=static int process_kf_arg_ptr_to_rbtree_node(struct bpf_verifier_env *env,\n--\nkernel/bpf/verifier.c-11975- * LSM hooks and iters (both sleepable and non-sleepable) are safe.\nkernel/bpf/verifier.c:11976: * Any sleepable progs are also safe since bpf_check_attach_target() enforce\nkernel/bpf/verifier.c-11977- * them can only be attached to some specific hook points.\n--\nkernel/bpf/verifier.c=19030=static bool attach_uses_trampoline_retval(enum bpf_attach_type type)\n--\nkernel/bpf/verifier.c-19043-\nkernel/bpf/verifier.c:19044:int bpf_check_attach_target(struct bpf_verifier_log *log,\nkernel/bpf/verifier.c-19045-\t\t\t const struct bpf_prog *prog,\n--\nkernel/bpf/verifier.c=19457=static int check_attach_btf_id(struct bpf_verifier_env *env)\n--\nkernel/bpf/verifier.c-19487-\nkernel/bpf/verifier.c:19488:\tret = bpf_check_attach_target(\u0026env-\u003elog, prog, tgt_prog, btf_id, \u0026tgt_info);\nkernel/bpf/verifier.c-19489-\tif (ret)\n"
} |
| 9/2 | 2026/07/30 11:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 9315 output: 41 thoughts: 35 Thoughts: Here's the summary, rendered as your own thought process: **Diving into BPF Attachment Validation** Okay, so I'm looking at this `bpf_check_attach_target` function. Interesting, it's not a static function, which means it has broader visibility within the kernel modules. That's good to know for context. My focus is on ensuring these BPF attachments are valid, so I should see how this fits into the bigger picture. Now, let's pivot and take a closer look at `bpf_check_attach_btf_id_multi`. This seems like a logical next step to understand how BTF IDs are integrated into the attachment checks. This should help me figure out the finer points of validation. |
| 10/2 | 2026/07/30 11:26 | tool | grepper |
0mArgs:{
"Expression": "bpf_check_attach_btf_id_multi",
"PathPrefix": "kernel/bpf/verifier.c"
}Results: {
"Output": "kernel/bpf/verifier.c=19457=static int check_attach_btf_id(struct bpf_verifier_env *env)\n--\nkernel/bpf/verifier.c-19556-\nkernel/bpf/verifier.c:19557:int bpf_check_attach_btf_id_multi(struct btf *btf, struct bpf_prog *prog, u32 btf_id,\nkernel/bpf/verifier.c-19558-\t\t\t\t struct bpf_attach_target_info *tgt_info)\n"
} |
| 11/2 | 2026/07/30 11:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 9704 output: 32 thoughts: 206 Thoughts: **Analyzing BPF Functionality** Okay, so `bpf_check_attach_btf_id_multi` is non-static, which is interesting. That means it's likely part of a broader interface, and I need to understand its relationship to other functions. My immediate focus is on a few key symbols: `arch_prepare_bpf_trampoline`, `arch_bpf_trampoline_size`, `bpf_struct_ops_desc_init`, `bpf_check_attach_target`, and of course, `bpf_check_attach_btf_id_multi` itself. I need to see how they interact. I'm also wondering if there are any specific kernel configurations at play here. The code itself is located in `arch/x86/net/bpf_jit_comp.c`, `kernel/bpf/bpf_struct_ops.c`, and `kernel/bpf/verifier.c`. Based on those locations, and my experience, this suggests we're dealing with core BPF features. Obviously, `CONFIG_BPF_SYSCALL` and `CONFIG_BPF_JIT` would be essential, probably other configuration options, too. To make sure I'm not missing any other dependencies, I should probably check the `kernel/bpf/Makefile` to see how `bpf_struct_ops.c` is being built and linked, to see if there are any related objects I should include in my thinking. |
| 12/2 | 2026/07/30 11:26 | tool | grepper |
0mArgs:{
"Expression": "bpf_struct_ops",
"PathPrefix": "kernel/bpf/Makefile"
}Results: {
"Output": "kernel/bpf/Makefile=43=ifeq ($(CONFIG_BPF_JIT),y)\nkernel/bpf/Makefile:44:obj-$(CONFIG_BPF_SYSCALL) += bpf_struct_ops.o\nkernel/bpf/Makefile-45-obj-$(CONFIG_BPF_SYSCALL) += cpumask.o\n"
} |
| 13/2 | 2026/07/30 11:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 10362 output: 200 thoughts: 409 Thoughts: **My Assessment of the BPF Kernel Patch Configuration** Okay, so I'm looking at this patch and immediately, `CONFIG_BPF_SYSCALL` and `CONFIG_BPF_JIT` jump out as the key configuration options. Those are *essential* for enabling the BPF functionality this patch is modifying. The selftests use `bpf_testmod`, but we're fuzzing the *core* kernel here, so we can disregard those module-specific config flags. We're interested in the core kernel BPF subsystems and the changes are in `bpf_struct_ops.c`, `verifier.c`, and `bpf_jit_comp.c`. That tells me where to look for the heart of the changes. I need to confirm that `bpf_struct_ops` is compiled correctly, and yes, it seems to depend on both `CONFIG_BPF_JIT` and `CONFIG_BPF_SYSCALL` being enabled, which they will be. Now, let's review the important symbols this patch touches. The ones that are relevant are: * `arch_prepare_bpf_trampoline` * `arch_bpf_trampoline_size` * `bpf_struct_ops_desc_init` * `bpf_check_attach_target` * `bpf_check_attach_btf_id_multi` These seem right and on point. My reasoning? This patch is fundamentally addressing how the BPF verifier, JIT compiler, and `struct_ops` initialization handle functions with arguments or return values greater than 8 bytes, which is a significant change. It's fixing calculations for trampoline registers and rejecting unsupported cases for certain attach types and struct_ops. All this is about functional correctness in the core BPF subsystem, and it's all accessible through the `bpf()` syscall from userspace, which is where it is important. Time to call `set-results`. |
| 14/2 | 2026/07/30 11:26 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"BPF_SYSCALL",
"BPF_JIT"
],
"FocusSymbols": [
"arch_prepare_bpf_trampoline",
"arch_bpf_trampoline_size",
"bpf_struct_ops_desc_init",
"bpf_check_attach_target",
"bpf_check_attach_btf_id_multi"
],
"Reasoning": "The patch modifies the BPF verifier, JIT compiler, and struct_ops initialization to properly handle functions with arguments or return values larger than 8 bytes (e.g., `__int128`). It fixes how trampoline registers are calculated and rejects unsupported \u003e8 byte return values for certain attach types and struct_ops. These are functional changes in the core BPF subsystem reachable from userspace via the `bpf()` syscall.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"BPF_SYSCALL",
"BPF_JIT"
],
"FocusSymbols": [
"arch_prepare_bpf_trampoline",
"arch_bpf_trampoline_size",
"bpf_struct_ops_desc_init",
"bpf_check_attach_target",
"bpf_check_attach_btf_id_multi"
],
"Reasoning": "The patch modifies the BPF verifier, JIT compiler, and struct_ops initialization to properly handle functions with arguments or return values larger than 8 bytes (e.g., `__int128`). It fixes how trampoline registers are calculated and rejects unsupported \u003e8 byte return values for certain attach types and struct_ops. These are functional changes in the core BPF subsystem reachable from userspace via the `bpf()` syscall.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|