| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/10/30 02:50 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch only modifies files under tools/bpf/bpftool/, which is a user-space tool and does not affect the compiled kernel image (vmlinux) or kernel modules. Therefore, these changes are not relevant for kernel fuzzing.",
"WorthFuzzing": false
} |
| 1/1 | 2026/10/30 02:50 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit b23994ae8f63a76b9aed6f7179076bd4c1d3b8a8\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Fri Oct 30 02:50:08 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile\nindex b0f7168e794329..dc8e4be8629603 100644\n--- a/tools/bpf/bpftool/Makefile\n+++ b/tools/bpf/bpftool/Makefile\n@@ -63,6 +63,7 @@ $(LIBBPF_BOOTSTRAP)-clean: FORCE | $(LIBBPF_BOOTSTRAP_OUTPUT)\n \t$(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_BOOTSTRAP_OUTPUT) clean \u003e/dev/null\n \n prefix ?= /usr/local\n+libdir ?= $(prefix)/lib\n bash_compdir ?= /usr/share/bash-completion/completions\n \n CFLAGS += -O2\n@@ -170,7 +171,7 @@ include $(wildcard $(OUTPUT)*.d)\n \n all: $(OUTPUT)bpftool\n \n-SRCS := $(wildcard *.c)\n+SRCS := $(filter-out llvm_disasm.c,$(wildcard *.c))\n \n ifeq ($(feature-llvm),1)\n ifneq ($(SKIP_LLVM),1)\n@@ -186,10 +187,19 @@ ifeq ($(HAS_LLVM),1)\n # Makefile includes lib.mk which sets -D_GNU_SOURCE) which would cause\n # compilation error due to redefinition. Let's filter it out here.\n CFLAGS += $(filter-out -D_GNU_SOURCE,$(shell $(LLVM_CONFIG) --cflags))\n- LIBS += $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS))\n+ LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS))\n ifeq ($(shell $(LLVM_CONFIG) --shared-mode),static)\n+ # No libLLVM.so dependency to avoid, link the disassembler into bpftool\n+ SRCS += llvm_disasm.c\n+ LIBS += $(LLVM_LIBS)\n LIBS += $(shell $(LLVM_CONFIG) --system-libs $(LLVM_CONFIG_LIB_COMPONENTS))\n LIBS += -lstdc++\n+ else\n+ # Build the disassembler as a plugin, the only object linked against\n+ # libLLVM, that bpftool loads only to disassemble JITed programs\n+ LLVM_PLUGIN := $(OUTPUT)bpftool-llvm.so\n+ CFLAGS += -DLLVM_PLUGIN_DIR='\"$(libdir)/bpftool\"'\n+ LIBS += -ldl\n endif\n LDFLAGS += $(shell $(LLVM_CONFIG) --ldflags)\n else\n@@ -290,6 +300,21 @@ $(BPFTOOL_BOOTSTRAP): $(BOOTSTRAP_OBJS) $(LIBBPF_BOOTSTRAP)\n $(OUTPUT)bpftool: $(OBJS) $(LIBBPF)\n \t$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@\n \n+ifneq ($(LLVM_PLUGIN),)\n+all: $(LLVM_PLUGIN)\n+\n+$(LLVM_PLUGIN): CFLAGS += -fPIC\n+$(LLVM_PLUGIN): $(OUTPUT)llvm_disasm.o\n+\t$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -shared $\u003c $(LLVM_LIBS) -o $@\n+\n+# The plugin directory, $(libdir)/bpftool, is compiled into jit_disasm.o.\n+# Recompile it if libdir changes, e.g. on \"make\" then \"make install libdir=...\".\n+$(OUTPUT)llvm-plugin-dir: FORCE\n+\t$(Q)echo '$(libdir)/bpftool' | cmp -s - $@ || echo '$(libdir)/bpftool' \u003e $@\n+\n+$(OUTPUT)jit_disasm.o: $(OUTPUT)llvm-plugin-dir\n+endif\n+\n $(BOOTSTRAP_OUTPUT)%.o: %.c $(LIBBPF_BOOTSTRAP_INTERNAL_HDRS) | $(BOOTSTRAP_OUTPUT)\n \t$(QUIET_CC)$(HOSTCC) $(HOST_CFLAGS) -c -MMD $\u003c -o $@\n \n@@ -303,16 +328,21 @@ feature-detect-clean:\n clean: $(LIBBPF)-clean $(LIBBPF_BOOTSTRAP)-clean feature-detect-clean\n \t$(call QUIET_CLEAN, bpftool)\n \t$(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d\n+\t$(Q)$(RM) -- $(OUTPUT)bpftool-llvm.so $(OUTPUT)llvm-plugin-dir\n \t$(Q)$(RM) -- $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h\n \t$(Q)$(RM) -r -- $(LIBBPF_OUTPUT) $(BOOTSTRAP_OUTPUT)\n \t$(call QUIET_CLEAN, core-gen)\n \t$(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.bpftool\n \t$(Q)$(RM) -r -- $(OUTPUT)feature/\n \n-install-bin: $(OUTPUT)bpftool\n+install-bin: $(OUTPUT)bpftool $(LLVM_PLUGIN)\n \t$(call QUIET_INSTALL, bpftool)\n \t$(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(prefix)/sbin\n \t$(Q)$(INSTALL) $(OUTPUT)bpftool $(DESTDIR)$(prefix)/sbin/bpftool\n+ifneq ($(LLVM_PLUGIN),)\n+\t$(call QUIET_INSTALL, bpftool-llvm.so)\n+\t$(Q)$(INSTALL) -m 0755 -D -t $(DESTDIR)$(libdir)/bpftool $(LLVM_PLUGIN)\n+endif\n \n install: install-bin\n \t$(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(bash_compdir)\n@@ -321,6 +351,8 @@ install: install-bin\n uninstall:\n \t$(call QUIET_UNINST, bpftool)\n \t$(Q)$(RM) -- $(DESTDIR)$(prefix)/sbin/bpftool\n+\t$(call QUIET_UNINST, bpftool-llvm.so)\n+\t$(Q)$(RM) -r -- $(DESTDIR)$(libdir)/bpftool\n \t$(Q)$(RM) -- $(DESTDIR)$(bash_compdir)/bpftool\n \n doc:\ndiff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c\nindex 04541155e9ccc4..2691252a115b96 100644\n--- a/tools/bpf/bpftool/jit_disasm.c\n+++ b/tools/bpf/bpftool/jit_disasm.c\n@@ -25,10 +25,10 @@\n #include \u003cbpf/libbpf.h\u003e\n \n #ifdef HAVE_LLVM_SUPPORT\n-#include \u003cllvm-c/Core.h\u003e\n-#include \u003cllvm-c/Disassembler.h\u003e\n-#include \u003cllvm-c/Target.h\u003e\n-#include \u003cllvm-c/TargetMachine.h\u003e\n+#ifdef LLVM_PLUGIN_DIR\n+#include \u003cdlfcn.h\u003e\n+#endif\n+#include \"llvm_disasm.h\"\n #endif\n \n #ifdef HAVE_LIBBFD_SUPPORT\n@@ -45,7 +45,105 @@ static int oper_count;\n #ifdef HAVE_LLVM_SUPPORT\n #define DISASM_SPACER\n \n-typedef LLVMDisasmContextRef disasm_ctx_t;\n+typedef void *disasm_ctx_t;\n+\n+static const struct bpftool_llvm_ops *llvm_ops;\n+\n+#ifdef LLVM_PLUGIN_DIR\n+#define LLVM_PLUGIN_NAME \"bpftool-llvm.so\"\n+\n+static const char *dl_error(void)\n+{\n+\tconst char *err = dlerror();\n+\n+\t/* The error may already be consumed, e.g. by an LD_PRELOAD-ed library */\n+\treturn err ? err : \"unknown error\";\n+}\n+\n+/*\n+ * Look for the plugin in its install directory, then next to the bpftool\n+ * binary so that bpftool also works from its build directory. Do not look\n+ * in the current directory: bpftool usually runs as root, and would then\n+ * load any library planted in the directory it is run from.\n+ */\n+static int llvm_plugin_find(char *path, size_t size)\n+{\n+\tchar exe[PATH_MAX];\n+\tssize_t len;\n+\tchar *dir;\n+\tint n;\n+\n+\tsnprintf(path, size, \"%s/%s\", LLVM_PLUGIN_DIR, LLVM_PLUGIN_NAME);\n+\tif (!access(path, F_OK))\n+\t\treturn 0;\n+\n+\tlen = readlink(\"/proc/self/exe\", exe, sizeof(exe) - 1);\n+\tif (len \u003c 0)\n+\t\treturn -1;\n+\texe[len] = '\\0';\n+\tdir = strrchr(exe, '/');\n+\tif (!dir)\n+\t\treturn -1;\n+\t*dir = '\\0';\n+\n+\tn = snprintf(path, size, \"%s/%s\", exe, LLVM_PLUGIN_NAME);\n+\tif (n \u003c 0 || (size_t)n \u003e= size)\n+\t\treturn -1;\n+\treturn access(path, F_OK);\n+}\n+\n+static int llvm_load(bool verbose)\n+{\n+\tconst struct bpftool_llvm_ops *ops;\n+\tchar path[PATH_MAX];\n+\tvoid *handle;\n+\n+\tif (llvm_ops)\n+\t\treturn 0;\n+\n+\tif (llvm_plugin_find(path, sizeof(path))) {\n+\t\tif (verbose)\n+\t\t\tp_err(\"%s not found in %s or next to bpftool, it is required to disassemble JITed programs\",\n+\t\t\t LLVM_PLUGIN_NAME, LLVM_PLUGIN_DIR);\n+\t\treturn -1;\n+\t}\n+\n+\thandle = dlopen(path, RTLD_NOW | RTLD_LOCAL);\n+\tif (!handle) {\n+\t\tif (verbose)\n+\t\t\tp_err(\"failed to load LLVM disassembler plugin: %s\",\n+\t\t\t dl_error());\n+\t\treturn -1;\n+\t}\n+\n+\tops = dlsym(handle, BPFTOOL_LLVM_OPS_SYM);\n+\tif (!ops) {\n+\t\tif (verbose)\n+\t\t\tp_err(\"invalid LLVM disassembler plugin: %s\", dl_error());\n+\t\tgoto err_close;\n+\t}\n+\tif (ops-\u003eabi_version != BPFTOOL_LLVM_ABI_VERSION) {\n+\t\tif (verbose)\n+\t\t\tp_err(\"%s has ABI version %u, expected %u\",\n+\t\t\t path, ops-\u003eabi_version, BPFTOOL_LLVM_ABI_VERSION);\n+\t\tgoto err_close;\n+\t}\n+\n+\t/* Keep the plugin loaded until bpftool exits */\n+\tllvm_ops = ops;\n+\treturn 0;\n+\n+err_close:\n+\tdlclose(handle);\n+\treturn -1;\n+}\n+#else\n+static int llvm_load(__maybe_unused bool verbose)\n+{\n+\tllvm_ops = \u0026bpftool_llvm_ops;\n+\treturn 0;\n+}\n+#endif /* LLVM_PLUGIN_DIR */\n \n static int printf_json(char *s)\n {\n@@ -63,48 +161,13 @@ static int printf_json(char *s)\n \treturn 0;\n }\n \n-/* This callback to set the ref_type is necessary to have the LLVM disassembler\n- * print PC-relative addresses instead of byte offsets for branch instruction\n- * targets.\n- */\n-static const char *\n-symbol_lookup_callback(__maybe_unused void *disasm_info,\n-\t\t __maybe_unused uint64_t ref_value,\n-\t\t uint64_t *ref_type, __maybe_unused uint64_t ref_PC,\n-\t\t __maybe_unused const char **ref_name)\n-{\n-\t*ref_type = LLVMDisassembler_ReferenceType_InOut_None;\n-\treturn NULL;\n-}\n-\n static int\n init_context(disasm_ctx_t *ctx, const char *arch,\n \t __maybe_unused const char *disassembler_options,\n \t __maybe_unused unsigned char *image, __maybe_unused ssize_t len,\n \t __maybe_unused __u64 func_ksym)\n {\n-\tchar *triple;\n-\n-\tif (arch)\n-\t\ttriple = LLVMNormalizeTargetTriple(arch);\n-\telse\n-\t\ttriple = LLVMGetDefaultTargetTriple();\n-\tif (!triple) {\n-\t\tp_err(\"Failed to retrieve triple\");\n-\t\treturn -1;\n-\t}\n-\n-\t/*\n-\t * Enable all aarch64 ISA extensions so the disassembler can handle any\n-\t * instruction the kernel JIT might emit (e.g. ARM64 LSE atomics).\n-\t */\n-\tif (!strncmp(triple, \"aarch64\", 7))\n-\t\t*ctx = LLVMCreateDisasmCPUFeatures(triple, \"\", \"+all\", NULL, 0, NULL,\n-\t\t\t\t\t\t symbol_lookup_callback);\n-\telse\n-\t\t*ctx = LLVMCreateDisasm(triple, NULL, 0, NULL, symbol_lookup_callback);\n-\tLLVMDisposeMessage(triple);\n-\n+\t*ctx = llvm_ops-\u003ecreate_context(arch);\n \tif (!*ctx) {\n \t\tp_err(\"Failed to create disassembler\");\n \t\treturn -1;\n@@ -115,7 +178,7 @@ init_context(disasm_ctx_t *ctx, const char *arch,\n \n static void destroy_context(disasm_ctx_t *ctx)\n {\n-\tLLVMDisposeMessage(*ctx);\n+\tllvm_ops-\u003edestroy_context(*ctx);\n }\n \n static int\n@@ -125,7 +188,7 @@ disassemble_insn(disasm_ctx_t *ctx, unsigned char *image, ssize_t len, int pc,\n \tchar buf[256];\n \tint count;\n \n-\tcount = LLVMDisasmInstruction(*ctx, image + pc, len - pc, func_ksym + pc,\n+\tcount = llvm_ops-\u003edisassemble(*ctx, image + pc, len - pc, func_ksym + pc,\n \t\t\t\t buf, sizeof(buf));\n \tif (json_output)\n \t\tprintf_json(buf);\n@@ -135,12 +198,16 @@ disassemble_insn(disasm_ctx_t *ctx, unsigned char *image, ssize_t len, int pc,\n \treturn count;\n }\n \n+bool disasm_llvm_available(void)\n+{\n+\treturn !llvm_load(false);\n+}\n+\n int disasm_init(void)\n {\n-\tLLVMInitializeAllTargetInfos();\n-\tLLVMInitializeAllTargetMCs();\n-\tLLVMInitializeAllDisassemblers();\n-\treturn 0;\n+\tif (llvm_load(true))\n+\t\treturn -1;\n+\treturn llvm_ops-\u003einit();\n }\n #endif /* HAVE_LLVM_SUPPORT */\n \ndiff --git a/tools/bpf/bpftool/llvm_disasm.c b/tools/bpf/bpftool/llvm_disasm.c\nnew file mode 100644\nindex 00000000000000..b92df1e8966f7a\n--- /dev/null\n+++ b/tools/bpf/bpftool/llvm_disasm.c\n@@ -0,0 +1,84 @@\n+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)\n+/*\n+ * libLLVM-based disassembler for JITed programs.\n+ *\n+ * This file is usually built as bpftool-llvm.so, the only bpftool component\n+ * linked against libLLVM, which bpftool loads only when it needs to\n+ * disassemble JITed programs (see jit_disasm.c). It is linked into bpftool\n+ * directly when libLLVM is a static library.\n+ */\n+#include \u003cstring.h\u003e\n+\n+#include \u003cllvm-c/Core.h\u003e\n+#include \u003cllvm-c/Disassembler.h\u003e\n+#include \u003cllvm-c/Target.h\u003e\n+#include \u003cllvm-c/TargetMachine.h\u003e\n+\n+#include \"llvm_disasm.h\"\n+\n+/*\n+ * This callback to set the ref_type is necessary to have the LLVM disassembler\n+ * print PC-relative addresses instead of byte offsets for branch instruction\n+ * targets.\n+ */\n+static const char *\n+symbol_lookup_callback(void *disasm_info, uint64_t ref_value,\n+\t\t uint64_t *ref_type, uint64_t ref_PC,\n+\t\t const char **ref_name)\n+{\n+\t*ref_type = LLVMDisassembler_ReferenceType_InOut_None;\n+\treturn NULL;\n+}\n+\n+static int llvm_init(void)\n+{\n+\tLLVMInitializeAllTargetInfos();\n+\tLLVMInitializeAllTargetMCs();\n+\tLLVMInitializeAllDisassemblers();\n+\treturn 0;\n+}\n+\n+static void *llvm_create_context(const char *arch)\n+{\n+\tLLVMDisasmContextRef ctx;\n+\tchar *triple;\n+\n+\tif (arch)\n+\t\ttriple = LLVMNormalizeTargetTriple(arch);\n+\telse\n+\t\ttriple = LLVMGetDefaultTargetTriple();\n+\tif (!triple)\n+\t\treturn NULL;\n+\n+\t/*\n+\t * Enable all aarch64 ISA extensions so the disassembler can handle any\n+\t * instruction the kernel JIT might emit (e.g. ARM64 LSE atomics).\n+\t */\n+\tif (!strncmp(triple, \"aarch64\", 7))\n+\t\tctx = LLVMCreateDisasmCPUFeatures(triple, \"\", \"+all\", NULL, 0, NULL,\n+\t\t\t\t\t\t symbol_lookup_callback);\n+\telse\n+\t\tctx = LLVMCreateDisasm(triple, NULL, 0, NULL, symbol_lookup_callback);\n+\tLLVMDisposeMessage(triple);\n+\n+\treturn ctx;\n+}\n+\n+static void llvm_destroy_context(void *ctx)\n+{\n+\tLLVMDisasmDispose(ctx);\n+}\n+\n+static size_t llvm_disassemble(void *ctx, uint8_t *bytes, uint64_t size,\n+\t\t\t uint64_t pc, char *buf, size_t buf_size)\n+{\n+\treturn LLVMDisasmInstruction(ctx, bytes, size, pc, buf, buf_size);\n+}\n+\n+const struct bpftool_llvm_ops bpftool_llvm_ops = {\n+\t.abi_version\t\t= BPFTOOL_LLVM_ABI_VERSION,\n+\t.init\t\t\t= llvm_init,\n+\t.create_context\t\t= llvm_create_context,\n+\t.destroy_context\t= llvm_destroy_context,\n+\t.disassemble\t\t= llvm_disassemble,\n+};\ndiff --git a/tools/bpf/bpftool/llvm_disasm.h b/tools/bpf/bpftool/llvm_disasm.h\nnew file mode 100644\nindex 00000000000000..34123a80df0213\n--- /dev/null\n+++ b/tools/bpf/bpftool/llvm_disasm.h\n@@ -0,0 +1,41 @@\n+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */\n+#ifndef __BPFTOOL_LLVM_DISASM_H\n+#define __BPFTOOL_LLVM_DISASM_H\n+\n+#include \u003cstddef.h\u003e\n+#include \u003cstdint.h\u003e\n+\n+/*\n+ * Interface between bpftool and its libLLVM-based JIT disassembler.\n+ *\n+ * The disassembler is usually built as a plugin, bpftool-llvm.so, that\n+ * bpftool loads with dlopen(); bpftool then looks up the\n+ * BPFTOOL_LLVM_OPS_SYM symbol in it. The plugin can come from a different\n+ * build than the bpftool binary, so bump BPFTOOL_LLVM_ABI_VERSION on any\n+ * incompatible change to struct bpftool_llvm_ops, and always keep\n+ * abi_version as its first member.\n+ */\n+#define BPFTOOL_LLVM_ABI_VERSION\t1U\n+#define BPFTOOL_LLVM_OPS_SYM\t\t\"bpftool_llvm_ops\"\n+\n+struct bpftool_llvm_ops {\n+\tunsigned int abi_version;\n+\t/* Initialize libLLVM targets and disassemblers. Returns 0 on success. */\n+\tint (*init)(void);\n+\t/*\n+\t * Create a disassembler context for @arch, or for the host if @arch\n+\t * is NULL. Returns NULL on failure.\n+\t */\n+\tvoid *(*create_context)(const char *arch);\n+\tvoid (*destroy_context)(void *ctx);\n+\t/*\n+\t * Disassemble the instruction at @bytes, located at address @pc, into\n+\t * @buf. Returns the size of the instruction, or 0 if it is invalid.\n+\t */\n+\tsize_t (*disassemble)(void *ctx, uint8_t *bytes, uint64_t size,\n+\t\t\t uint64_t pc, char *buf, size_t buf_size);\n+};\n+\n+extern const struct bpftool_llvm_ops bpftool_llvm_ops;\n+\n+#endif /* __BPFTOOL_LLVM_DISASM_H */\ndiff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c\nindex d15fec71b64eec..321e928d651c39 100644\n--- a/tools/bpf/bpftool/main.c\n+++ b/tools/bpf/bpftool/main.c\n@@ -124,7 +124,8 @@ static int do_version(int argc, char **argv)\n \tconst bool has_libbfd = false;\n #endif\n #ifdef HAVE_LLVM_SUPPORT\n-\tconst bool has_llvm = true;\n+\t/* The LLVM disassembler may be a plugin that is not installed */\n+\tconst bool has_llvm = disasm_llvm_available();\n #else\n \tconst bool has_llvm = false;\n #endif\ndiff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h\nindex b1eb4b5d991b8a..96d7b147aa9d3f 100644\n--- a/tools/bpf/bpftool/main.h\n+++ b/tools/bpf/bpftool/main.h\n@@ -214,6 +214,9 @@ static inline int disasm_init(void)\n \treturn -1;\n }\n #endif\n+#ifdef HAVE_LLVM_SUPPORT\n+bool disasm_llvm_available(void);\n+#endif\n void print_data_json(uint8_t *data, size_t len);\n void print_hex_data_json(uint8_t *data, size_t len);\n \n"
} |
| 2/1 | 2026/10/30 02:50 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only modifies files under tools/bpf/bpftool/, which is a user-space tool and does not affect the compiled kernel image (vmlinux) or kernel modules. Therefore, these changes are not relevant for kernel fuzzing.",
"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 b23994ae8f63a76b9aed6f7179076bd4c1d3b8a8
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Oct 30 02:50:08 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index b0f7168e794329..dc8e4be8629603 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -63,6 +63,7 @@ $(LIBBPF_BOOTSTRAP)-clean: FORCE | $(LIBBPF_BOOTSTRAP_OUTPUT)
$(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_BOOTSTRAP_OUTPUT) clean >/dev/null
prefix ?= /usr/local
+libdir ?= $(prefix)/lib
bash_compdir ?= /usr/share/bash-completion/completions
CFLAGS += -O2
@@ -170,7 +171,7 @@ include $(wildcard $(OUTPUT)*.d)
all: $(OUTPUT)bpftool
-SRCS := $(wildcard *.c)
+SRCS := $(filter-out llvm_disasm.c,$(wildcard *.c))
ifeq ($(feature-llvm),1)
ifneq ($(SKIP_LLVM),1)
@@ -186,10 +187,19 @@ ifeq ($(HAS_LLVM),1)
# Makefile includes lib.mk which sets -D_GNU_SOURCE) which would cause
# compilation error due to redefinition. Let's filter it out here.
CFLAGS += $(filter-out -D_GNU_SOURCE,$(shell $(LLVM_CONFIG) --cflags))
- LIBS += $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS))
+ LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS))
ifeq ($(shell $(LLVM_CONFIG) --shared-mode),static)
+ # No libLLVM.so dependency to avoid, link the disassembler into bpftool
+ SRCS += llvm_disasm.c
+ LIBS += $(LLVM_LIBS)
LIBS += $(shell $(LLVM_CONFIG) --system-libs $(LLVM_CONFIG_LIB_COMPONENTS))
LIBS += -lstdc++
+ else
+ # Build the disassembler as a plugin, the only object linked against
+ # libLLVM, that bpftool loads only to disassemble JITed programs
+ LLVM_PLUGIN := $(OUTPUT)bpftool-llvm.so
+ CFLAGS += -DLLVM_PLUGIN_DIR='"$(libdir)/bpftool"'
+ LIBS += -ldl
endif
LDFLAGS += $(shell $(LLVM_CONFIG) --ldflags)
else
@@ -290,6 +300,21 @@ $(BPFTOOL_BOOTSTRAP): $(BOOTSTRAP_OBJS) $(LIBBPF_BOOTSTRAP)
$(OUTPUT)bpftool: $(OBJS) $(LIBBPF)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
+ifneq ($(LLVM_PLUGIN),)
+all: $(LLVM_PLUGIN)
+
+$(LLVM_PLUGIN): CFLAGS += -fPIC
+$(LLVM_PLUGIN): $(OUTPUT)llvm_disasm.o
+ $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -shared $< $(LLVM_LIBS) -o $@
+
+# The plugin directory, $(libdir)/bpftool, is compiled into jit_disasm.o.
+# Recompile it if libdir changes, e.g. on "make" then "make install libdir=...".
+$(OUTPUT)llvm-plugin-dir: FORCE
+ $(Q)echo '$(libdir)/bpftool' | cmp -s - $@ || echo '$(libdir)/bpftool' > $@
+
+$(OUTPUT)jit_disasm.o: $(OUTPUT)llvm-plugin-dir
+endif
+
$(BOOTSTRAP_OUTPUT)%.o: %.c $(LIBBPF_BOOTSTRAP_INTERNAL_HDRS) | $(BOOTSTRAP_OUTPUT)
$(QUIET_CC)$(HOSTCC) $(HOST_CFLAGS) -c -MMD $< -o $@
@@ -303,16 +328,21 @@ feature-detect-clean:
clean: $(LIBBPF)-clean $(LIBBPF_BOOTSTRAP)-clean feature-detect-clean
$(call QUIET_CLEAN, bpftool)
$(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
+ $(Q)$(RM) -- $(OUTPUT)bpftool-llvm.so $(OUTPUT)llvm-plugin-dir
$(Q)$(RM) -- $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
$(Q)$(RM) -r -- $(LIBBPF_OUTPUT) $(BOOTSTRAP_OUTPUT)
$(call QUIET_CLEAN, core-gen)
$(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.bpftool
$(Q)$(RM) -r -- $(OUTPUT)feature/
-install-bin: $(OUTPUT)bpftool
+install-bin: $(OUTPUT)bpftool $(LLVM_PLUGIN)
$(call QUIET_INSTALL, bpftool)
$(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(prefix)/sbin
$(Q)$(INSTALL) $(OUTPUT)bpftool $(DESTDIR)$(prefix)/sbin/bpftool
+ifneq ($(LLVM_PLUGIN),)
+ $(call QUIET_INSTALL, bpftool-llvm.so)
+ $(Q)$(INSTALL) -m 0755 -D -t $(DESTDIR)$(libdir)/bpftool $(LLVM_PLUGIN)
+endif
install: install-bin
$(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(bash_compdir)
@@ -321,6 +351,8 @@ install: install-bin
uninstall:
$(call QUIET_UNINST, bpftool)
$(Q)$(RM) -- $(DESTDIR)$(prefix)/sbin/bpftool
+ $(call QUIET_UNINST, bpftool-llvm.so)
+ $(Q)$(RM) -r -- $(DESTDIR)$(libdir)/bpftool
$(Q)$(RM) -- $(DESTDIR)$(bash_compdir)/bpftool
doc:
diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
index 04541155e9ccc4..2691252a115b96 100644
--- a/tools/bpf/bpftool/jit_disasm.c
+++ b/tools/bpf/bpftool/jit_disasm.c
@@ -25,10 +25,10 @@
#include <bpf/libbpf.h>
#ifdef HAVE_LLVM_SUPPORT
-#include <llvm-c/Core.h>
-#include <llvm-c/Disassembler.h>
-#include <llvm-c/Target.h>
-#include <llvm-c/TargetMachine.h>
+#ifdef LLVM_PLUGIN_DIR
+#include <dlfcn.h>
+#endif
+#include "llvm_disasm.h"
#endif
#ifdef HAVE_LIBBFD_SUPPORT
@@ -45,7 +45,105 @@ static int oper_count;
#ifdef HAVE_LLVM_SUPPORT
#define DISASM_SPACER
-typedef LLVMDisasmContextRef disasm_ctx_t;
+typedef void *disasm_ctx_t;
+
+static const struct bpftool_llvm_ops *llvm_ops;
+
+#ifdef LLVM_PLUGIN_DIR
+#define LLVM_PLUGIN_NAME "bpftool-llvm.so"
+
+static const char *dl_error(void)
+{
+ const char *err = dlerror();
+
+ /* The error may already be consumed, e.g. by an LD_PRELOAD-ed library */
+ return err ? err : "unknown error";
+}
+
+/*
+ * Look for the plugin in its install directory, then next to the bpftool
+ * binary so that bpftool also works from its build directory. Do not look
+ * in the current directory: bpftool usually runs as root, and would then
+ * load any library planted in the directory it is run from.
+ */
+static int llvm_plugin_find(char *path, size_t size)
+{
+ char exe[PATH_MAX];
+ ssize_t len;
+ char *dir;
+ int n;
+
+ snprintf(path, size, "%s/%s", LLVM_PLUGIN_DIR, LLVM_PLUGIN_NAME);
+ if (!access(path, F_OK))
+ return 0;
+
+ len = readlink("/proc/self/exe", exe, sizeof(exe) - 1);
+ if (len < 0)
+ return -1;
+ exe[len] = '\0';
+ dir = strrchr(exe, '/');
+ if (!dir)
+ return -1;
+ *dir = '\0';
+
+ n = snprintf(path, size, "%s/%s", exe, LLVM_PLUGIN_NAME);
+ if (n < 0 || (size_t)n >= size)
+ return -1;
+ return access(path, F_OK);
+}
+
+static int llvm_load(bool verbose)
+{
+ const struct bpftool_llvm_ops *ops;
+ char path[PATH_MAX];
+ void *handle;
+
+ if (llvm_ops)
+ return 0;
+
+ if (llvm_plugin_find(path, sizeof(path))) {
+ if (verbose)
+ p_err("%s not found in %s or next to bpftool, it is required to disassemble JITed programs",
+ LLVM_PLUGIN_NAME, LLVM_PLUGIN_DIR);
+ return -1;
+ }
+
+ handle = dlopen(path, RTLD_NOW | RTLD_LOCAL);
+ if (!handle) {
+ if (verbose)
+ p_err("failed to load LLVM disassembler plugin: %s",
+ dl_error());
+ return -1;
+ }
+
+ ops = dlsym(handle, BPFTOOL_LLVM_OPS_SYM);
+ if (!ops) {
+ if (verbose)
+ p_err("invalid LLVM disassembler plugin: %s", dl_error());
+ goto err_close;
+ }
+ if (ops->abi_version != BPFTOOL_LLVM_ABI_VERSION) {
+ if (verbose)
+ p_err("%s has ABI version %u, expected %u",
+ path, ops->abi_version, BPFTOOL_LLVM_ABI_VERSION);
+ goto err_close;
+ }
+
+ /* Keep the plugin loaded until bpftool exits */
+ llvm_ops = ops;
+ return 0;
+
+err_close:
+ dlclose(handle);
+ return -1;
+}
+#else
+static int llvm_load(__maybe_unused bool verbose)
+{
+ llvm_ops = &bpftool_llvm_ops;
+ return 0;
+}
+#endif /* LLVM_PLUGIN_DIR */
static int printf_json(char *s)
{
@@ -63,48 +161,13 @@ static int printf_json(char *s)
return 0;
}
-/* This callback to set the ref_type is necessary to have the LLVM disassembler
- * print PC-relative addresses instead of byte offsets for branch instruction
- * targets.
- */
-static const char *
-symbol_lookup_callback(__maybe_unused void *disasm_info,
- __maybe_unused uint64_t ref_value,
- uint64_t *ref_type, __maybe_unused uint64_t ref_PC,
- __maybe_unused const char **ref_name)
-{
- *ref_type = LLVMDisassembler_ReferenceType_InOut_None;
- return NULL;
-}
-
static int
init_context(disasm_ctx_t *ctx, const char *arch,
__maybe_unused const char *disassembler_options,
__maybe_unused unsigned char *image, __maybe_unused ssize_t len,
__maybe_unused __u64 func_ksym)
{
- char *triple;
-
- if (arch)
- triple = LLVMNormalizeTargetTriple(arch);
- else
- triple = LLVMGetDefaultTargetTriple();
- if (!triple) {
- p_err("Failed to retrieve triple");
- return -1;
- }
-
- /*
- * Enable all aarch64 ISA extensions so the disassembler can handle any
- * instruction the kernel JIT might emit (e.g. ARM64 LSE atomics).
- */
- if (!strncmp(triple, "aarch64", 7))
- *ctx = LLVMCreateDisasmCPUFeatures(triple, "", "+all", NULL, 0, NULL,
- symbol_lookup_callback);
- else
- *ctx = LLVMCreateDisasm(triple, NULL, 0, NULL, symbol_lookup_callback);
- LLVMDisposeMessage(triple);
-
+ *ctx = llvm_ops->create_context(arch);
if (!*ctx) {
p_err("Failed to create disassembler");
return -1;
@@ -115,7 +178,7 @@ init_context(disasm_ctx_t *ctx, const char *arch,
static void destroy_context(disasm_ctx_t *ctx)
{
- LLVMDisposeMessage(*ctx);
+ llvm_ops->destroy_context(*ctx);
}
static int
@@ -125,7 +188,7 @@ disassemble_insn(disasm_ctx_t *ctx, unsigned char *image, ssize_t len, int pc,
char buf[256];
int count;
- count = LLVMDisasmInstruction(*ctx, image + pc, len - pc, func_ksym + pc,
+ count = llvm_ops->disassemble(*ctx, image + pc, len - pc, func_ksym + pc,
buf, sizeof(buf));
if (json_output)
printf_json(buf);
@@ -135,12 +198,16 @@ disassemble_insn(disasm_ctx_t *ctx, unsigned char *image, ssize_t len, int pc,
return count;
}
+bool disasm_llvm_available(void)
+{
+ return !llvm_load(false);
+}
+
int disasm_init(void)
{
- LLVMInitializeAllTargetInfos();
- LLVMInitializeAllTargetMCs();
- LLVMInitializeAllDisassemblers();
- return 0;
+ if (llvm_load(true))
+ return -1;
+ return llvm_ops->init();
}
#endif /* HAVE_LLVM_SUPPORT */
diff --git a/tools/bpf/bpftool/llvm_disasm.c b/tools/bpf/bpftool/llvm_disasm.c
new file mode 100644
index 00000000000000..b92df1e8966f7a
--- /dev/null
+++ b/tools/bpf/bpftool/llvm_disasm.c
@@ -0,0 +1,84 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * libLLVM-based disassembler for JITed programs.
+ *
+ * This file is usually built as bpftool-llvm.so, the only bpftool component
+ * linked against libLLVM, which bpftool loads only when it needs to
+ * disassemble JITed programs (see jit_disasm.c). It is linked into bpftool
+ * directly when libLLVM is a static library.
+ */
+#include <string.h>
+
+#include <llvm-c/Core.h>
+#include <llvm-c/Disassembler.h>
+#include <llvm-c/Target.h>
+#include <llvm-c/TargetMachine.h>
+
+#include "llvm_disasm.h"
+
+/*
+ * This callback to set the ref_type is necessary to have the LLVM disassembler
+ * print PC-relative addresses instead of byte offsets for branch instruction
+ * targets.
+ */
+static const char *
+symbol_lookup_callback(void *disasm_info, uint64_t ref_value,
+ uint64_t *ref_type, uint64_t ref_PC,
+ const char **ref_name)
+{
+ *ref_type = LLVMDisassembler_ReferenceType_InOut_None;
+ return NULL;
+}
+
+static int llvm_init(void)
+{
+ LLVMInitializeAllTargetInfos();
+ LLVMInitializeAllTargetMCs();
+ LLVMInitializeAllDisassemblers();
+ return 0;
+}
+
+static void *llvm_create_context(const char *arch)
+{
+ LLVMDisasmContextRef ctx;
+ char *triple;
+
+ if (arch)
+ triple = LLVMNormalizeTargetTriple(arch);
+ else
+ triple = LLVMGetDefaultTargetTriple();
+ if (!triple)
+ return NULL;
+
+ /*
+ * Enable all aarch64 ISA extensions so the disassembler can handle any
+ * instruction the kernel JIT might emit (e.g. ARM64 LSE atomics).
+ */
+ if (!strncmp(triple, "aarch64", 7))
+ ctx = LLVMCreateDisasmCPUFeatures(triple, "", "+all", NULL, 0, NULL,
+ symbol_lookup_callback);
+ else
+ ctx = LLVMCreateDisasm(triple, NULL, 0, NULL, symbol_lookup_callback);
+ LLVMDisposeMessage(triple);
+
+ return ctx;
+}
+
+static void llvm_destroy_context(void *ctx)
+{
+ LLVMDisasmDispose(ctx);
+}
+
+static size_t llvm_disassemble(void *ctx, uint8_t *bytes, uint64_t size,
+ uint64_t pc, char *buf, size_t buf_size)
+{
+ return LLVMDisasmInstruction(ctx, bytes, size, pc, buf, buf_size);
+}
+
+const struct bpftool_llvm_ops bpftool_llvm_ops = {
+ .abi_version = BPFTOOL_LLVM_ABI_VERSION,
+ .init = llvm_init,
+ .create_context = llvm_create_context,
+ .destroy_context = llvm_destroy_context,
+ .disassemble = llvm_disassemble,
+};
diff --git a/tools/bpf/bpftool/llvm_disasm.h b/tools/bpf/bpftool/llvm_disasm.h
new file mode 100644
index 00000000000000..34123a80df0213
--- /dev/null
+++ b/tools/bpf/bpftool/llvm_disasm.h
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+#ifndef __BPFTOOL_LLVM_DISASM_H
+#define __BPFTOOL_LLVM_DISASM_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+/*
+ * Interface between bpftool and its libLLVM-based JIT disassembler.
+ *
+ * The disassembler is usually built as a plugin, bpftool-llvm.so, that
+ * bpftool loads with dlopen(); bpftool then looks up the
+ * BPFTOOL_LLVM_OPS_SYM symbol in it. The plugin can come from a different
+ * build than the bpftool binary, so bump BPFTOOL_LLVM_ABI_VERSION on any
+ * incompatible change to struct bpftool_llvm_ops, and always keep
+ * abi_version as its first member.
+ */
+#define BPFTOOL_LLVM_ABI_VERSION 1U
+#define BPFTOOL_LLVM_OPS_SYM "bpftool_llvm_ops"
+
+struct bpftool_llvm_ops {
+ unsigned int abi_version;
+ /* Initialize libLLVM targets and disassemblers. Returns 0 on success. */
+ int (*init)(void);
+ /*
+ * Create a disassembler context for @arch, or for the host if @arch
+ * is NULL. Returns NULL on failure.
+ */
+ void *(*create_context)(const char *arch);
+ void (*destroy_context)(void *ctx);
+ /*
+ * Disassemble the instruction at @bytes, located at address @pc, into
+ * @buf. Returns the size of the instruction, or 0 if it is invalid.
+ */
+ size_t (*disassemble)(void *ctx, uint8_t *bytes, uint64_t size,
+ uint64_t pc, char *buf, size_t buf_size);
+};
+
+extern const struct bpftool_llvm_ops bpftool_llvm_ops;
+
+#endif /* __BPFTOOL_LLVM_DISASM_H */
diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c
index d15fec71b64eec..321e928d651c39 100644
--- a/tools/bpf/bpftool/main.c
+++ b/tools/bpf/bpftool/main.c
@@ -124,7 +124,8 @@ static int do_version(int argc, char **argv)
const bool has_libbfd = false;
#endif
#ifdef HAVE_LLVM_SUPPORT
- const bool has_llvm = true;
+ /* The LLVM disassembler may be a plugin that is not installed */
+ const bool has_llvm = disasm_llvm_available();
#else
const bool has_llvm = false;
#endif
diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
index b1eb4b5d991b8a..96d7b147aa9d3f 100644
--- a/tools/bpf/bpftool/main.h
+++ b/tools/bpf/bpftool/main.h
@@ -214,6 +214,9 @@ static inline int disasm_init(void)
return -1;
}
#endif
+#ifdef HAVE_LLVM_SUPPORT
+bool disasm_llvm_available(void);
+#endif
void print_data_json(uint8_t *data, size_t len);
void print_hex_data_json(uint8_t *data, size_t len);
|
| 3/2 | 2026/10/30 02:50 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 8682 output: 24 thoughts: 459 Thoughts: **Patch Series Evaluation - WorthFuzzing=false** Okay, let's take a look at this patch series. My initial thought is to examine the `diff` itself, focusing on the files that have been modified. I see that the changes are confined to `tools/bpf/bpftool/Makefile`, `jit_disasm.c`, `llvm_disasm.c`, `llvm_disasm.h`, `main.c`, and `main.h`. All of them, importantly, are neatly contained within that `tools/bpf/bpftool/` directory. Now, let's refer back to Section 2 of the prompt regarding when to return `WorthFuzzing=false`. The prompt outlines several "negative criteria," and I need to check if these changes fall into any of those categories. Specifically, it lists user-space directories that don't affect the kernel. Given that all the modifications are within `tools/bpf/bpftool/`, and `bpftool` is a user-space utility in the `tools/` directory, I can confidently conclude that this falls under the "User-space directories... that do not affect the compiled kernel image (vmlinux) or kernel modules" negative criteria. `bpftool` is a utility; it doesn't touch the kernel's core logic. I want to be absolutely certain, so I will now verify the git commit for any other changes. I'll use a git tool to double-check that this is the full scope of the change. But, based on this initial analysis, I'm leaning toward a strong `WorthFuzzing=false` response. |
| 4/2 | 2026/10/30 02:50 | tool | grepper |
0mArgs:{
"Expression": "BPFTOOL_LLVM_ABI_VERSION"
}Results: {
"Output": "tools/bpf/bpftool/jit_disasm.c=95=static int llvm_load(bool verbose)\n--\ntools/bpf/bpftool/jit_disasm.c-124-\t}\ntools/bpf/bpftool/jit_disasm.c:125:\tif (ops-\u003eabi_version != BPFTOOL_LLVM_ABI_VERSION) {\ntools/bpf/bpftool/jit_disasm.c-126-\t\tif (verbose)\ntools/bpf/bpftool/jit_disasm.c-127-\t\t\tp_err(\"%s has ABI version %u, expected %u\",\ntools/bpf/bpftool/jit_disasm.c:128:\t\t\t path, ops-\u003eabi_version, BPFTOOL_LLVM_ABI_VERSION);\ntools/bpf/bpftool/jit_disasm.c-129-\t\tgoto err_close;\n--\ntools/bpf/bpftool/llvm_disasm.c=78=const struct bpftool_llvm_ops bpftool_llvm_ops = {\ntools/bpf/bpftool/llvm_disasm.c:79:\t.abi_version\t\t= BPFTOOL_LLVM_ABI_VERSION,\ntools/bpf/bpftool/llvm_disasm.c-80-\t.init\t\t\t= llvm_init,\n--\ntools/bpf/bpftool/llvm_disasm.h-13- * BPFTOOL_LLVM_OPS_SYM symbol in it. The plugin can come from a different\ntools/bpf/bpftool/llvm_disasm.h:14: * build than the bpftool binary, so bump BPFTOOL_LLVM_ABI_VERSION on any\ntools/bpf/bpftool/llvm_disasm.h-15- * incompatible change to struct bpftool_llvm_ops, and always keep\n--\ntools/bpf/bpftool/llvm_disasm.h-17- */\ntools/bpf/bpftool/llvm_disasm.h:18:#define BPFTOOL_LLVM_ABI_VERSION\t1U\ntools/bpf/bpftool/llvm_disasm.h-19-#define BPFTOOL_LLVM_OPS_SYM\t\t\"bpftool_llvm_ops\"\n"
} |
| 5/2 | 2026/10/30 02:50 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10088 output: 82 thoughts: 220 Thoughts: **Fuzzing Verdict: bpftool Changes** Okay, so the modifications are strictly within `tools/bpf/bpftool/`. Let's clarify the `set-results` format. It requires `WorthFuzzing`, `Reasoning`, `FocusSymbols`, and `EnableConfigs`. Alright, let's look at the criteria for marking something as not worth fuzzing: "Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories: - Non-kernel and non-executable changes: * 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." Given that this is all within `tools/bpf/bpftool/`, which builds the `bpftool` userspace binary, and doesn't affect the kernel image or modules at all, it's a clear fit for that first condition. No kernel impact here. So, `WorthFuzzing` should be `false`. Now, let's call `set-results`. |
| 6/2 | 2026/10/30 02:50 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch only modifies files under tools/bpf/bpftool/, which is a user-space tool and does not affect the compiled kernel image (vmlinux) or kernel modules. Therefore, these changes are not relevant for kernel fuzzing.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only modifies files under tools/bpf/bpftool/, which is a user-space tool and does not affect the compiled kernel image (vmlinux) or kernel modules. Therefore, these changes are not relevant for kernel fuzzing.",
"WorthFuzzing": false
} |
| 7/1 | 2026/10/30 02:50 | 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) |
|---|