AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/11/11 01:00 flow patch-triage
0m Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "KMSANReasoning": "",
  "NeedsKMSAN": false,
  "Reasoning": "All changes in this patch series are strictly confined to user-space directories under tools/ (bpftool, libbpf, and bpf selftests). They do not modify the Linux kernel image (vmlinux) or any kernel modules, making syzkaller fuzzing inapplicable.",
  "WorthFuzzing": false
}

1/1 2026/11/11 01:00 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit ee2f82b91d882b4dbe247dc696cd071e11bc4e66\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Wed Nov 11 01:00:10 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/tools/bpf/bpftool/btf_dumper.c b/tools/bpf/bpftool/btf_dumper.c\nindex 3267163119dc2d..a7171622ce57bd 100644\n--- a/tools/bpf/bpftool/btf_dumper.c\n+++ b/tools/bpf/bpftool/btf_dumper.c\n@@ -149,28 +149,29 @@ static int btf_dumper_enum(const struct btf_dumper *d,\n \t\t\t    const void *data)\n {\n \tconst struct btf_enum *enums = btf_enum(t);\n-\t__s64 value;\n+\tbool is_signed = btf_kflag(t);\n+\t__u64 value;\n \t__u32 i;\n \n \tswitch (t-\u003esize) {\n \tcase 8:\n-\t\tvalue = *(__s64 *)data;\n+\t\tvalue = *(__u64 *)data;\n \t\tbreak;\n \tcase 4:\n-\t\tvalue = *(__s32 *)data;\n+\t\tvalue = is_signed ? (__s64)*(__s32 *)data : *(__u32 *)data;\n \t\tbreak;\n \tcase 2:\n-\t\tvalue = *(__s16 *)data;\n+\t\tvalue = is_signed ? *(__s16 *)data : *(__u16 *)data;\n \t\tbreak;\n \tcase 1:\n-\t\tvalue = *(__s8 *)data;\n+\t\tvalue = is_signed ? *(__s8 *)data : *(__u8 *)data;\n \t\tbreak;\n \tdefault:\n \t\treturn -EINVAL;\n \t}\n \n \tfor (i = 0; i \u003c btf_vlen(t); i++) {\n-\t\tif (value == enums[i].val) {\n+\t\tif (value == btf_enum_value(t, \u0026enums[i])) {\n \t\t\tjsonw_string(d-\u003ejw,\n \t\t\t\t     btf__name_by_offset(d-\u003ebtf,\n \t\t\t\t\t\t\t enums[i].name_off));\n@@ -178,7 +179,10 @@ static int btf_dumper_enum(const struct btf_dumper *d,\n \t\t}\n \t}\n \n-\tjsonw_int(d-\u003ejw, value);\n+\tif (is_signed)\n+\t\tjsonw_int(d-\u003ejw, (__s64)value);\n+\telse\n+\t\tjsonw_uint(d-\u003ejw, value);\n \treturn 0;\n }\n \n@@ -204,7 +208,10 @@ static int btf_dumper_enum64(const struct btf_dumper *d,\n \t\t}\n \t}\n \n-\tjsonw_int(d-\u003ejw, value);\n+\tif (btf_kflag(t))\n+\t\tjsonw_int(d-\u003ejw, (__s64)value);\n+\telse\n+\t\tjsonw_uint(d-\u003ejw, value);\n \treturn 0;\n }\n \ndiff --git a/tools/lib/bpf/btf.h b/tools/lib/bpf/btf.h\nindex 57f12630c5d155..d74c92056f0ff5 100644\n--- a/tools/lib/bpf/btf.h\n+++ b/tools/lib/bpf/btf.h\n@@ -636,6 +636,12 @@ static inline struct btf_enum *btf_enum(const struct btf_type *t)\n \treturn (struct btf_enum *)(t + 1);\n }\n \n+/* btf_enum-\u003eval is signed even for unsigned enums; kflag records the sign. */\n+static inline __u64 btf_enum_value(const struct btf_type *t, const struct btf_enum *e)\n+{\n+\treturn btf_kflag(t) ? (__s64)e-\u003eval : (__u32)e-\u003eval;\n+}\n+\n struct btf_enum64;\n \n static inline struct btf_enum64 *btf_enum64(const struct btf_type *t)\ndiff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c\nindex fcd97aa9058976..602664a6adef0b 100644\n--- a/tools/lib/bpf/btf_dump.c\n+++ b/tools/lib/bpf/btf_dump.c\n@@ -2378,7 +2378,7 @@ static int btf_dump_enum_data(struct btf_dump *d,\n \t\tconst struct btf_enum *e;\n \n \t\tfor (i = 0, e = btf_enum(t); i \u003c btf_vlen(t); i++, e++) {\n-\t\t\tif (value != e-\u003eval)\n+\t\t\tif ((__u64)value != btf_enum_value(t, e))\n \t\t\t\tcontinue;\n \t\t\tbtf_dump_type_values(d, \"%s\", btf_name_of(d, e-\u003ename_off));\n \t\t\treturn 0;\ndiff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c\nindex 0e2a93a42908e3..44134421bd7db4 100644\n--- a/tools/lib/bpf/libbpf.c\n+++ b/tools/lib/bpf/libbpf.c\n@@ -2650,7 +2650,7 @@ static bool get_map_field_long(const char *map_name, const struct btf *btf,\n \tif (btf_is_enum(t)) {\n \t\tconst struct btf_enum *e = btf_enum(t);\n \n-\t\t*res = e-\u003eval;\n+\t\t*res = btf_enum_value(t, e);\n \t} else {\n \t\tconst struct btf_enum64 *e = btf_enum64(t);\n \ndiff --git a/tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c b/tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c\nindex 187b3f7843079c..a9584c83023cbe 100644\n--- a/tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c\n+++ b/tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c\n@@ -7,6 +7,7 @@\n \n #define PIN_PATH\t\"/sys/fs/bpf/test_bpftool_map_dump_sk_storage\"\n #define QUEUE_PIN_PATH\t\"/sys/fs/bpf/test_bpftool_map_dump_queue\"\n+#define ENUM_PIN_PATH\t\"/sys/fs/bpf/test_bpftool_map_dump_enum\"\n #define JSON_ERROR\t\"{\\\"error\\\":\\\"can't dump sk_storage map\"\n \n /* An empty socket storage map with an int value. */\n@@ -124,10 +125,85 @@ static void test_queue(void)\n \tclose(map_fd);\n }\n \n+struct enums {\n+\t__u8 u8_name;\n+\t__s8 s8_name;\n+\t__u32 u32_num;\n+\t__u64 u64_num;\n+};\n+\n+/* An array map. Its value is struct enums with an enum behind every member. */\n+static int create_enum_map(void)\n+{\n+\tLIBBPF_OPTS(bpf_map_create_opts, opts);\n+\tstruct btf *btf;\n+\tint fd = -1;\n+\n+\tbtf = btf__new_empty();\n+\tif (!ASSERT_OK_PTR(btf, \"btf__new_empty\"))\n+\t\treturn -1;\n+\n+\tbtf__add_int(btf, \"int\", 4, BTF_INT_SIGNED);\t/* [1] */\n+\tbtf__add_enum(btf, \"u8\", 1);\t\t\t/* [2] */\n+\tbtf__add_enum_value(btf, \"U8_MAX\", 0xff);\n+\tbtf__add_enum(btf, \"s8\", 1);\t\t\t/* [3] */\n+\tbtf__add_enum_value(btf, \"S8_NEG\", -1);\n+\tbtf__add_enum(btf, \"u32\", 4);\t\t\t/* [4] */\n+\tbtf__add_enum_value(btf, \"U32_ONE\", 1);\n+\tbtf__add_enum64(btf, \"u64\", 8, false);\t\t/* [5] */\n+\tbtf__add_enum64_value(btf, \"U64_ONE\", 1);\n+\tbtf__add_struct(btf, \"enums\", sizeof(struct enums)); /* [6] */\n+\tbtf__add_field(btf, \"u8_name\", 2, 0, 0);\n+\tbtf__add_field(btf, \"s8_name\", 3, 8, 0);\n+\tbtf__add_field(btf, \"u32_num\", 4, 32, 0);\n+\tbtf__add_field(btf, \"u64_num\", 5, 64, 0);\n+\tif (!ASSERT_OK(btf__load_into_kernel(btf), \"btf__load_into_kernel\"))\n+\t\tgoto out;\n+\n+\topts.btf_fd = btf__fd(btf);\n+\topts.btf_key_type_id = 1;\n+\topts.btf_value_type_id = 6;\n+\tfd = bpf_map_create(BPF_MAP_TYPE_ARRAY, \"enums\", sizeof(int),\n+\t\t\t    sizeof(struct enums), 1, \u0026opts);\n+\tASSERT_OK_FD(fd, \"bpf_map_create\");\n+out:\n+\tbtf__free(btf);\n+\treturn fd;\n+}\n+\n+static void test_enum(void)\n+{\n+\tstruct enums value = { 0xff, -1, (__u32)-22, (1ULL \u003c\u003c 63) | 1 };\n+\tchar output[1024] = {};\n+\tint map_fd, key = 0, ret;\n+\n+\tmap_fd = create_enum_map();\n+\tif (map_fd \u003c 0)\n+\t\treturn;\n+\tif (!ASSERT_OK(bpf_map_update_elem(map_fd, \u0026key, \u0026value, BPF_ANY),\n+\t\t       \"update map\"))\n+\t\tgoto out;\n+\tif (!ASSERT_OK(bpf_obj_pin(map_fd, ENUM_PIN_PATH), \"pin map\"))\n+\t\tgoto out;\n+\n+\tret = get_bpftool_command_output(\"-j map dump pinned \" ENUM_PIN_PATH,\n+\t\t\t\t\t output, sizeof(output));\n+\tASSERT_OK(ret, \"json dump\");\n+\tASSERT_HAS_SUBSTR(output,\n+\t\t\t  \"{\\\"u8_name\\\":\\\"U8_MAX\\\",\\\"s8_name\\\":\\\"S8_NEG\\\",\"\n+\t\t\t  \"\\\"u32_num\\\":4294967274,\\\"u64_num\\\":9223372036854775809}\",\n+\t\t\t  \"enum values\");\n+out:\n+\tunlink(ENUM_PIN_PATH);\n+\tclose(map_fd);\n+}\n+\n void test_bpftool_map_dump(void)\n {\n \tif (test__start_subtest(\"sk_storage\"))\n \t\ttest_sk_storage();\n \tif (test__start_subtest(\"queue\"))\n \t\ttest_queue();\n+\tif (test__start_subtest(\"enum\"))\n+\t\ttest_enum();\n }\ndiff --git a/tools/testing/selftests/bpf/prog_tests/btf_dump.c b/tools/testing/selftests/bpf/prog_tests/btf_dump.c\nindex bfa74db179871f..b5c90f7293398f 100644\n--- a/tools/testing/selftests/bpf/prog_tests/btf_dump.c\n+++ b/tools/testing/selftests/bpf/prog_tests/btf_dump.c\n@@ -944,6 +944,9 @@ static void test_btf_dump_typedef_data(struct btf *btf, struct btf_dump *d,\n static void test_btf_dump_enum_data(struct btf *btf, struct btf_dump *d,\n \t\t\t\t    char *str)\n {\n+\t__u32 high = 0x80000000;\n+\t__s32 neg = -1;\n+\n \t/* enum where enum value does (and does not) exist */\n \tTEST_BTF_DUMP_DATA_C(btf, d, \"enum\", str, enum bpf_cmd, BTF_F_COMPACT,\n \t\t\t     BPF_MAP_CREATE);\n@@ -975,6 +978,23 @@ static void test_btf_dump_enum_data(struct btf *btf, struct btf_dump *d,\n \n \tTEST_BTF_DUMP_DATA_OVER(btf, d, \"enum\", str, enum bpf_cmd,\n \t\t\t\tsizeof(enum bpf_cmd) - 1, \"\", BPF_MAP_CREATE);\n+\n+\t/* enumerators with bit 31 set in unsigned and in signed enum */\n+\tASSERT_GT(btf__add_enum(btf, \"test_enum_u32\", 4), 0, \"add unsigned enum\");\n+\tASSERT_OK(btf__add_enum_value(btf, \"TEST_ENUM_HIGH\", 0x80000000),\n+\t\t  \"add TEST_ENUM_HIGH\");\n+\tASSERT_GT(btf__add_enum(btf, \"test_enum_s32\", 4), 0, \"add signed enum\");\n+\tASSERT_OK(btf__add_enum_value(btf, \"TEST_ENUM_NEG\", -1), \"add TEST_ENUM_NEG\");\n+\n+\t/* btf_dump__dump_type_data() doesn't resize 'd' for the new types */\n+\td = btf_dump__new(btf, btf_dump_snprintf, str, NULL);\n+\tif (!ASSERT_OK_PTR(d, \"btf_dump__new\"))\n+\t\treturn;\n+\tASSERT_OK(btf_dump_data(btf, d, \"test_enum_u32\", NULL, 0, \u0026high, 4, str,\n+\t\t\t\t\"(enum test_enum_u32)TEST_ENUM_HIGH\"), \"dump unsigned enum\");\n+\tASSERT_OK(btf_dump_data(btf, d, \"test_enum_s32\", NULL, 0, \u0026neg, 4, str,\n+\t\t\t\t\"(enum test_enum_s32)TEST_ENUM_NEG\"), \"dump signed enum\");\n+\tbtf_dump__free(d);\n }\n \n static void test_btf_dump_struct_data(struct btf *btf, struct btf_dump *d,\ndiff --git a/tools/testing/selftests/bpf/prog_tests/map_extra.c b/tools/testing/selftests/bpf/prog_tests/map_extra.c\nnew file mode 100644\nindex 00000000000000..cbb1881ba693c5\n--- /dev/null\n+++ b/tools/testing/selftests/bpf/prog_tests/map_extra.c\n@@ -0,0 +1,19 @@\n+// SPDX-License-Identifier: GPL-2.0\n+#include \u003ctest_progs.h\u003e\n+#include \"test_map_extra.skel.h\"\n+\n+void test_map_extra(void)\n+{\n+\tstruct test_map_extra *skel;\n+\n+\tif (!test__start_subtest(\"enum32_high\"))\n+\t\treturn;\n+\n+\tskel = test_map_extra__open();\n+\tif (!ASSERT_OK_PTR(skel, \"test_map_extra__open\"))\n+\t\treturn;\n+\n+\tASSERT_EQ(bpf_map__map_extra(skel-\u003emaps.arena), 0x80000000ULL,\n+\t\t  \"map_extra\");\n+\ttest_map_extra__destroy(skel);\n+}\ndiff --git a/tools/testing/selftests/bpf/progs/test_map_extra.c b/tools/testing/selftests/bpf/progs/test_map_extra.c\nnew file mode 100644\nindex 00000000000000..b6aa2341c11510\n--- /dev/null\n+++ b/tools/testing/selftests/bpf/progs/test_map_extra.c\n@@ -0,0 +1,12 @@\n+// SPDX-License-Identifier: GPL-2.0\n+#include \u003clinux/bpf.h\u003e\n+#include \u003cbpf/bpf_helpers.h\u003e\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);\n+\t__ulong(map_extra, 0x80000000U);\n+} arena SEC(\".maps\");\n+\n+char LICENSE[] SEC(\"license\") = \"GPL\";\n"
}

2/1 2026/11/11 01:00 agent patch-evaluator
0m Model:
core

Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "All changes in this patch series are strictly confined to user-space directories under tools/ (bpftool, libbpf, and bpf selftests). They do not modify the Linux kernel image (vmlinux) or any kernel modules, making syzkaller fuzzing inapplicable.",
  "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 ee2f82b91d882b4dbe247dc696cd071e11bc4e66
Author: syz-cluster <triage@syzkaller.com>
Date:   Wed Nov 11 01:00:10 2026 +0000

    syz-cluster: applied patch under review

diff --git a/tools/bpf/bpftool/btf_dumper.c b/tools/bpf/bpftool/btf_dumper.c
index 3267163119dc2d..a7171622ce57bd 100644
--- a/tools/bpf/bpftool/btf_dumper.c
+++ b/tools/bpf/bpftool/btf_dumper.c
@@ -149,28 +149,29 @@ static int btf_dumper_enum(const struct btf_dumper *d,
 			    const void *data)
 {
 	const struct btf_enum *enums = btf_enum(t);
-	__s64 value;
+	bool is_signed = btf_kflag(t);
+	__u64 value;
 	__u32 i;
 
 	switch (t->size) {
 	case 8:
-		value = *(__s64 *)data;
+		value = *(__u64 *)data;
 		break;
 	case 4:
-		value = *(__s32 *)data;
+		value = is_signed ? (__s64)*(__s32 *)data : *(__u32 *)data;
 		break;
 	case 2:
-		value = *(__s16 *)data;
+		value = is_signed ? *(__s16 *)data : *(__u16 *)data;
 		break;
 	case 1:
-		value = *(__s8 *)data;
+		value = is_signed ? *(__s8 *)data : *(__u8 *)data;
 		break;
 	default:
 		return -EINVAL;
 	}
 
 	for (i = 0; i < btf_vlen(t); i++) {
-		if (value == enums[i].val) {
+		if (value == btf_enum_value(t, &enums[i])) {
 			jsonw_string(d->jw,
 				     btf__name_by_offset(d->btf,
 							 enums[i].name_off));
@@ -178,7 +179,10 @@ static int btf_dumper_enum(const struct btf_dumper *d,
 		}
 	}
 
-	jsonw_int(d->jw, value);
+	if (is_signed)
+		jsonw_int(d->jw, (__s64)value);
+	else
+		jsonw_uint(d->jw, value);
 	return 0;
 }
 
@@ -204,7 +208,10 @@ static int btf_dumper_enum64(const struct btf_dumper *d,
 		}
 	}
 
-	jsonw_int(d->jw, value);
+	if (btf_kflag(t))
+		jsonw_int(d->jw, (__s64)value);
+	else
+		jsonw_uint(d->jw, value);
 	return 0;
 }
 
diff --git a/tools/lib/bpf/btf.h b/tools/lib/bpf/btf.h
index 57f12630c5d155..d74c92056f0ff5 100644
--- a/tools/lib/bpf/btf.h
+++ b/tools/lib/bpf/btf.h
@@ -636,6 +636,12 @@ static inline struct btf_enum *btf_enum(const struct btf_type *t)
 	return (struct btf_enum *)(t + 1);
 }
 
+/* btf_enum->val is signed even for unsigned enums; kflag records the sign. */
+static inline __u64 btf_enum_value(const struct btf_type *t, const struct btf_enum *e)
+{
+	return btf_kflag(t) ? (__s64)e->val : (__u32)e->val;
+}
+
 struct btf_enum64;
 
 static inline struct btf_enum64 *btf_enum64(const struct btf_type *t)
diff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c
index fcd97aa9058976..602664a6adef0b 100644
--- a/tools/lib/bpf/btf_dump.c
+++ b/tools/lib/bpf/btf_dump.c
@@ -2378,7 +2378,7 @@ static int btf_dump_enum_data(struct btf_dump *d,
 		const struct btf_enum *e;
 
 		for (i = 0, e = btf_enum(t); i < btf_vlen(t); i++, e++) {
-			if (value != e->val)
+			if ((__u64)value != btf_enum_value(t, e))
 				continue;
 			btf_dump_type_values(d, "%s", btf_name_of(d, e->name_off));
 			return 0;
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 0e2a93a42908e3..44134421bd7db4 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -2650,7 +2650,7 @@ static bool get_map_field_long(const char *map_name, const struct btf *btf,
 	if (btf_is_enum(t)) {
 		const struct btf_enum *e = btf_enum(t);
 
-		*res = e->val;
+		*res = btf_enum_value(t, e);
 	} else {
 		const struct btf_enum64 *e = btf_enum64(t);
 
diff --git a/tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c b/tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c
index 187b3f7843079c..a9584c83023cbe 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpftool_map_dump.c
@@ -7,6 +7,7 @@
 
 #define PIN_PATH	"/sys/fs/bpf/test_bpftool_map_dump_sk_storage"
 #define QUEUE_PIN_PATH	"/sys/fs/bpf/test_bpftool_map_dump_queue"
+#define ENUM_PIN_PATH	"/sys/fs/bpf/test_bpftool_map_dump_enum"
 #define JSON_ERROR	"{\"error\":\"can't dump sk_storage map"
 
 /* An empty socket storage map with an int value. */
@@ -124,10 +125,85 @@ static void test_queue(void)
 	close(map_fd);
 }
 
+struct enums {
+	__u8 u8_name;
+	__s8 s8_name;
+	__u32 u32_num;
+	__u64 u64_num;
+};
+
+/* An array map. Its value is struct enums with an enum behind every member. */
+static int create_enum_map(void)
+{
+	LIBBPF_OPTS(bpf_map_create_opts, opts);
+	struct btf *btf;
+	int fd = -1;
+
+	btf = btf__new_empty();
+	if (!ASSERT_OK_PTR(btf, "btf__new_empty"))
+		return -1;
+
+	btf__add_int(btf, "int", 4, BTF_INT_SIGNED);	/* [1] */
+	btf__add_enum(btf, "u8", 1);			/* [2] */
+	btf__add_enum_value(btf, "U8_MAX", 0xff);
+	btf__add_enum(btf, "s8", 1);			/* [3] */
+	btf__add_enum_value(btf, "S8_NEG", -1);
+	btf__add_enum(btf, "u32", 4);			/* [4] */
+	btf__add_enum_value(btf, "U32_ONE", 1);
+	btf__add_enum64(btf, "u64", 8, false);		/* [5] */
+	btf__add_enum64_value(btf, "U64_ONE", 1);
+	btf__add_struct(btf, "enums", sizeof(struct enums)); /* [6] */
+	btf__add_field(btf, "u8_name", 2, 0, 0);
+	btf__add_field(btf, "s8_name", 3, 8, 0);
+	btf__add_field(btf, "u32_num", 4, 32, 0);
+	btf__add_field(btf, "u64_num", 5, 64, 0);
+	if (!ASSERT_OK(btf__load_into_kernel(btf), "btf__load_into_kernel"))
+		goto out;
+
+	opts.btf_fd = btf__fd(btf);
+	opts.btf_key_type_id = 1;
+	opts.btf_value_type_id = 6;
+	fd = bpf_map_create(BPF_MAP_TYPE_ARRAY, "enums", sizeof(int),
+			    sizeof(struct enums), 1, &opts);
+	ASSERT_OK_FD(fd, "bpf_map_create");
+out:
+	btf__free(btf);
+	return fd;
+}
+
+static void test_enum(void)
+{
+	struct enums value = { 0xff, -1, (__u32)-22, (1ULL << 63) | 1 };
+	char output[1024] = {};
+	int map_fd, key = 0, ret;
+
+	map_fd = create_enum_map();
+	if (map_fd < 0)
+		return;
+	if (!ASSERT_OK(bpf_map_update_elem(map_fd, &key, &value, BPF_ANY),
+		       "update map"))
+		goto out;
+	if (!ASSERT_OK(bpf_obj_pin(map_fd, ENUM_PIN_PATH), "pin map"))
+		goto out;
+
+	ret = get_bpftool_command_output("-j map dump pinned " ENUM_PIN_PATH,
+					 output, sizeof(output));
+	ASSERT_OK(ret, "json dump");
+	ASSERT_HAS_SUBSTR(output,
+			  "{\"u8_name\":\"U8_MAX\",\"s8_name\":\"S8_NEG\","
+			  "\"u32_num\":4294967274,\"u64_num\":9223372036854775809}",
+			  "enum values");
+out:
+	unlink(ENUM_PIN_PATH);
+	close(map_fd);
+}
+
 void test_bpftool_map_dump(void)
 {
 	if (test__start_subtest("sk_storage"))
 		test_sk_storage();
 	if (test__start_subtest("queue"))
 		test_queue();
+	if (test__start_subtest("enum"))
+		test_enum();
 }
diff --git a/tools/testing/selftests/bpf/prog_tests/btf_dump.c b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
index bfa74db179871f..b5c90f7293398f 100644
--- a/tools/testing/selftests/bpf/prog_tests/btf_dump.c
+++ b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
@@ -944,6 +944,9 @@ static void test_btf_dump_typedef_data(struct btf *btf, struct btf_dump *d,
 static void test_btf_dump_enum_data(struct btf *btf, struct btf_dump *d,
 				    char *str)
 {
+	__u32 high = 0x80000000;
+	__s32 neg = -1;
+
 	/* enum where enum value does (and does not) exist */
 	TEST_BTF_DUMP_DATA_C(btf, d, "enum", str, enum bpf_cmd, BTF_F_COMPACT,
 			     BPF_MAP_CREATE);
@@ -975,6 +978,23 @@ static void test_btf_dump_enum_data(struct btf *btf, struct btf_dump *d,
 
 	TEST_BTF_DUMP_DATA_OVER(btf, d, "enum", str, enum bpf_cmd,
 				sizeof(enum bpf_cmd) - 1, "", BPF_MAP_CREATE);
+
+	/* enumerators with bit 31 set in unsigned and in signed enum */
+	ASSERT_GT(btf__add_enum(btf, "test_enum_u32", 4), 0, "add unsigned enum");
+	ASSERT_OK(btf__add_enum_value(btf, "TEST_ENUM_HIGH", 0x80000000),
+		  "add TEST_ENUM_HIGH");
+	ASSERT_GT(btf__add_enum(btf, "test_enum_s32", 4), 0, "add signed enum");
+	ASSERT_OK(btf__add_enum_value(btf, "TEST_ENUM_NEG", -1), "add TEST_ENUM_NEG");
+
+	/* btf_dump__dump_type_data() doesn't resize 'd' for the new types */
+	d = btf_dump__new(btf, btf_dump_snprintf, str, NULL);
+	if (!ASSERT_OK_PTR(d, "btf_dump__new"))
+		return;
+	ASSERT_OK(btf_dump_data(btf, d, "test_enum_u32", NULL, 0, &high, 4, str,
+				"(enum test_enum_u32)TEST_ENUM_HIGH"), "dump unsigned enum");
+	ASSERT_OK(btf_dump_data(btf, d, "test_enum_s32", NULL, 0, &neg, 4, str,
+				"(enum test_enum_s32)TEST_ENUM_NEG"), "dump signed enum");
+	btf_dump__free(d);
 }
 
 static void test_btf_dump_struct_data(struct btf *btf, struct btf_dump *d,
diff --git a/tools/testing/selftests/bpf/prog_tests/map_extra.c b/tools/testing/selftests/bpf/prog_tests/map_extra.c
new file mode 100644
index 00000000000000..cbb1881ba693c5
--- /dev/null
+++ b/tools/testing/selftests/bpf/prog_tests/map_extra.c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <test_progs.h>
+#include "test_map_extra.skel.h"
+
+void test_map_extra(void)
+{
+	struct test_map_extra *skel;
+
+	if (!test__start_subtest("enum32_high"))
+		return;
+
+	skel = test_map_extra__open();
+	if (!ASSERT_OK_PTR(skel, "test_map_extra__open"))
+		return;
+
+	ASSERT_EQ(bpf_map__map_extra(skel->maps.arena), 0x80000000ULL,
+		  "map_extra");
+	test_map_extra__destroy(skel);
+}
diff --git a/tools/testing/selftests/bpf/progs/test_map_extra.c b/tools/testing/selftests/bpf/progs/test_map_extra.c
new file mode 100644
index 00000000000000..b6aa2341c11510
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/test_map_extra.c
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <linux/bpf.h>
+#include <bpf/bpf_helpers.h>
+
+struct {
+	__uint(type, BPF_MAP_TYPE_ARENA);
+	__uint(map_flags, BPF_F_MMAPABLE);
+	__uint(max_entries, 1);
+	__ulong(map_extra, 0x80000000U);
+} arena SEC(".maps");
+
+char LICENSE[] SEC("license") = "GPL";

3/2 2026/11/11 01:00 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 7361
							output: 20
							thoughts: 924
						

Thoughts:
**Fuzzing Evaluation: A Quick Decision**

Okay, so I need to decide if this patch is worth fuzzing with syzkaller. The first thing I'm doing is a thorough review of the modified files. Let's see... it's all in `tools/`: specifically, `tools/bpf/bpftool/*`, `tools/lib/bpf/*`, and `tools/testing/selftests/*`. That's *all* userspace stuff - a tool, a library, and tests.

Now, I need to consult the negative criteria. The rules state I should only mark it as *not* worth fuzzing if everything is non-kernel, non-executable changes. And bingo, the changes are to user-space directories, self-tests, and tools that don't touch the compiled kernel image (vmlinux) or modules.

Let me double-check. The provided diff confirms it. Just to be absolutely sure, I'll run a quick `git log -1 --stat` or verify it using grepper or read-file (although the diff here looks complete). 

Crucially, `tools/lib/bpf` *is* a user-space library. The kernel BTF implementation lives in `kernel/bpf/btf.c`, so there is no kernel code modification. Neither `bpftool` nor `libbpf` nor `selftests` are compiled into the kernel image or modules. I'll make absolutely sure no other files are touched by running a tool, as a final check.

Therefore, given my expert understanding of the kernel build system and fuzzing process, it's clear this patch doesn't warrant fuzzing.



4/2 2026/11/11 01:00 tool grepper
0m Args:
{
  "Expression": "btf_enum_value"
}

Results:
{
  "Output": "tools/bpf/bpftool/btf_dumper.c=147=static int btf_dumper_enum(const struct btf_dumper *d,\n--\ntools/bpf/bpftool/btf_dumper.c-173-\tfor (i = 0; i \u003c btf_vlen(t); i++) {\ntools/bpf/bpftool/btf_dumper.c:174:\t\tif (value == btf_enum_value(t, \u0026enums[i])) {\ntools/bpf/bpftool/btf_dumper.c-175-\t\t\tjsonw_string(d-\u003ejw,\n--\ntools/lib/bpf/btf.h=634=static inline struct btf_enum *btf_enum(const struct btf_type *t)\n--\ntools/lib/bpf/btf.h-639-/* btf_enum-\u003eval is signed even for unsigned enums; kflag records the sign. */\ntools/lib/bpf/btf.h:640:static inline __u64 btf_enum_value(const struct btf_type *t, const struct btf_enum *e)\ntools/lib/bpf/btf.h-641-{\n--\ntools/lib/bpf/btf_dump.c=2363=static int btf_dump_enum_data(struct btf_dump *d,\n--\ntools/lib/bpf/btf_dump.c-2380-\t\tfor (i = 0, e = btf_enum(t); i \u003c btf_vlen(t); i++, e++) {\ntools/lib/bpf/btf_dump.c:2381:\t\t\tif ((__u64)value != btf_enum_value(t, e))\ntools/lib/bpf/btf_dump.c-2382-\t\t\t\tcontinue;\n--\ntools/lib/bpf/libbpf.c=2622=static bool get_map_field_long(const char *map_name, const struct btf *btf,\n--\ntools/lib/bpf/libbpf.c-2652-\ntools/lib/bpf/libbpf.c:2653:\t\t*res = btf_enum_value(t, e);\ntools/lib/bpf/libbpf.c-2654-\t} else {\n"
}

5/2 2026/11/11 01:00 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 9271
							output: 90
							thoughts: 370
						

Thoughts:
**Analysis of the Patch for Fuzzing Relevance**

Okay, let's break this down. My initial assessment is that `btf_enum_value` appears solely within the `tools/` directory – specifically in `tools/bpf/bpftool/btf_dumper.c`, `tools/lib/bpf/btf.h`, `tools/lib/bpf/btf_dump.c`, and `tools/lib/bpf/libbpf.c`. All the modifications are confined to this `tools/` directory.

Now, according to the fuzzing guidelines (Section 2, I believe), a "WorthFuzzing=false" result is justified *only* if *all* modified code fits neatly into one or more very specific categories. The relevant category here concerns non-kernel and non-executable changes: this covers modifications to things like Documentation, comments, and spelling corrections. Additionally, changes to user-space tools, self-tests, samples, or scripts (directories like `tools/`, `samples/`, `scripts/`, `usr/`) that *do not* impact the compiled kernel image (`vmlinux`) or kernel modules are also exempted.

Given my understanding, all files affected by this patch are within the `tools/` directory. They're related to `tools/bpf/bpftool`, `tools/lib/bpf`, and `tools/testing/selftests/bpf` specifically. These are user-space utilities, libraries, and selftests, and importantly, *they don't influence* the compiled kernel image (`vmlinux`) or any kernel modules. Therefore, this patch is a clear "WorthFuzzing: false" case.

Consequently, there's no need to identify any specific symbols to focus on or enable any particular kernel configurations. My reasoning is concise: All changes are isolated within the user-space `tools/` directory, specifically `tools/bpf/bpftool`, `tools/lib/bpf`, and `tools/testing/selftests/bpf`, which are separate from the kernel image and modules.

Okay, let's call `set-results` with this determination.



6/2 2026/11/11 01:00 tool set-results
0m Args:
{
  "EnableConfigs": [],
  "FocusSymbols": [],
  "Reasoning": "All changes in this patch series are strictly confined to user-space directories under tools/ (bpftool, libbpf, and bpf selftests). They do not modify the Linux kernel image (vmlinux) or any kernel modules, making syzkaller fuzzing inapplicable.",
  "WorthFuzzing": false
}

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "All changes in this patch series are strictly confined to user-space directories under tools/ (bpftool, libbpf, and bpf selftests). They do not modify the Linux kernel image (vmlinux) or any kernel modules, making syzkaller fuzzing inapplicable.",
  "WorthFuzzing": false
}

7/1 2026/11/11 01:00 action If
0m Args:
{
  "WorthFuzzing": false
}

Results:
null

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)