| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/27 17:43 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies only user-space code under tools/ (specifically tools/lib/bpf/linker.c and selftests under tools/testing/selftests/bpf/). No kernel code or modules affecting the compiled kernel image (vmlinux) are modified, so it does not warrant kernel fuzzing with syzkaller.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/27 17:43 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 3e0139b250e12eb9cd00545bef59afe0ee8ecaea\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sun Sep 27 17:43:16 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c\nindex 53f64a1a1f25a..f3f71c452f007 100644\n--- a/tools/lib/bpf/linker.c\n+++ b/tools/lib/bpf/linker.c\n@@ -2159,8 +2159,13 @@ static int linker_append_elf_sym(struct bpf_linker *linker, struct src_obj *obj,\n \tdst_sym-\u003est_name = name_off;\n \tdst_sym-\u003est_info = sym-\u003est_info;\n \tdst_sym-\u003est_other = sym-\u003est_other;\n-\tdst_sym-\u003est_shndx = dst_sec ? dst_sec-\u003esec_idx : sym-\u003est_shndx;\n-\tdst_sym-\u003est_value = (src_sec ? src_sec-\u003edst_off : 0) + sym-\u003est_value;\n+\tif (sym_is_extern) {\n+\t\tdst_sym-\u003est_shndx = SHN_UNDEF;\n+\t\tdst_sym-\u003est_value = 0;\n+\t} else {\n+\t\tdst_sym-\u003est_shndx = dst_sec ? dst_sec-\u003esec_idx : sym-\u003est_shndx;\n+\t\tdst_sym-\u003est_value = (src_sec ? src_sec-\u003edst_off : 0) + sym-\u003est_value;\n+\t}\n \tdst_sym-\u003est_size = sym-\u003est_size;\n \n \tobj-\u003esym_map[src_sym_idx] = dst_sym_idx;\n@@ -2592,6 +2597,10 @@ static int linker_append_btf(struct bpf_linker *linker, struct src_obj *obj)\n \t\t\t\t\tcontinue;\n \n \t\t\t\tdst_var = \u0026dst_sec-\u003esec_vars[glob_sym-\u003evar_idx];\n+\t\t\t\tif (!glob_sym-\u003eis_extern) {\n+\t\t\t\t\tElf64_Sym *sym = get_sym_by_idx(linker, glob_sym-\u003esym_idx);\n+\t\t\t\t\tdst_var-\u003eoffset = sym-\u003est_value;\n+\t\t\t\t}\n \t\t\t\t/* Because underlying BTF type might have\n \t\t\t\t * changed, so might its size have changed, so\n \t\t\t\t * re-calculate and update it in sec_var.\ndiff --git a/tools/testing/selftests/bpf/Makefile.skel b/tools/testing/selftests/bpf/Makefile.skel\nindex 3d92cdca62ed8..2e22bb901bf3b 100644\n--- a/tools/testing/selftests/bpf/Makefile.skel\n+++ b/tools/testing/selftests/bpf/Makefile.skel\n@@ -23,7 +23,7 @@ BPF_OBJS := $(patsubst %.c,$(RDIR)/%.bpf.o,$(BPF_SRCS))\n SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c\n \n LINKED_SKELS := test_static_linked.skel.h linked_funcs.skel.h\t\t\\\n-\t\tlinked_vars.skel.h linked_maps.skel.h \t\t\t\\\n+\t\tlinked_vars.skel.h linked_maps.skel.h linked_arena.skel.h \\\n \t\ttest_subskeleton.skel.h test_subskeleton_lib.skel.h\t\\\n \t\ttest_usdt.skel.h tracing_multi.skel.h\t\t\t\\\n \t\ttracing_multi_module.skel.h\t\t\t\t\\\n@@ -46,6 +46,7 @@ test_static_linked.skel.h-deps := test_static_linked1.bpf.o test_static_linked2.\n linked_funcs.skel.h-deps := linked_funcs1.bpf.o linked_funcs2.bpf.o\n linked_vars.skel.h-deps := linked_vars1.bpf.o linked_vars2.bpf.o\n linked_maps.skel.h-deps := linked_maps1.bpf.o linked_maps2.bpf.o\n+linked_arena.skel.h-deps := linked_arena1.bpf.o linked_arena2.bpf.o\n # In the subskeleton case, we want the test_subskeleton_lib.subskel.h file\n # but that's created as a side-effect of the skel.h generation.\n test_subskeleton.skel.h-deps := test_subskeleton_lib2.bpf.o test_subskeleton_lib.bpf.o test_subskeleton.bpf.o\ndiff --git a/tools/testing/selftests/bpf/prog_tests/linked_externs.c b/tools/testing/selftests/bpf/prog_tests/linked_externs.c\nnew file mode 100644\nindex 0000000000000..29358c82dc356\n--- /dev/null\n+++ b/tools/testing/selftests/bpf/prog_tests/linked_externs.c\n@@ -0,0 +1,109 @@\n+// SPDX-License-Identifier: GPL-2.0\n+/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */\n+#include \u003ctest_progs.h\u003e\n+#include \u003cbpf/btf.h\u003e\n+#include \"linked_arena.skel.h\"\n+\n+static void test_skel(void)\n+{\n+\tLIBBPF_OPTS(bpf_test_run_opts, opts);\n+\tstruct linked_arena *skel;\n+\tint err;\n+\n+\tskel = linked_arena__open_and_load();\n+\tif (!ASSERT_OK_PTR(skel, \"skel_open_and_load\"))\n+\t\treturn;\n+\n+\tASSERT_EQ(skel-\u003earena-\u003ea_val, 1, \"a_val_init\");\n+\tASSERT_EQ(skel-\u003earena-\u003eb_val, 2, \"b_val_init\");\n+\n+\terr = bpf_prog_test_run_opts(bpf_program__fd(skel-\u003eprogs.sum1), \u0026opts);\n+\tASSERT_OK(err, \"sum1_run\");\n+\tASSERT_EQ(opts.retval, 1 + 2, \"sum1_retval\");\n+\n+\terr = bpf_prog_test_run_opts(bpf_program__fd(skel-\u003eprogs.bump2), \u0026opts);\n+\tASSERT_OK(err, \"bump2_run\");\n+\tASSERT_EQ(opts.retval, 11 + 22, \"bump2_retval\");\n+\n+\tASSERT_EQ(skel-\u003earena-\u003ea_val, 11, \"a_val\");\n+\tASSERT_EQ(skel-\u003earena-\u003eb_val, 22, \"b_val\");\n+\n+\tlinked_arena__destroy(skel);\n+}\n+\n+static int link_objs(const char *out, const char *in1, const char *in2)\n+{\n+\tstruct bpf_linker *linker;\n+\tint err;\n+\n+\tlinker = bpf_linker__new(out, NULL);\n+\tif (!ASSERT_OK_PTR(linker, \"linker_new\"))\n+\t\treturn -EINVAL;\n+\n+\terr = bpf_linker__add_file(linker, in1, NULL);\n+\tif (!ASSERT_OK(err, in1))\n+\t\tgoto cleanup;\n+\tif (in2) {\n+\t\terr = bpf_linker__add_file(linker, in2, NULL);\n+\t\tif (!ASSERT_OK(err, in2))\n+\t\t\tgoto cleanup;\n+\t}\n+\terr = bpf_linker__finalize(linker);\n+\tASSERT_OK(err, \"finalize\");\n+\n+cleanup:\n+\tbpf_linker__free(linker);\n+\treturn err;\n+}\n+\n+/* link in1 on its own first, then link the result with in2 */\n+static void test_relink(const char *in1, const char *in2, const char *sec_name)\n+{\n+\tchar out1[] = \"/tmp/linked_externs.XXXXXX\", out2[] = \"/tmp/linked_externs.XXXXXX\";\n+\tconst struct btf_var_secinfo *vi;\n+\tstruct bpf_object *obj = NULL;\n+\tconst struct btf_type *t;\n+\tstruct btf *btf;\n+\tint i, id, n;\n+\n+\tclose(mkstemp(out1));\n+\tclose(mkstemp(out2));\n+\n+\tif (!ASSERT_OK(link_objs(out1, in1, NULL), \"link_stage1\") ||\n+\t !ASSERT_OK(link_objs(out2, out1, in2), \"link_stage2\"))\n+\t\tgoto cleanup;\n+\n+\tobj = bpf_object__open_file(out2, NULL);\n+\tif (!ASSERT_OK_PTR(obj, \"obj_open\"))\n+\t\tgoto cleanup;\n+\n+\tbtf = bpf_object__btf(obj);\n+\tid = btf__find_by_name_kind(btf, sec_name, BTF_KIND_DATASEC);\n+\tif (!ASSERT_GT(id, 0, \"find_datasec\"))\n+\t\tgoto cleanup;\n+\n+\tt = btf__type_by_id(btf, id);\n+\tvi = btf_var_secinfos(t);\n+\tn = btf_vlen(t);\n+\tfor (i = 0; i \u003c n; i++) {\n+\t\tt = btf__type_by_id(btf, vi[i].type);\n+\t\tASSERT_NEQ(btf_var(t)-\u003elinkage, BTF_VAR_GLOBAL_EXTERN, \"var_resolved\");\n+\t}\n+\n+\tASSERT_OK(bpf_object__load(obj), \"obj_load\");\n+\n+cleanup:\n+\tbpf_object__close(obj);\n+\tunlink(out1);\n+\tunlink(out2);\n+}\n+\n+void test_linked_externs(void)\n+{\n+\tif (test__start_subtest(\"skel_arena\"))\n+\t\ttest_skel();\n+\tif (test__start_subtest(\"relink_arena\"))\n+\t\ttest_relink(\"linked_arena1.bpf.o\", \"linked_arena2.bpf.o\", \".addr_space.1\");\n+\tif (test__start_subtest(\"relink_maps\"))\n+\t\ttest_relink(\"linked_maps1.bpf.o\", \"linked_maps2.bpf.o\", \".maps\");\n+}\ndiff --git a/tools/testing/selftests/bpf/progs/linked_arena1.c b/tools/testing/selftests/bpf/progs/linked_arena1.c\nnew file mode 100644\nindex 0000000000000..3e8788dec1d96\n--- /dev/null\n+++ b/tools/testing/selftests/bpf/progs/linked_arena1.c\n@@ -0,0 +1,22 @@\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_helpers.h\u003e\n+#include \"bpf_arena_common.h\"\n+\n+struct {\n+\t__uint(type, BPF_MAP_TYPE_ARENA);\n+\t__uint(map_flags, BPF_F_MMAPABLE);\n+\t__uint(max_entries, 1); /* number of pages */\n+} arena SEC(\".maps\");\n+\n+long __arena a_val = 1;\n+extern long __arena b_val; /* defined in linked_arena2.c */\n+\n+SEC(\"syscall\")\n+int sum1(void *ctx)\n+{\n+\treturn a_val + b_val;\n+}\n+\n+char _license[] SEC(\"license\") = \"GPL\";\ndiff --git a/tools/testing/selftests/bpf/progs/linked_arena2.c b/tools/testing/selftests/bpf/progs/linked_arena2.c\nnew file mode 100644\nindex 0000000000000..d0bcdf18a4b69\n--- /dev/null\n+++ b/tools/testing/selftests/bpf/progs/linked_arena2.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_helpers.h\u003e\n+#include \"bpf_arena_common.h\"\n+\n+long __arena b_val = 2;\n+extern long __arena a_val; /* defined in linked_arena1.c */\n+\n+SEC(\"syscall\")\n+int bump2(void *ctx)\n+{\n+\ta_val += 10;\n+\tb_val += 20;\n+\treturn a_val + b_val;\n+}\n+\n+char _license[] SEC(\"license\") = \"GPL\";\n"
} |
| 2/1 | 2026/09/27 17:43 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies only user-space code under tools/ (specifically tools/lib/bpf/linker.c and selftests under tools/testing/selftests/bpf/). No kernel code or modules affecting the compiled kernel image (vmlinux) are modified, so it does not warrant kernel fuzzing with syzkaller.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any '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: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 3e0139b250e12eb9cd00545bef59afe0ee8ecaea
Author: syz-cluster <triage@syzkaller.com>
Date: Sun Sep 27 17:43:16 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c
index 53f64a1a1f25a..f3f71c452f007 100644
--- a/tools/lib/bpf/linker.c
+++ b/tools/lib/bpf/linker.c
@@ -2159,8 +2159,13 @@ static int linker_append_elf_sym(struct bpf_linker *linker, struct src_obj *obj,
dst_sym->st_name = name_off;
dst_sym->st_info = sym->st_info;
dst_sym->st_other = sym->st_other;
- dst_sym->st_shndx = dst_sec ? dst_sec->sec_idx : sym->st_shndx;
- dst_sym->st_value = (src_sec ? src_sec->dst_off : 0) + sym->st_value;
+ if (sym_is_extern) {
+ dst_sym->st_shndx = SHN_UNDEF;
+ dst_sym->st_value = 0;
+ } else {
+ dst_sym->st_shndx = dst_sec ? dst_sec->sec_idx : sym->st_shndx;
+ dst_sym->st_value = (src_sec ? src_sec->dst_off : 0) + sym->st_value;
+ }
dst_sym->st_size = sym->st_size;
obj->sym_map[src_sym_idx] = dst_sym_idx;
@@ -2592,6 +2597,10 @@ static int linker_append_btf(struct bpf_linker *linker, struct src_obj *obj)
continue;
dst_var = &dst_sec->sec_vars[glob_sym->var_idx];
+ if (!glob_sym->is_extern) {
+ Elf64_Sym *sym = get_sym_by_idx(linker, glob_sym->sym_idx);
+ dst_var->offset = sym->st_value;
+ }
/* Because underlying BTF type might have
* changed, so might its size have changed, so
* re-calculate and update it in sec_var.
diff --git a/tools/testing/selftests/bpf/Makefile.skel b/tools/testing/selftests/bpf/Makefile.skel
index 3d92cdca62ed8..2e22bb901bf3b 100644
--- a/tools/testing/selftests/bpf/Makefile.skel
+++ b/tools/testing/selftests/bpf/Makefile.skel
@@ -23,7 +23,7 @@ BPF_OBJS := $(patsubst %.c,$(RDIR)/%.bpf.o,$(BPF_SRCS))
SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c
LINKED_SKELS := test_static_linked.skel.h linked_funcs.skel.h \
- linked_vars.skel.h linked_maps.skel.h \
+ linked_vars.skel.h linked_maps.skel.h linked_arena.skel.h \
test_subskeleton.skel.h test_subskeleton_lib.skel.h \
test_usdt.skel.h tracing_multi.skel.h \
tracing_multi_module.skel.h \
@@ -46,6 +46,7 @@ test_static_linked.skel.h-deps := test_static_linked1.bpf.o test_static_linked2.
linked_funcs.skel.h-deps := linked_funcs1.bpf.o linked_funcs2.bpf.o
linked_vars.skel.h-deps := linked_vars1.bpf.o linked_vars2.bpf.o
linked_maps.skel.h-deps := linked_maps1.bpf.o linked_maps2.bpf.o
+linked_arena.skel.h-deps := linked_arena1.bpf.o linked_arena2.bpf.o
# In the subskeleton case, we want the test_subskeleton_lib.subskel.h file
# but that's created as a side-effect of the skel.h generation.
test_subskeleton.skel.h-deps := test_subskeleton_lib2.bpf.o test_subskeleton_lib.bpf.o test_subskeleton.bpf.o
diff --git a/tools/testing/selftests/bpf/prog_tests/linked_externs.c b/tools/testing/selftests/bpf/prog_tests/linked_externs.c
new file mode 100644
index 0000000000000..29358c82dc356
--- /dev/null
+++ b/tools/testing/selftests/bpf/prog_tests/linked_externs.c
@@ -0,0 +1,109 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
+#include <test_progs.h>
+#include <bpf/btf.h>
+#include "linked_arena.skel.h"
+
+static void test_skel(void)
+{
+ LIBBPF_OPTS(bpf_test_run_opts, opts);
+ struct linked_arena *skel;
+ int err;
+
+ skel = linked_arena__open_and_load();
+ if (!ASSERT_OK_PTR(skel, "skel_open_and_load"))
+ return;
+
+ ASSERT_EQ(skel->arena->a_val, 1, "a_val_init");
+ ASSERT_EQ(skel->arena->b_val, 2, "b_val_init");
+
+ err = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.sum1), &opts);
+ ASSERT_OK(err, "sum1_run");
+ ASSERT_EQ(opts.retval, 1 + 2, "sum1_retval");
+
+ err = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.bump2), &opts);
+ ASSERT_OK(err, "bump2_run");
+ ASSERT_EQ(opts.retval, 11 + 22, "bump2_retval");
+
+ ASSERT_EQ(skel->arena->a_val, 11, "a_val");
+ ASSERT_EQ(skel->arena->b_val, 22, "b_val");
+
+ linked_arena__destroy(skel);
+}
+
+static int link_objs(const char *out, const char *in1, const char *in2)
+{
+ struct bpf_linker *linker;
+ int err;
+
+ linker = bpf_linker__new(out, NULL);
+ if (!ASSERT_OK_PTR(linker, "linker_new"))
+ return -EINVAL;
+
+ err = bpf_linker__add_file(linker, in1, NULL);
+ if (!ASSERT_OK(err, in1))
+ goto cleanup;
+ if (in2) {
+ err = bpf_linker__add_file(linker, in2, NULL);
+ if (!ASSERT_OK(err, in2))
+ goto cleanup;
+ }
+ err = bpf_linker__finalize(linker);
+ ASSERT_OK(err, "finalize");
+
+cleanup:
+ bpf_linker__free(linker);
+ return err;
+}
+
+/* link in1 on its own first, then link the result with in2 */
+static void test_relink(const char *in1, const char *in2, const char *sec_name)
+{
+ char out1[] = "/tmp/linked_externs.XXXXXX", out2[] = "/tmp/linked_externs.XXXXXX";
+ const struct btf_var_secinfo *vi;
+ struct bpf_object *obj = NULL;
+ const struct btf_type *t;
+ struct btf *btf;
+ int i, id, n;
+
+ close(mkstemp(out1));
+ close(mkstemp(out2));
+
+ if (!ASSERT_OK(link_objs(out1, in1, NULL), "link_stage1") ||
+ !ASSERT_OK(link_objs(out2, out1, in2), "link_stage2"))
+ goto cleanup;
+
+ obj = bpf_object__open_file(out2, NULL);
+ if (!ASSERT_OK_PTR(obj, "obj_open"))
+ goto cleanup;
+
+ btf = bpf_object__btf(obj);
+ id = btf__find_by_name_kind(btf, sec_name, BTF_KIND_DATASEC);
+ if (!ASSERT_GT(id, 0, "find_datasec"))
+ goto cleanup;
+
+ t = btf__type_by_id(btf, id);
+ vi = btf_var_secinfos(t);
+ n = btf_vlen(t);
+ for (i = 0; i < n; i++) {
+ t = btf__type_by_id(btf, vi[i].type);
+ ASSERT_NEQ(btf_var(t)->linkage, BTF_VAR_GLOBAL_EXTERN, "var_resolved");
+ }
+
+ ASSERT_OK(bpf_object__load(obj), "obj_load");
+
+cleanup:
+ bpf_object__close(obj);
+ unlink(out1);
+ unlink(out2);
+}
+
+void test_linked_externs(void)
+{
+ if (test__start_subtest("skel_arena"))
+ test_skel();
+ if (test__start_subtest("relink_arena"))
+ test_relink("linked_arena1.bpf.o", "linked_arena2.bpf.o", ".addr_space.1");
+ if (test__start_subtest("relink_maps"))
+ test_relink("linked_maps1.bpf.o", "linked_maps2.bpf.o", ".maps");
+}
diff --git a/tools/testing/selftests/bpf/progs/linked_arena1.c b/tools/testing/selftests/bpf/progs/linked_arena1.c
new file mode 100644
index 0000000000000..3e8788dec1d96
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/linked_arena1.c
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
+#include <vmlinux.h>
+#include <bpf/bpf_helpers.h>
+#include "bpf_arena_common.h"
+
+struct {
+ __uint(type, BPF_MAP_TYPE_ARENA);
+ __uint(map_flags, BPF_F_MMAPABLE);
+ __uint(max_entries, 1); /* number of pages */
+} arena SEC(".maps");
+
+long __arena a_val = 1;
+extern long __arena b_val; /* defined in linked_arena2.c */
+
+SEC("syscall")
+int sum1(void *ctx)
+{
+ return a_val + b_val;
+}
+
+char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/progs/linked_arena2.c b/tools/testing/selftests/bpf/progs/linked_arena2.c
new file mode 100644
index 0000000000000..d0bcdf18a4b69
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/linked_arena2.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_helpers.h>
+#include "bpf_arena_common.h"
+
+long __arena b_val = 2;
+extern long __arena a_val; /* defined in linked_arena1.c */
+
+SEC("syscall")
+int bump2(void *ctx)
+{
+ a_val += 10;
+ b_val += 20;
+ return a_val + b_val;
+}
+
+char _license[] SEC("license") = "GPL";
|
| 3/2 | 2026/09/27 17:43 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 5982 output: 17 thoughts: 515 Thoughts: **WorthFuzzing=false: A Quick Triage** Okay, let's break this down. My initial scan shows this patch touches a few files: `tools/lib/bpf/linker.c`, `tools/testing/selftests/bpf/Makefile.skel`, `tools/testing/selftests/bpf/prog_tests/linked_externs.c`, `tools/testing/selftests/bpf/progs/linked_arena1.c`, and `tools/testing/selftests/bpf/progs/linked_arena2.c`. All within the `tools/` directory – a good sign for a quick triage. Specifically, we're looking at `libbpf` (user-space) and the self-tests. Now, let's apply the negative criteria for WorthFuzzing=false. The triage guidelines are pretty clear: does this modify code that affects the compiled kernel image (`vmlinux`) or kernel modules? No. `libbpf` is user-space, and the self-tests are *definitely* user-space. Therefore, under the "Non-kernel and non-executable changes" category, this clearly falls into "User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/) that do not affect the compiled kernel image (vmlinux) or kernel modules." So, based on that, WorthFuzzing is definitively false. Just to be absolutely sure, I'll quickly double-check with a `git diff` or `git show` to ensure no stray modifications made it outside the `tools/` directory. Gotta be thorough. |
| 4/2 | 2026/09/27 17:43 | tool | grepper |
0mArgs:{
"Expression": "diff --git"
}Results: {
"Output": "Documentation/bpf/drgn.rst=99=For example, to print ``struct bpf_prog_aux`` for BPF program id 53077:\n--\nDocumentation/bpf/drgn.rst-103- % git diff\nDocumentation/bpf/drgn.rst:104: diff --git a/tools/bpf_inspect.py b/tools/bpf_inspect.py\nDocumentation/bpf/drgn.rst-105- index 650e228..aea2357 100755\n--\nDocumentation/dev-tools/checkuapi.rst=54=won't break userspace::\n--\nDocumentation/dev-tools/checkuapi.rst-69- * comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction\nDocumentation/dev-tools/checkuapi.rst:70: diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h\nDocumentation/dev-tools/checkuapi.rst-71- EOF\n--\nDocumentation/dev-tools/checkuapi.rst=310=Consider this change::\n--\nDocumentation/dev-tools/checkuapi.rst-312- cat \u003c\u003c 'EOF' | patch -l -p1\nDocumentation/dev-tools/checkuapi.rst:313: diff --git a/include/uapi/asm-generic/Kbuild b/include/uapi/asm-generic/Kbuild\nDocumentation/dev-tools/checkuapi.rst-314- index ebb180aac74e..a9c88b0a8b3b 100644\n--\nDocumentation/doc-guide/contributing.rst=84=looked like this::\n--\nDocumentation/doc-guide/contributing.rst-102-\nDocumentation/doc-guide/contributing.rst:103: diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c\nDocumentation/doc-guide/contributing.rst-104- index 57f6944d65a6..00c9b80b3d33 100644\n--\nDocumentation/mm/transhuge.rst=73=change::\nDocumentation/mm/transhuge.rst-74-\nDocumentation/mm/transhuge.rst:75:\tdiff --git a/mm/mremap.c b/mm/mremap.c\nDocumentation/mm/transhuge.rst-76-\t--- a/mm/mremap.c\n--\nDocumentation/translations/it_IT/doc-guide/contributing.rst=91=patch risultante era questa::\n--\nDocumentation/translations/it_IT/doc-guide/contributing.rst-109-\nDocumentation/translations/it_IT/doc-guide/contributing.rst:110: diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c\nDocumentation/translations/it_IT/doc-guide/contributing.rst-111- index 57f6944d65a6..00c9b80b3d33 100644\n--\nDocumentation/translations/zh_CN/doc-guide/contributing.rst=36=C代码编译器发出的警告常常会被视为误报,从而导致出现了旨在让编译器闭嘴的补丁。\n--\nDocumentation/translations/zh_CN/doc-guide/contributing.rst-86-\nDocumentation/translations/zh_CN/doc-guide/contributing.rst:87: diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c\nDocumentation/translations/zh_CN/doc-guide/contributing.rst-88- index 57f6944d65a6..00c9b80b3d33 100644\n--\nscripts/checkpatch.pl=2671=sub process {\n--\nscripts/checkpatch.pl-2844-\t\t ($line =~ /^rename (?:from|to) \\S+\\s*$/ ||\nscripts/checkpatch.pl:2845:\t\t $line =~ /^diff --git a\\/[\\w\\/\\.\\_\\-]+ b\\/\\S+\\s*$/))) {\nscripts/checkpatch.pl-2846-\t\t\t$is_patch = 1;\n--\nscripts/checkpatch.pl-2902-\t\t# extract the filename as it passes\nscripts/checkpatch.pl:2903:\t\tif ($line =~ /^diff --git.*?(\\S+)$/) {\nscripts/checkpatch.pl-2904-\t\t\t$realfile = $1;\n--\nscripts/get_maintainer.pl=552=foreach my $file (@ARGV) {\n--\nscripts/get_maintainer.pl-601-\t\tpush(@files, $filename);\nscripts/get_maintainer.pl:602:\t } elsif (m/^diff --git a\\/(\\S+) b\\/(\\S+)\\s*$/) {\nscripts/get_maintainer.pl-603-\t\tmy $filename1 = $1;\n"
} |
| 5/2 | 2026/09/27 17:43 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 8165 output: 101 thoughts: 359 Thoughts: **Analyzing the Proposed Changes and Determining Fuzzing Applicability** Okay, let's break this down. First, I see a diff presented. A quick glance tells me this involves changes to files in the `tools` directory, specifically `tools/lib/bpf/linker.c`, and some BPF selftests within `tools/testing/selftests/bpf/`. My experience immediately flags this as likely user-space modifications related to BPF tooling and testing, not core kernel code. Now I have the `set-results` instructions to guide me. The `WorthFuzzing` flag is set to `false`. The reasoning given nails it; these changes *solely* concern user-space components, specifically the BPF linker and the self-tests. No kernel image or modules are affected, so syzkaller fuzzing is simply not applicable here. There's no value in trying. The absence of any `FocusSymbols` and `EnableConfigs` further reinforces this conclusion. If these were kernel-level changes, we'd expect some symbols or configs to be relevant, but they're empty. Therefore, given the nature of the diff and the provided instructions, I'm confident in setting `WorthFuzzing` to `false`. I can call `set-results` without further investigation. |
| 6/2 | 2026/09/27 17:43 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch modifies only user-space code under tools/ (specifically tools/lib/bpf/linker.c and selftests under tools/testing/selftests/bpf/). No kernel code or modules affecting the compiled kernel image (vmlinux) are modified, so it does not warrant kernel fuzzing with syzkaller.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies only user-space code under tools/ (specifically tools/lib/bpf/linker.c and selftests under tools/testing/selftests/bpf/). No kernel code or modules affecting the compiled kernel image (vmlinux) are modified, so it does not warrant kernel fuzzing with syzkaller.",
"WorthFuzzing": false
} |
| 7/1 | 2026/09/27 17:43 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|