| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/10/08 16:38 | flow | patch-triage |
5mArgs:null Results: {
"EnableConfigs": [
"BPF_SYSCALL"
],
"FocusSymbols": [
"bpf_percpu_array_update",
"bpf_percpu_hash_update",
"htab_percpu_map_update_elem",
"htab_lru_percpu_map_update_elem",
"__htab_lru_percpu_map_update_elem",
"htab_map_update_elem_in_place"
],
"KMSANReasoning": "The patch modifies flag validation logic in the BPF subsystem (specifically in `bpf_percpu_array_update`, `check_flags`, `htab_map_check_update_flags`, and `__htab_lru_percpu_map_update_elem`) to properly handle bitwise combinations of element existence flags (`BPF_EXIST`, `BPF_NOEXIST`) and per-CPU flags (`BPF_F_CPU`, `BPF_F_ALL_CPUS`), while rejecting mutually exclusive combinations (such as `BPF_EXIST | BPF_NOEXIST`).\n\nNone of the changes introduce or expose uninitialized memory risks:\n1. No kernel structures or data buffers are returned or copied to userspace in these paths; they are strictly map update paths.\n2. The conditional logic evaluates `map_flags`, which is passed from the validated syscall attributes (`union bpf_attr`).\n3. Map values in per-CPU hash maps continue to be properly initialized via `pcpu_init_value()` (which zero-initializes non-target CPUs via `zero_map_value()`), and per-CPU array maps are preallocated with zeroed memory.\n4. No bounds calculations or buffer length checks are altered in a way that could allow uninitialized memory reads.\n\nAny potential bugs related to flag handling, incorrect CPU indexing, or pointer offsets would be caught by standard bug detectors and KASAN (e.g. out-of-bounds accesses). Therefore, a dedicated KMSAN fuzzing session is not justified.",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies flag validation and lookup/update logic for BPF per-CPU array and hash maps (allowing valid combinations of BPF_NOEXIST/BPF_EXIST with BPF_F_CPU/BPF_F_ALL_CPUS). This touches reachable core BPF map manipulation paths via the bpf(BPF_MAP_UPDATE_ELEM) syscall and in-kernel BPF map helper calls, making it well-suited for fuzzing to detect regressions or corner-case state inconsistencies.",
"WorthFuzzing": true
} |
| 1/1 | 2026/10/08 16:38 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit a6abfc52d391a674de7e0cb3eb86cb8ede66ab71\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Thu Oct 8 16:38:23 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/include/linux/bpf.h b/include/linux/bpf.h\nindex 0ecb9418dfbd6..29d571e722da7 100644\n--- a/include/linux/bpf.h\n+++ b/include/linux/bpf.h\n@@ -4228,6 +4228,9 @@ static inline bool bpf_map_is_percpu_map(enum bpf_map_type map_type)\n \t}\n }\n \n+#define BPF_EXIST_FLAGS\t\t(BPF_EXIST | BPF_NOEXIST)\n+#define BPF_CPU_FLAGS\t\t(BPF_F_CPU | BPF_F_ALL_CPUS)\n+\n static inline int bpf_map_check_op_flags(struct bpf_map *map, u64 flags, u64 allowed_flags)\n {\n \tu32 cpu;\ndiff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c\nindex 0ce26b538075e..d76d5f202a8c0 100644\n--- a/kernel/bpf/arraymap.c\n+++ b/kernel/bpf/arraymap.c\n@@ -438,15 +438,15 @@ int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value,\n \tu32 size;\n \tint cpu, off = 0;\n \n-\tif (unlikely((map_flags \u0026 BPF_F_LOCK) || (u32)map_flags \u003e BPF_F_ALL_CPUS))\n-\t\t/* unknown flags */\n+\tif (unlikely(((map_flags \u0026 BPF_EXIST_FLAGS) == BPF_EXIST_FLAGS) ||\n+\t\t ((u32)map_flags \u0026 ~(BPF_EXIST_FLAGS | BPF_CPU_FLAGS))))\n \t\treturn -EINVAL;\n \n \tif (unlikely(index \u003e= array-\u003emap.max_entries))\n \t\t/* all elements were pre-allocated, cannot insert a new one */\n \t\treturn -E2BIG;\n \n-\tif (unlikely(map_flags == BPF_NOEXIST))\n+\tif (unlikely(map_flags \u0026 BPF_NOEXIST))\n \t\t/* all elements already exist */\n \t\treturn -EEXIST;\n \ndiff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c\nindex 13a2356c84cf9..62b630bb863ff 100644\n--- a/kernel/bpf/hashtab.c\n+++ b/kernel/bpf/hashtab.c\n@@ -1180,11 +1180,11 @@ static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key,\n static int check_flags(struct bpf_htab *htab, struct htab_elem *l_old,\n \t\t u64 map_flags)\n {\n-\tif (l_old \u0026\u0026 (map_flags \u0026 ~BPF_F_LOCK) == BPF_NOEXIST)\n+\tif (l_old \u0026\u0026 (map_flags \u0026 BPF_NOEXIST))\n \t\t/* elem already exists */\n \t\treturn -EEXIST;\n \n-\tif (!l_old \u0026\u0026 (map_flags \u0026 ~BPF_F_LOCK) == BPF_EXIST)\n+\tif (!l_old \u0026\u0026 (map_flags \u0026 BPF_EXIST))\n \t\t/* elem doesn't exist, cannot update it */\n \t\treturn -ENOENT;\n \n@@ -1367,9 +1367,11 @@ static long htab_lru_map_update_elem(struct bpf_map *map, void *key, void *value\n \n static int htab_map_check_update_flags(bool onallcpus, u64 map_flags)\n {\n+\tif (unlikely((map_flags \u0026 BPF_EXIST_FLAGS) == BPF_EXIST_FLAGS))\n+\t\treturn -EINVAL;\n \tif (unlikely(!onallcpus \u0026\u0026 map_flags \u003e BPF_EXIST))\n \t\treturn -EINVAL;\n-\tif (unlikely(onallcpus \u0026\u0026 ((map_flags \u0026 BPF_F_LOCK) || (u32)map_flags \u003e BPF_F_ALL_CPUS)))\n+\tif (unlikely(onallcpus \u0026\u0026 ((u32)map_flags \u0026 ~(BPF_EXIST_FLAGS | BPF_CPU_FLAGS))))\n \t\treturn -EINVAL;\n \treturn 0;\n }\n@@ -1467,7 +1469,7 @@ static long __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\n \t * to remove older elem from htab and this removal\n \t * operation will need a bucket lock.\n \t */\n-\tif (map_flags != BPF_EXIST) {\n+\tif (!(map_flags \u0026 BPF_EXIST)) {\n \t\tl_new = prealloc_lru_pop(htab, key, hash);\n \t\tif (!l_new)\n \t\t\treturn -ENOMEM;\ndiff --git a/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c b/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c\nindex 7b4a1e24363b5..67124dd4d8a78 100644\n--- a/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c\n+++ b/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c\n@@ -449,6 +449,95 @@ static void test_lru_percpu_hash_cpu_flag_create(void)\n \ttest_percpu_map_cpu_flag_create(BPF_MAP_TYPE_LRU_PERCPU_HASH, 0);\n }\n \n+static bool verify_map_value_all_cpus(int map_fd, void *key, void *values, size_t elem_sz,\n+\t\t\t\t u32 expected_value, int nr_cpus)\n+{\n+\tint i, err;\n+\n+\terr = bpf_map_lookup_elem(map_fd, key, values);\n+\tif (!ASSERT_OK(err, \"bpf_map_lookup_elem all_cpus\"))\n+\t\treturn false;\n+\n+\tfor (i = 0 ; i \u003c nr_cpus ; i++) {\n+\t\tif (!ASSERT_EQ(*(u32 *)(values + elem_sz * i), expected_value,\n+\t\t\t \"bpf_map_lookup_elem value all_cpus\"))\n+\t\t\treturn false;\n+\t}\n+\n+\treturn true;\n+}\n+\n+static bool verify_map_value_first_cpu(int map_fd, void *key, void *values, size_t elem_sz,\n+\t\t\t\t u32 expected_value, int nr_cpus)\n+{\n+\tint i, err;\n+\n+\terr = bpf_map_lookup_elem(map_fd, key, values);\n+\tif (!ASSERT_OK(err, \"bpf_map_lookup_elem cpu\"))\n+\t\treturn false;\n+\n+\tif (!ASSERT_EQ(*(u32 *)values, expected_value, \"bpf_map_lookup_elem value cpu\"))\n+\t\treturn false;\n+\n+\tfor (i = 1 ; i \u003c nr_cpus ; i++) {\n+\t\tif (!ASSERT_NEQ(*(u32 *)(values + elem_sz * i), expected_value,\n+\t\t\t\t\"bpf_map_lookup_elem value cpu\"))\n+\t\t\treturn false;\n+\t}\n+\n+\treturn true;\n+}\n+\n+static void test_percpu_cgroup_storage_flags_combination(struct bpf_map *map, int nr_cpus,\n+\t\t\t\t\t\t\t struct bpf_cgroup_storage_key *key)\n+{\n+\tsize_t value_sz = sizeof(u32), key_sz, elem_sz;\n+\tu32 *values, test_value = 0xAABBCCDD;\n+\tint err, map_fd;\n+\tu64 flags;\n+\n+\tkey_sz = sizeof(*key);\n+\telem_sz = roundup(value_sz, 8);\n+\tmap_fd = bpf_map__fd(map);\n+\tvalues = calloc(nr_cpus, elem_sz);\n+\tif (!ASSERT_OK_PTR(values, \"calloc values\"))\n+\t\treturn;\n+\n+\tflags = BPF_NOEXIST | BPF_EXIST;\n+\terr = bpf_map__update_elem(map, key, key_sz, values, elem_sz * nr_cpus, flags);\n+\tif (!ASSERT_EQ(err, -EINVAL, \"bpf_map__update_elem noexist|exist\"))\n+\t\tgoto out;\n+\n+\tflags = BPF_F_ALL_CPUS | BPF_NOEXIST;\n+\terr = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);\n+\tif (!ASSERT_EQ(err, -EINVAL, \"bpf_map__update_elem all_cpus|noexist\"))\n+\t\tgoto out;\n+\n+\tflags = BPF_F_CPU | BPF_NOEXIST;\n+\terr = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);\n+\tif (!ASSERT_EQ(err, -EINVAL, \"bpf_map__update_elem cpu|noexist\"))\n+\t\tgoto out;\n+\n+\tflags = BPF_F_ALL_CPUS | BPF_EXIST;\n+\tvalues[0] = test_value;\n+\terr = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);\n+\tif (!ASSERT_OK(err, \"bpf_map__update_elem all_cpus|exist\"))\n+\t\tgoto out;\n+\n+\tif (!verify_map_value_all_cpus(map_fd, key, values, elem_sz, test_value, nr_cpus))\n+\t\tgoto out;\n+\n+\tflags = BPF_F_CPU | BPF_EXIST;\n+\tvalues[0] = --test_value;\n+\terr = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);\n+\tif (!ASSERT_OK(err, \"bpf_map__update_elem cpu|exist\"))\n+\t\tgoto out;\n+\n+\tverify_map_value_first_cpu(map_fd, key, values, elem_sz, test_value, nr_cpus);\n+out:\n+\tfree(values);\n+}\n+\n static void test_percpu_cgroup_storage_cpu_flag(void)\n {\n \tstruct percpu_alloc_array *skel = NULL;\n@@ -489,6 +578,7 @@ static void test_percpu_cgroup_storage_cpu_flag(void)\n \t\tgoto out;\n \n \ttest_percpu_map_op_cpu_flag(map, \u0026key, sizeof(key), 1, nr_cpus, false);\n+\ttest_percpu_cgroup_storage_flags_combination(map, nr_cpus, \u0026key);\n out:\n \tbpf_prog_detach2(-1, cgroup, BPF_CGROUP_INET_EGRESS);\n \tclose(cgroup);\n@@ -537,6 +627,164 @@ static void test_hash_cpu_flag(void)\n \ttest_map_op_cpu_flag(BPF_MAP_TYPE_HASH);\n }\n \n+static void test_percpu_map_flags_combination(enum bpf_map_type map_type)\n+{\n+\tu32 max_entries = 3, key = 0, first_value = 0xAABBCCDD, test_value = first_value;\n+\tsize_t value_sz = sizeof(u32), elem_sz;\n+\tint err, map_fd, nr_cpus;\n+\tbool is_hash_map;\n+\tu32 *values;\n+\tu64 flags;\n+\n+\tis_hash_map = (map_type == BPF_MAP_TYPE_PERCPU_HASH ||\n+\t\t map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH);\n+\tnr_cpus = libbpf_num_possible_cpus();\n+\tif (!ASSERT_GT(nr_cpus, 0, \"libbpf_num_possible_cpus\"))\n+\t\treturn;\n+\n+\telem_sz = roundup(value_sz, 8);\n+\tvalues = calloc(nr_cpus, elem_sz);\n+\tif (!ASSERT_OK_PTR(values, \"calloc values\"))\n+\t\treturn;\n+\n+\tmap_fd = bpf_map_create(map_type, \"test_flags_combination_map\",\n+\t\t\t\tsizeof(u32), value_sz, max_entries, NULL);\n+\tif (!ASSERT_GE(map_fd, 0, \"bpf_map_create\")) {\n+\t\tfree(values);\n+\t\treturn;\n+\t}\n+\n+\tflags = BPF_NOEXIST | BPF_EXIST;\n+\terr = bpf_map_update_elem(map_fd, \u0026key, values, flags);\n+\tif (!ASSERT_EQ(err, -EINVAL, \"bpf_map_update_elem noexist|exist\"))\n+\t\tgoto out;\n+\n+\tflags = BPF_F_ALL_CPUS | BPF_NOEXIST;\n+\tvalues[0] = test_value;\n+\tkey = 0;\n+\terr = bpf_map_update_elem(map_fd, \u0026key, values, flags);\n+\tif (is_hash_map) {\n+\t\tif (!ASSERT_OK(err, \"bpf_map_update_elem all_cpus|noexist\"))\n+\t\t\tgoto out;\n+\n+\t\tif (!verify_map_value_all_cpus(map_fd, \u0026key, values, elem_sz, test_value, nr_cpus))\n+\t\t\tgoto out;\n+\n+\t\terr = bpf_map_update_elem(map_fd, \u0026key, values, flags);\n+\t}\n+\tif (!ASSERT_EQ(err, -EEXIST, \"bpf_map_update_elem all_cpus|noexist\"))\n+\t\tgoto out;\n+\n+\tflags = BPF_F_CPU | BPF_NOEXIST;\n+\tvalues[0] = --test_value;\n+\tkey = 1;\n+\terr = bpf_map_update_elem(map_fd, \u0026key, values, flags);\n+\tif (is_hash_map) {\n+\t\tif (!ASSERT_OK(err, \"bpf_map_update_elem cpu|noexist\"))\n+\t\t\tgoto out;\n+\n+\t\tif (!verify_map_value_first_cpu(map_fd, \u0026key, values, elem_sz, test_value, nr_cpus))\n+\t\t\tgoto out;\n+\n+\t\terr = bpf_map_update_elem(map_fd, \u0026key, values, flags);\n+\t}\n+\tif (!ASSERT_EQ(err, -EEXIST, \"bpf_map_update_elem cpu|noexist\"))\n+\t\tgoto out;\n+\n+\tflags = BPF_F_ALL_CPUS | BPF_EXIST;\n+\tvalues[0] = --test_value;\n+\tkey = 2;\n+\terr = bpf_map_update_elem(map_fd, \u0026key, values, flags);\n+\tif (is_hash_map) {\n+\t\tif (!ASSERT_EQ(err, -ENOENT, \"bpf_map_update_elem all_cpus|exist\"))\n+\t\t\tgoto out;\n+\t} else {\n+\t\tif (!ASSERT_OK(err, \"bpf_map_update_elem all_cpus|exist\"))\n+\t\t\tgoto out;\n+\n+\t\tif (!verify_map_value_all_cpus(map_fd, \u0026key, values, elem_sz, test_value, nr_cpus))\n+\t\t\tgoto out;\n+\t}\n+\n+\tflags = BPF_F_CPU | BPF_EXIST;\n+\tvalues[0] = --test_value;\n+\terr = bpf_map_update_elem(map_fd, \u0026key, values, flags);\n+\tif (is_hash_map) {\n+\t\tif (!ASSERT_EQ(err, -ENOENT, \"bpf_map_update_elem cpu|exist\"))\n+\t\t\tgoto out;\n+\t} else {\n+\t\tif (!ASSERT_OK(err, \"bpf_map_update_elem cpu|exist\"))\n+\t\t\tgoto out;\n+\n+\t\tif (!verify_map_value_first_cpu(map_fd, \u0026key, values, elem_sz, test_value, nr_cpus))\n+\t\t\tgoto out;\n+\t}\n+\n+\tif (map_type != BPF_MAP_TYPE_LRU_PERCPU_HASH)\n+\t\tgoto out;\n+\n+\t/* Percpu LRU hash map should not delete old entries unnecessarily */\n+\tflags = BPF_F_ALL_CPUS | BPF_NOEXIST;\n+\tkey = 2;\n+\terr = bpf_map_update_elem(map_fd, \u0026key, values, flags);\n+\tif (!ASSERT_OK(err, \"bpf_map_update_elem lru_percpu_hash all_cpus|noexist\"))\n+\t\tgoto out;\n+\n+\tflags = BPF_F_ALL_CPUS | BPF_EXIST;\n+\terr = bpf_map_update_elem(map_fd, \u0026key, values, flags);\n+\tif (!ASSERT_OK(err, \"bpf_map_update_elem lru_percpu_hash all_cpus|exist\"))\n+\t\tgoto out;\n+\n+\tkey = 0;\n+\tverify_map_value_all_cpus(map_fd, \u0026key, values, elem_sz, first_value, nr_cpus);\n+\n+out:\n+\tclose(map_fd);\n+\tfree(values);\n+}\n+\n+static bool pin_current_cpu(cpu_set_t *old_mask)\n+{\n+\tcpu_set_t new_mask;\n+\tint err, cpu;\n+\n+\terr = sched_getaffinity(0, sizeof(*old_mask), old_mask);\n+\tif (!ASSERT_OK(err, \"sched_getaffinity\"))\n+\t\treturn false;\n+\n+\tcpu = sched_getcpu();\n+\tif (!ASSERT_GE(cpu, 0, \"sched_getcpu\"))\n+\t\treturn false;\n+\n+\tCPU_ZERO(\u0026new_mask);\n+\tCPU_SET(cpu, \u0026new_mask);\n+\n+\terr = sched_setaffinity(0, sizeof(new_mask), \u0026new_mask);\n+\treturn ASSERT_OK(err, \"sched_setaffinity\");\n+}\n+\n+static void test_percpu_hash_flags_combination(void)\n+{\n+\ttest_percpu_map_flags_combination(BPF_MAP_TYPE_PERCPU_HASH);\n+}\n+\n+static void test_lru_percpu_hash_flags_combination(void)\n+{\n+\tcpu_set_t old_mask;\n+\n+\tif (!pin_current_cpu(\u0026old_mask))\n+\t\treturn;\n+\n+\ttest_percpu_map_flags_combination(BPF_MAP_TYPE_LRU_PERCPU_HASH);\n+\n+\tsched_setaffinity(0, sizeof(old_mask), \u0026old_mask);\n+}\n+\n+static void test_percpu_array_flags_combination(void)\n+{\n+\ttest_percpu_map_flags_combination(BPF_MAP_TYPE_PERCPU_ARRAY);\n+}\n+\n void test_percpu_alloc(void)\n {\n \tif (test__start_subtest(\"array\"))\n@@ -565,4 +813,10 @@ void test_percpu_alloc(void)\n \t\ttest_array_cpu_flag();\n \tif (test__start_subtest(\"cpu_flag_hash\"))\n \t\ttest_hash_cpu_flag();\n+\tif (test__start_subtest(\"cpu_flag_combination_percpu_hash\"))\n+\t\ttest_percpu_hash_flags_combination();\n+\tif (test__start_subtest(\"cpu_flag_combination_lru_percpu_hash\"))\n+\t\ttest_lru_percpu_hash_flags_combination();\n+\tif (test__start_subtest(\"cpu_flag_combination_percpu_array\"))\n+\t\ttest_percpu_array_flags_combination();\n }\n"
} |
| 2/1 | 2026/10/08 16:38 | agent | patch-evaluator |
2mModel:core Args: null Results: {
"EnableConfigs": [
"BPF_SYSCALL"
],
"FocusSymbols": [
"bpf_percpu_array_update",
"bpf_percpu_hash_update",
"htab_percpu_map_update_elem",
"htab_lru_percpu_map_update_elem",
"__htab_lru_percpu_map_update_elem",
"htab_map_update_elem_in_place"
],
"Reasoning": "The patch modifies flag validation and lookup/update logic for BPF per-CPU array and hash maps (allowing valid combinations of BPF_NOEXIST/BPF_EXIST with BPF_F_CPU/BPF_F_ALL_CPUS). This touches reachable core BPF map manipulation paths via the bpf(BPF_MAP_UPDATE_ELEM) syscall and in-kernel BPF map helper calls, making it well-suited for fuzzing to detect regressions or corner-case state inconsistencies.",
"WorthFuzzing": true
}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 a6abfc52d391a674de7e0cb3eb86cb8ede66ab71
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Oct 8 16:38:23 2026 +0000
syz-cluster: applied patch under review
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 0ecb9418dfbd6..29d571e722da7 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -4228,6 +4228,9 @@ static inline bool bpf_map_is_percpu_map(enum bpf_map_type map_type)
}
}
+#define BPF_EXIST_FLAGS (BPF_EXIST | BPF_NOEXIST)
+#define BPF_CPU_FLAGS (BPF_F_CPU | BPF_F_ALL_CPUS)
+
static inline int bpf_map_check_op_flags(struct bpf_map *map, u64 flags, u64 allowed_flags)
{
u32 cpu;
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index 0ce26b538075e..d76d5f202a8c0 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -438,15 +438,15 @@ int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value,
u32 size;
int cpu, off = 0;
- if (unlikely((map_flags & BPF_F_LOCK) || (u32)map_flags > BPF_F_ALL_CPUS))
- /* unknown flags */
+ if (unlikely(((map_flags & BPF_EXIST_FLAGS) == BPF_EXIST_FLAGS) ||
+ ((u32)map_flags & ~(BPF_EXIST_FLAGS | BPF_CPU_FLAGS))))
return -EINVAL;
if (unlikely(index >= array->map.max_entries))
/* all elements were pre-allocated, cannot insert a new one */
return -E2BIG;
- if (unlikely(map_flags == BPF_NOEXIST))
+ if (unlikely(map_flags & BPF_NOEXIST))
/* all elements already exist */
return -EEXIST;
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
index 13a2356c84cf9..62b630bb863ff 100644
--- a/kernel/bpf/hashtab.c
+++ b/kernel/bpf/hashtab.c
@@ -1180,11 +1180,11 @@ static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key,
static int check_flags(struct bpf_htab *htab, struct htab_elem *l_old,
u64 map_flags)
{
- if (l_old && (map_flags & ~BPF_F_LOCK) == BPF_NOEXIST)
+ if (l_old && (map_flags & BPF_NOEXIST))
/* elem already exists */
return -EEXIST;
- if (!l_old && (map_flags & ~BPF_F_LOCK) == BPF_EXIST)
+ if (!l_old && (map_flags & BPF_EXIST))
/* elem doesn't exist, cannot update it */
return -ENOENT;
@@ -1367,9 +1367,11 @@ static long htab_lru_map_update_elem(struct bpf_map *map, void *key, void *value
static int htab_map_check_update_flags(bool onallcpus, u64 map_flags)
{
+ if (unlikely((map_flags & BPF_EXIST_FLAGS) == BPF_EXIST_FLAGS))
+ return -EINVAL;
if (unlikely(!onallcpus && map_flags > BPF_EXIST))
return -EINVAL;
- if (unlikely(onallcpus && ((map_flags & BPF_F_LOCK) || (u32)map_flags > BPF_F_ALL_CPUS)))
+ if (unlikely(onallcpus && ((u32)map_flags & ~(BPF_EXIST_FLAGS | BPF_CPU_FLAGS))))
return -EINVAL;
return 0;
}
@@ -1467,7 +1469,7 @@ static long __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,
* to remove older elem from htab and this removal
* operation will need a bucket lock.
*/
- if (map_flags != BPF_EXIST) {
+ if (!(map_flags & BPF_EXIST)) {
l_new = prealloc_lru_pop(htab, key, hash);
if (!l_new)
return -ENOMEM;
diff --git a/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c b/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c
index 7b4a1e24363b5..67124dd4d8a78 100644
--- a/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c
+++ b/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c
@@ -449,6 +449,95 @@ static void test_lru_percpu_hash_cpu_flag_create(void)
test_percpu_map_cpu_flag_create(BPF_MAP_TYPE_LRU_PERCPU_HASH, 0);
}
+static bool verify_map_value_all_cpus(int map_fd, void *key, void *values, size_t elem_sz,
+ u32 expected_value, int nr_cpus)
+{
+ int i, err;
+
+ err = bpf_map_lookup_elem(map_fd, key, values);
+ if (!ASSERT_OK(err, "bpf_map_lookup_elem all_cpus"))
+ return false;
+
+ for (i = 0 ; i < nr_cpus ; i++) {
+ if (!ASSERT_EQ(*(u32 *)(values + elem_sz * i), expected_value,
+ "bpf_map_lookup_elem value all_cpus"))
+ return false;
+ }
+
+ return true;
+}
+
+static bool verify_map_value_first_cpu(int map_fd, void *key, void *values, size_t elem_sz,
+ u32 expected_value, int nr_cpus)
+{
+ int i, err;
+
+ err = bpf_map_lookup_elem(map_fd, key, values);
+ if (!ASSERT_OK(err, "bpf_map_lookup_elem cpu"))
+ return false;
+
+ if (!ASSERT_EQ(*(u32 *)values, expected_value, "bpf_map_lookup_elem value cpu"))
+ return false;
+
+ for (i = 1 ; i < nr_cpus ; i++) {
+ if (!ASSERT_NEQ(*(u32 *)(values + elem_sz * i), expected_value,
+ "bpf_map_lookup_elem value cpu"))
+ return false;
+ }
+
+ return true;
+}
+
+static void test_percpu_cgroup_storage_flags_combination(struct bpf_map *map, int nr_cpus,
+ struct bpf_cgroup_storage_key *key)
+{
+ size_t value_sz = sizeof(u32), key_sz, elem_sz;
+ u32 *values, test_value = 0xAABBCCDD;
+ int err, map_fd;
+ u64 flags;
+
+ key_sz = sizeof(*key);
+ elem_sz = roundup(value_sz, 8);
+ map_fd = bpf_map__fd(map);
+ values = calloc(nr_cpus, elem_sz);
+ if (!ASSERT_OK_PTR(values, "calloc values"))
+ return;
+
+ flags = BPF_NOEXIST | BPF_EXIST;
+ err = bpf_map__update_elem(map, key, key_sz, values, elem_sz * nr_cpus, flags);
+ if (!ASSERT_EQ(err, -EINVAL, "bpf_map__update_elem noexist|exist"))
+ goto out;
+
+ flags = BPF_F_ALL_CPUS | BPF_NOEXIST;
+ err = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);
+ if (!ASSERT_EQ(err, -EINVAL, "bpf_map__update_elem all_cpus|noexist"))
+ goto out;
+
+ flags = BPF_F_CPU | BPF_NOEXIST;
+ err = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);
+ if (!ASSERT_EQ(err, -EINVAL, "bpf_map__update_elem cpu|noexist"))
+ goto out;
+
+ flags = BPF_F_ALL_CPUS | BPF_EXIST;
+ values[0] = test_value;
+ err = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);
+ if (!ASSERT_OK(err, "bpf_map__update_elem all_cpus|exist"))
+ goto out;
+
+ if (!verify_map_value_all_cpus(map_fd, key, values, elem_sz, test_value, nr_cpus))
+ goto out;
+
+ flags = BPF_F_CPU | BPF_EXIST;
+ values[0] = --test_value;
+ err = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);
+ if (!ASSERT_OK(err, "bpf_map__update_elem cpu|exist"))
+ goto out;
+
+ verify_map_value_first_cpu(map_fd, key, values, elem_sz, test_value, nr_cpus);
+out:
+ free(values);
+}
+
static void test_percpu_cgroup_storage_cpu_flag(void)
{
struct percpu_alloc_array *skel = NULL;
@@ -489,6 +578,7 @@ static void test_percpu_cgroup_storage_cpu_flag(void)
goto out;
test_percpu_map_op_cpu_flag(map, &key, sizeof(key), 1, nr_cpus, false);
+ test_percpu_cgroup_storage_flags_combination(map, nr_cpus, &key);
out:
bpf_prog_detach2(-1, cgroup, BPF_CGROUP_INET_EGRESS);
close(cgroup);
@@ -537,6 +627,164 @@ static void test_hash_cpu_flag(void)
test_map_op_cpu_flag(BPF_MAP_TYPE_HASH);
}
+static void test_percpu_map_flags_combination(enum bpf_map_type map_type)
+{
+ u32 max_entries = 3, key = 0, first_value = 0xAABBCCDD, test_value = first_value;
+ size_t value_sz = sizeof(u32), elem_sz;
+ int err, map_fd, nr_cpus;
+ bool is_hash_map;
+ u32 *values;
+ u64 flags;
+
+ is_hash_map = (map_type == BPF_MAP_TYPE_PERCPU_HASH ||
+ map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH);
+ nr_cpus = libbpf_num_possible_cpus();
+ if (!ASSERT_GT(nr_cpus, 0, "libbpf_num_possible_cpus"))
+ return;
+
+ elem_sz = roundup(value_sz, 8);
+ values = calloc(nr_cpus, elem_sz);
+ if (!ASSERT_OK_PTR(values, "calloc values"))
+ return;
+
+ map_fd = bpf_map_create(map_type, "test_flags_combination_map",
+ sizeof(u32), value_sz, max_entries, NULL);
+ if (!ASSERT_GE(map_fd, 0, "bpf_map_create")) {
+ free(values);
+ return;
+ }
+
+ flags = BPF_NOEXIST | BPF_EXIST;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (!ASSERT_EQ(err, -EINVAL, "bpf_map_update_elem noexist|exist"))
+ goto out;
+
+ flags = BPF_F_ALL_CPUS | BPF_NOEXIST;
+ values[0] = test_value;
+ key = 0;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (is_hash_map) {
+ if (!ASSERT_OK(err, "bpf_map_update_elem all_cpus|noexist"))
+ goto out;
+
+ if (!verify_map_value_all_cpus(map_fd, &key, values, elem_sz, test_value, nr_cpus))
+ goto out;
+
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ }
+ if (!ASSERT_EQ(err, -EEXIST, "bpf_map_update_elem all_cpus|noexist"))
+ goto out;
+
+ flags = BPF_F_CPU | BPF_NOEXIST;
+ values[0] = --test_value;
+ key = 1;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (is_hash_map) {
+ if (!ASSERT_OK(err, "bpf_map_update_elem cpu|noexist"))
+ goto out;
+
+ if (!verify_map_value_first_cpu(map_fd, &key, values, elem_sz, test_value, nr_cpus))
+ goto out;
+
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ }
+ if (!ASSERT_EQ(err, -EEXIST, "bpf_map_update_elem cpu|noexist"))
+ goto out;
+
+ flags = BPF_F_ALL_CPUS | BPF_EXIST;
+ values[0] = --test_value;
+ key = 2;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (is_hash_map) {
+ if (!ASSERT_EQ(err, -ENOENT, "bpf_map_update_elem all_cpus|exist"))
+ goto out;
+ } else {
+ if (!ASSERT_OK(err, "bpf_map_update_elem all_cpus|exist"))
+ goto out;
+
+ if (!verify_map_value_all_cpus(map_fd, &key, values, elem_sz, test_value, nr_cpus))
+ goto out;
+ }
+
+ flags = BPF_F_CPU | BPF_EXIST;
+ values[0] = --test_value;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (is_hash_map) {
+ if (!ASSERT_EQ(err, -ENOENT, "bpf_map_update_elem cpu|exist"))
+ goto out;
+ } else {
+ if (!ASSERT_OK(err, "bpf_map_update_elem cpu|exist"))
+ goto out;
+
+ if (!verify_map_value_first_cpu(map_fd, &key, values, elem_sz, test_value, nr_cpus))
+ goto out;
+ }
+
+ if (map_type != BPF_MAP_TYPE_LRU_PERCPU_HASH)
+ goto out;
+
+ /* Percpu LRU hash map should not delete old entries unnecessarily */
+ flags = BPF_F_ALL_CPUS | BPF_NOEXIST;
+ key = 2;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (!ASSERT_OK(err, "bpf_map_update_elem lru_percpu_hash all_cpus|noexist"))
+ goto out;
+
+ flags = BPF_F_ALL_CPUS | BPF_EXIST;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (!ASSERT_OK(err, "bpf_map_update_elem lru_percpu_hash all_cpus|exist"))
+ goto out;
+
+ key = 0;
+ verify_map_value_all_cpus(map_fd, &key, values, elem_sz, first_value, nr_cpus);
+
+out:
+ close(map_fd);
+ free(values);
+}
+
+static bool pin_current_cpu(cpu_set_t *old_mask)
+{
+ cpu_set_t new_mask;
+ int err, cpu;
+
+ err = sched_getaffinity(0, sizeof(*old_mask), old_mask);
+ if (!ASSERT_OK(err, "sched_getaffinity"))
+ return false;
+
+ cpu = sched_getcpu();
+ if (!ASSERT_GE(cpu, 0, "sched_getcpu"))
+ return false;
+
+ CPU_ZERO(&new_mask);
+ CPU_SET(cpu, &new_mask);
+
+ err = sched_setaffinity(0, sizeof(new_mask), &new_mask);
+ return ASSERT_OK(err, "sched_setaffinity");
+}
+
+static void test_percpu_hash_flags_combination(void)
+{
+ test_percpu_map_flags_combination(BPF_MAP_TYPE_PERCPU_HASH);
+}
+
+static void test_lru_percpu_hash_flags_combination(void)
+{
+ cpu_set_t old_mask;
+
+ if (!pin_current_cpu(&old_mask))
+ return;
+
+ test_percpu_map_flags_combination(BPF_MAP_TYPE_LRU_PERCPU_HASH);
+
+ sched_setaffinity(0, sizeof(old_mask), &old_mask);
+}
+
+static void test_percpu_array_flags_combination(void)
+{
+ test_percpu_map_flags_combination(BPF_MAP_TYPE_PERCPU_ARRAY);
+}
+
void test_percpu_alloc(void)
{
if (test__start_subtest("array"))
@@ -565,4 +813,10 @@ void test_percpu_alloc(void)
test_array_cpu_flag();
if (test__start_subtest("cpu_flag_hash"))
test_hash_cpu_flag();
+ if (test__start_subtest("cpu_flag_combination_percpu_hash"))
+ test_percpu_hash_flags_combination();
+ if (test__start_subtest("cpu_flag_combination_lru_percpu_hash"))
+ test_lru_percpu_hash_flags_combination();
+ if (test__start_subtest("cpu_flag_combination_percpu_array"))
+ test_percpu_array_flags_combination();
}
|
| 3/2 | 2026/10/08 16:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 7947 output: 39 thoughts: 901 |
| 4/2 | 2026/10/08 16:38 | tool | grepper |
0mArgs:{
"Expression": "bpf_percpu_array_update",
"PathPrefixes": [
"kernel/bpf/arraymap.c"
]
}Results: {
"Output": "kernel/bpf/arraymap.c=392=static long array_map_update_elem(struct bpf_map *map, void *key, void *value,\n--\nkernel/bpf/arraymap.c-430-\nkernel/bpf/arraymap.c:431:int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value,\nkernel/bpf/arraymap.c-432-\t\t\t u64 map_flags)\n"
} |
| 5/2 | 2026/10/08 16:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 9023 output: 37 thoughts: 52 |
| 6/2 | 2026/10/08 16:38 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/arraymap.c",
"FirstLine": 430,
"LineCount": 40
}Results: {
"Contents": " 430:\t\n 431:\tint bpf_percpu_array_update(struct bpf_map *map, void *key, void *value,\n 432:\t\t\t\t u64 map_flags)\n 433:\t{\n 434:\t\tstruct bpf_array *array = container_of(map, struct bpf_array, map);\n 435:\t\tu32 index = *(u32 *)key;\n 436:\t\tvoid __percpu *pptr;\n 437:\t\tvoid *ptr, *val;\n 438:\t\tu32 size;\n 439:\t\tint cpu, off = 0;\n 440:\t\n 441:\t\tif (unlikely(((map_flags \u0026 BPF_EXIST_FLAGS) == BPF_EXIST_FLAGS) ||\n 442:\t\t\t ((u32)map_flags \u0026 ~(BPF_EXIST_FLAGS | BPF_CPU_FLAGS))))\n 443:\t\t\treturn -EINVAL;\n 444:\t\n 445:\t\tif (unlikely(index \u003e= array-\u003emap.max_entries))\n 446:\t\t\t/* all elements were pre-allocated, cannot insert a new one */\n 447:\t\t\treturn -E2BIG;\n 448:\t\n 449:\t\tif (unlikely(map_flags \u0026 BPF_NOEXIST))\n 450:\t\t\t/* all elements already exist */\n 451:\t\t\treturn -EEXIST;\n 452:\t\n 453:\t\t/* the user space will provide round_up(value_size, 8) bytes that\n 454:\t\t * will be copied into per-cpu area. bpf programs can only access\n 455:\t\t * value_size of it. During lookup the same extra bytes will be\n 456:\t\t * returned or zeros which were zero-filled by percpu_alloc,\n 457:\t\t * so no kernel data leaks possible\n 458:\t\t */\n 459:\t\tsize = array-\u003eelem_size;\n 460:\t\trcu_read_lock();\n 461:\t\tpptr = array-\u003epptrs[index \u0026 array-\u003eindex_mask];\n 462:\t\tif (map_flags \u0026 BPF_F_CPU) {\n 463:\t\t\tcpu = map_flags \u003e\u003e 32;\n 464:\t\t\tptr = per_cpu_ptr(pptr, cpu);\n 465:\t\t\tcopy_map_value(map, ptr, value);\n 466:\t\t\tbpf_obj_cancel_fields(map, ptr);\n 467:\t\t\tgoto unlock;\n 468:\t\t}\n 469:\t\tfor_each_possible_cpu(cpu) {\n"
} |
| 7/2 | 2026/10/08 16:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 9800 output: 38 thoughts: 40 |
| 8/2 | 2026/10/08 16:39 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 1175,
"LineCount": 40
}Results: {
"Contents": "1175:\tdec_count:\n1176:\t\tdec_elem_count(htab);\n1177:\t\treturn l_new;\n1178:\t}\n1179:\t\n1180:\tstatic int check_flags(struct bpf_htab *htab, struct htab_elem *l_old,\n1181:\t\t\t u64 map_flags)\n1182:\t{\n1183:\t\tif (l_old \u0026\u0026 (map_flags \u0026 BPF_NOEXIST))\n1184:\t\t\t/* elem already exists */\n1185:\t\t\treturn -EEXIST;\n1186:\t\n1187:\t\tif (!l_old \u0026\u0026 (map_flags \u0026 BPF_EXIST))\n1188:\t\t\t/* elem doesn't exist, cannot update it */\n1189:\t\t\treturn -ENOENT;\n1190:\t\n1191:\t\treturn 0;\n1192:\t}\n1193:\t\n1194:\t/* Called from syscall or from eBPF program */\n1195:\tstatic long htab_map_update_elem(struct bpf_map *map, void *key, void *value,\n1196:\t\t\t\t\t u64 map_flags)\n1197:\t{\n1198:\t\tstruct bpf_htab *htab = container_of(map, struct bpf_htab, map);\n1199:\t\tstruct htab_elem *l_new, *l_old;\n1200:\t\tstruct hlist_nulls_head *head;\n1201:\t\tunsigned long flags;\n1202:\t\tstruct bucket *b;\n1203:\t\tu32 key_size, hash;\n1204:\t\tint ret;\n1205:\t\n1206:\t\tif (unlikely((map_flags \u0026 ~BPF_F_LOCK) \u003e BPF_EXIST))\n1207:\t\t\t/* unknown flags */\n1208:\t\t\treturn -EINVAL;\n1209:\t\n1210:\t\tWARN_ON_ONCE(!bpf_rcu_lock_held());\n1211:\t\n1212:\t\tkey_size = map-\u003ekey_size;\n1213:\t\n1214:\t\thash = htab_map_hash(key, key_size, htab-\u003ehashrnd);\n"
} |
| 9/2 | 2026/10/08 16:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10487 output: 38 thoughts: 27 |
| 10/2 | 2026/10/08 16:39 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 1360,
"LineCount": 80
}Results: {
"Contents": "1360:\t\tif (ret)\n1361:\t\t\thtab_lru_push_free(htab, l_new);\n1362:\t\telse if (l_old)\n1363:\t\t\thtab_lru_push_free(htab, l_old);\n1364:\t\n1365:\t\treturn ret;\n1366:\t}\n1367:\t\n1368:\tstatic int htab_map_check_update_flags(bool onallcpus, u64 map_flags)\n1369:\t{\n1370:\t\tif (unlikely((map_flags \u0026 BPF_EXIST_FLAGS) == BPF_EXIST_FLAGS))\n1371:\t\t\treturn -EINVAL;\n1372:\t\tif (unlikely(!onallcpus \u0026\u0026 map_flags \u003e BPF_EXIST))\n1373:\t\t\treturn -EINVAL;\n1374:\t\tif (unlikely(onallcpus \u0026\u0026 ((u32)map_flags \u0026 ~(BPF_EXIST_FLAGS | BPF_CPU_FLAGS))))\n1375:\t\t\treturn -EINVAL;\n1376:\t\treturn 0;\n1377:\t}\n1378:\t\n1379:\tstatic long htab_map_update_elem_in_place(struct bpf_map *map, void *key,\n1380:\t\t\t\t\t\t void *value, u64 map_flags,\n1381:\t\t\t\t\t\t bool percpu, bool onallcpus)\n1382:\t{\n1383:\t\tstruct bpf_htab *htab = container_of(map, struct bpf_htab, map);\n1384:\t\tstruct htab_elem *l_new, *l_old;\n1385:\t\tstruct hlist_nulls_head *head;\n1386:\t\tvoid *old_map_ptr = NULL;\n1387:\t\tunsigned long flags;\n1388:\t\tstruct bucket *b;\n1389:\t\tu32 key_size, hash;\n1390:\t\tint ret;\n1391:\t\n1392:\t\tret = htab_map_check_update_flags(onallcpus, map_flags);\n1393:\t\tif (unlikely(ret))\n1394:\t\t\treturn ret;\n1395:\t\n1396:\t\tWARN_ON_ONCE(!bpf_rcu_lock_held());\n1397:\t\n1398:\t\tkey_size = map-\u003ekey_size;\n1399:\t\n1400:\t\thash = htab_map_hash(key, key_size, htab-\u003ehashrnd);\n1401:\t\n1402:\t\tb = __select_bucket(htab, hash);\n1403:\t\thead = \u0026b-\u003ehead;\n1404:\t\n1405:\t\tret = htab_lock_bucket(b, \u0026flags);\n1406:\t\tif (ret)\n1407:\t\t\treturn ret;\n1408:\t\n1409:\t\tl_old = lookup_elem_raw(head, hash, key, key_size);\n1410:\t\n1411:\t\tret = check_flags(htab, l_old, map_flags);\n1412:\t\tif (ret)\n1413:\t\t\tgoto err;\n1414:\t\n1415:\t\tif (l_old) {\n1416:\t\t\t/* Update value in-place */\n1417:\t\t\tif (percpu) {\n1418:\t\t\t\tpcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size),\n1419:\t\t\t\t\t\tvalue, onallcpus, map_flags);\n1420:\t\t\t} else {\n1421:\t\t\t\tvoid **inner_map_pptr = htab_elem_value(l_old, key_size);\n1422:\t\n1423:\t\t\t\told_map_ptr = *inner_map_pptr;\n1424:\t\t\t\tWRITE_ONCE(*inner_map_pptr, *(void **)value);\n1425:\t\t\t}\n1426:\t\t} else {\n1427:\t\t\tl_new = alloc_htab_elem(htab, key, value, key_size,\n1428:\t\t\t\t\t\thash, percpu, onallcpus, NULL, map_flags);\n1429:\t\t\tif (IS_ERR(l_new)) {\n1430:\t\t\t\tret = PTR_ERR(l_new);\n1431:\t\t\t\tgoto err;\n1432:\t\t\t}\n1433:\t\t\thlist_nulls_add_head_rcu(\u0026l_new-\u003ehash_node, head);\n1434:\t\t}\n1435:\terr:\n1436:\t\thtab_unlock_bucket(b, flags);\n1437:\t\tif (old_map_ptr)\n1438:\t\t\tmap-\u003eops-\u003emap_fd_put_ptr(map, old_map_ptr, true);\n1439:\t\treturn ret;\n"
} |
| 11/2 | 2026/10/08 16:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11848 output: 38 thoughts: 36 |
| 12/2 | 2026/10/08 16:39 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 1440,
"LineCount": 60
}Results: {
"Contents": "1440:\t}\n1441:\t\n1442:\tstatic long __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\n1443:\t\t\t\t\t\t void *value, u64 map_flags,\n1444:\t\t\t\t\t\t bool onallcpus)\n1445:\t{\n1446:\t\tstruct bpf_htab *htab = container_of(map, struct bpf_htab, map);\n1447:\t\tstruct htab_elem *l_new = NULL, *l_old;\n1448:\t\tstruct hlist_nulls_head *head;\n1449:\t\tunsigned long flags;\n1450:\t\tstruct bucket *b;\n1451:\t\tu32 key_size, hash;\n1452:\t\tint ret;\n1453:\t\n1454:\t\tret = htab_map_check_update_flags(onallcpus, map_flags);\n1455:\t\tif (unlikely(ret))\n1456:\t\t\treturn ret;\n1457:\t\n1458:\t\tWARN_ON_ONCE(!bpf_rcu_lock_held());\n1459:\t\n1460:\t\tkey_size = map-\u003ekey_size;\n1461:\t\n1462:\t\thash = htab_map_hash(key, key_size, htab-\u003ehashrnd);\n1463:\t\n1464:\t\tb = __select_bucket(htab, hash);\n1465:\t\thead = \u0026b-\u003ehead;\n1466:\t\n1467:\t\t/* For LRU, we need to alloc before taking bucket's\n1468:\t\t * spinlock because LRU's elem alloc may need\n1469:\t\t * to remove older elem from htab and this removal\n1470:\t\t * operation will need a bucket lock.\n1471:\t\t */\n1472:\t\tif (!(map_flags \u0026 BPF_EXIST)) {\n1473:\t\t\tl_new = prealloc_lru_pop(htab, key, hash);\n1474:\t\t\tif (!l_new)\n1475:\t\t\t\treturn -ENOMEM;\n1476:\t\t}\n1477:\t\n1478:\t\tret = htab_lock_bucket(b, \u0026flags);\n1479:\t\tif (ret)\n1480:\t\t\tgoto err_lock_bucket;\n1481:\t\n1482:\t\tl_old = lookup_elem_raw(head, hash, key, key_size);\n1483:\t\n1484:\t\tret = check_flags(htab, l_old, map_flags);\n1485:\t\tif (ret)\n1486:\t\t\tgoto err;\n1487:\t\n1488:\t\tif (l_old) {\n1489:\t\t\tbpf_lru_node_set_ref(\u0026l_old-\u003elru_node);\n1490:\t\n1491:\t\t\t/* per-cpu hash map can update value in-place */\n1492:\t\t\tpcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size),\n1493:\t\t\t\t\tvalue, onallcpus, map_flags);\n1494:\t\t} else {\n1495:\t\t\tpcpu_init_value(htab, htab_elem_get_ptr(l_new, key_size),\n1496:\t\t\t\t\tvalue, onallcpus, map_flags);\n1497:\t\t\thlist_nulls_add_head_rcu(\u0026l_new-\u003ehash_node, head);\n1498:\t\t\tl_new = NULL;\n1499:\t\t}\n"
} |
| 13/2 | 2026/10/08 16:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 12888 output: 37 thoughts: 88 |
| 14/2 | 2026/10/08 16:39 | tool | read-file |
0mArgs:{
"File": "include/linux/bpf.h",
"FirstLine": 4225,
"LineCount": 40
}Results: {
"Contents": "4225:\t\t\treturn true;\n4226:\t\tdefault:\n4227:\t\t\treturn false;\n4228:\t\t}\n4229:\t}\n4230:\t\n4231:\t#define BPF_EXIST_FLAGS\t\t(BPF_EXIST | BPF_NOEXIST)\n4232:\t#define BPF_CPU_FLAGS\t\t(BPF_F_CPU | BPF_F_ALL_CPUS)\n4233:\t\n4234:\tstatic inline int bpf_map_check_op_flags(struct bpf_map *map, u64 flags, u64 allowed_flags)\n4235:\t{\n4236:\t\tu32 cpu;\n4237:\t\n4238:\t\tif ((u32)flags \u0026 ~allowed_flags)\n4239:\t\t\treturn -EINVAL;\n4240:\t\n4241:\t\tif ((flags \u0026 BPF_F_LOCK) \u0026\u0026 !btf_record_has_field(map-\u003erecord, BPF_SPIN_LOCK))\n4242:\t\t\treturn -EINVAL;\n4243:\t\n4244:\t\tif (!(flags \u0026 BPF_F_CPU) \u0026\u0026 flags \u003e\u003e 32)\n4245:\t\t\treturn -EINVAL;\n4246:\t\n4247:\t\tif (flags \u0026 (BPF_F_CPU | BPF_F_ALL_CPUS)) {\n4248:\t\t\tif (!bpf_map_is_percpu_map(map-\u003emap_type))\n4249:\t\t\t\treturn -EINVAL;\n4250:\t\t\tif ((flags \u0026 BPF_F_CPU) \u0026\u0026 (flags \u0026 BPF_F_ALL_CPUS))\n4251:\t\t\t\treturn -EINVAL;\n4252:\t\n4253:\t\t\tcpu = flags \u003e\u003e 32;\n4254:\t\t\tif ((flags \u0026 BPF_F_CPU) \u0026\u0026 (cpu \u003e= nr_cpu_ids || !cpu_possible(cpu)))\n4255:\t\t\t\treturn -ERANGE;\n4256:\t\t}\n4257:\t\n4258:\t\treturn 0;\n4259:\t}\n4260:\t\n4261:\t#endif /* _LINUX_BPF_H */\n"
} |
| 15/2 | 2026/10/08 16:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13600 output: 24 thoughts: 27 |
| 16/2 | 2026/10/08 16:39 | tool | grepper |
0mArgs:{
"Expression": "bpf_map_check_op_flags"
}Results: {
"Output": "include/linux/bpf.h=4218=static inline bool bpf_map_is_percpu_map(enum bpf_map_type map_type)\n--\ninclude/linux/bpf.h-4233-\ninclude/linux/bpf.h:4234:static inline int bpf_map_check_op_flags(struct bpf_map *map, u64 flags, u64 allowed_flags)\ninclude/linux/bpf.h-4235-{\n--\nkernel/bpf/hashtab.c=1802=__htab_map_lookup_and_delete_batch(struct bpf_map *map,\n--\nkernel/bpf/hashtab.c-1829-\t\tallowed_flags |= BPF_F_CPU;\nkernel/bpf/hashtab.c:1830:\tret = bpf_map_check_op_flags(map, elem_map_flags, allowed_flags);\nkernel/bpf/hashtab.c-1831-\tif (ret)\n--\nkernel/bpf/hashtab.c=3018=static int rhtab_map_lookup_and_delete_elem(struct bpf_map *map, void *key, void *value, u64 flags)\n--\nkernel/bpf/hashtab.c-3023-\nkernel/bpf/hashtab.c:3024:\terr = bpf_map_check_op_flags(map, flags, BPF_F_LOCK);\nkernel/bpf/hashtab.c-3025-\tif (err)\n--\nkernel/bpf/hashtab.c=3276=static int __rhtab_map_lookup_and_delete_batch(struct bpf_map *map,\n--\nkernel/bpf/hashtab.c-3293-\telem_map_flags = attr-\u003ebatch.elem_flags;\nkernel/bpf/hashtab.c:3294:\tret = bpf_map_check_op_flags(map, elem_map_flags, BPF_F_LOCK);\nkernel/bpf/hashtab.c-3295-\tif (ret)\n--\nkernel/bpf/syscall.c=1786=static int map_lookup_elem(union bpf_attr *attr)\n--\nkernel/bpf/syscall.c-1804-\nkernel/bpf/syscall.c:1805:\terr = bpf_map_check_op_flags(map, attr-\u003eflags, BPF_F_LOCK | BPF_F_CPU);\nkernel/bpf/syscall.c-1806-\tif (err)\n--\nkernel/bpf/syscall.c=1847=static int map_update_elem(union bpf_attr *attr, bpfptr_t uattr)\n--\nkernel/bpf/syscall.c-1868-\nkernel/bpf/syscall.c:1869:\terr = bpf_map_check_op_flags(map, attr-\u003eflags, ~0);\nkernel/bpf/syscall.c-1870-\tif (err)\n--\nkernel/bpf/syscall.c=2065=int generic_map_update_batch(struct bpf_map *map, struct file *map_file,\n--\nkernel/bpf/syscall.c-2074-\nkernel/bpf/syscall.c:2075:\terr = bpf_map_check_op_flags(map, attr-\u003ebatch.elem_flags,\nkernel/bpf/syscall.c-2076-\t\t\t\t BPF_F_LOCK | BPF_F_CPU | BPF_F_ALL_CPUS);\n--\nkernel/bpf/syscall.c=2123=int generic_map_lookup_batch(struct bpf_map *map,\n--\nkernel/bpf/syscall.c-2134-\nkernel/bpf/syscall.c:2135:\terr = bpf_map_check_op_flags(map, attr-\u003ebatch.elem_flags, BPF_F_LOCK | BPF_F_CPU);\nkernel/bpf/syscall.c-2136-\tif (err)\n"
} |
| 17/2 | 2026/10/08 16:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14692 output: 38 thoughts: 271 |
| 18/2 | 2026/10/08 16:39 | tool | grepper |
0mArgs:{
"Expression": "BPF_F_CPU",
"PathPrefixes": [
"include/uapi/linux/bpf.h"
]
}Results: {
"Output": "include/uapi/linux/bpf.h=1401=enum {\n--\ninclude/uapi/linux/bpf.h-1405-\tBPF_F_LOCK\t= 4, /* spin_lock-ed map_lookup/map_update */\ninclude/uapi/linux/bpf.h:1406:\tBPF_F_CPU\t= 8, /* cpu flag for percpu maps, upper 32-bit of flags is a cpu number */\ninclude/uapi/linux/bpf.h-1407-\tBPF_F_ALL_CPUS\t= 16, /* update value across all CPUs for percpu maps */\n"
} |
| 19/2 | 2026/10/08 16:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 15175 output: 37 thoughts: 23 |
| 20/2 | 2026/10/08 16:39 | tool | grepper |
0mArgs:{
"Expression": "BPF_NOEXIST",
"PathPrefixes": [
"include/uapi/linux/bpf.h"
]
}Results: {
"Output": "include/uapi/linux/bpf.h=132=union bpf_iter_link_info {\n--\ninclude/uapi/linux/bpf.h-205- *\t\t\tCreate a new element or update an existing element.\ninclude/uapi/linux/bpf.h:206: *\t\t**BPF_NOEXIST**\ninclude/uapi/linux/bpf.h-207- *\t\t\tCreate a new element only if it did not exist.\n--\ninclude/uapi/linux/bpf.h-223- *\t\t**EEXIST**\ninclude/uapi/linux/bpf.h:224: *\t\t\tIf *flags* specifies **BPF_NOEXIST** and the element\ninclude/uapi/linux/bpf.h-225- *\t\t\twith *key* already exists in the map.\n--\ninclude/uapi/linux/bpf.h-725- *\t\t\tCreate new elements or update a existing elements.\ninclude/uapi/linux/bpf.h:726: *\t\t**BPF_NOEXIST**\ninclude/uapi/linux/bpf.h-727- *\t\t\tCreate new elements only if they do not exist.\n--\ninclude/uapi/linux/bpf.h-751- *\t\t**EEXIST**\ninclude/uapi/linux/bpf.h:752: *\t\t\tIf *flags* specifies **BPF_NOEXIST** and the element\ninclude/uapi/linux/bpf.h-753- *\t\t\twith *key* already exists in the map.\n--\ninclude/uapi/linux/bpf.h=1401=enum {\ninclude/uapi/linux/bpf.h-1402-\tBPF_ANY\t\t= 0, /* create new element or update existing */\ninclude/uapi/linux/bpf.h:1403:\tBPF_NOEXIST\t= 1, /* create new element if it didn't exist */\ninclude/uapi/linux/bpf.h-1404-\tBPF_EXIST\t= 2, /* update existing element */\n--\ninclude/uapi/linux/bpf.h=1527=union bpf_attr {\n--\ninclude/uapi/linux/bpf.h-1983- *\ninclude/uapi/linux/bpf.h:1984: * \t\t**BPF_NOEXIST**\ninclude/uapi/linux/bpf.h-1985- * \t\t\tThe entry for *key* must not exist in the map.\n--\ninclude/uapi/linux/bpf.h-1990- *\ninclude/uapi/linux/bpf.h:1991: * \t\tFlag value **BPF_NOEXIST** cannot be used for maps of types\ninclude/uapi/linux/bpf.h-1992- * \t\t**BPF_MAP_TYPE_ARRAY** or **BPF_MAP_TYPE_PERCPU_ARRAY** (all\n--\ninclude/uapi/linux/bpf.h-3119- *\ninclude/uapi/linux/bpf.h:3120: * \t\t**BPF_NOEXIST**\ninclude/uapi/linux/bpf.h-3121- * \t\t\tThe entry for *key* must not exist in the map.\n--\ninclude/uapi/linux/bpf.h-3619- *\ninclude/uapi/linux/bpf.h:3620: *\t\t**BPF_NOEXIST**\ninclude/uapi/linux/bpf.h-3621- *\t\t\tThe entry for *key* must not exist in the map.\n"
} |
| 21/2 | 2026/10/08 16:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 16132 output: 36 thoughts: 1274 |
| 22/2 | 2026/10/08 16:39 | tool | grepper |
0mArgs:{
"Expression": "(arraymap|hashtab)\\.o",
"PathPrefixes": [
"kernel/bpf/Makefile"
]
}Results: {
"Output": "kernel/bpf/Makefile=10=obj-$(CONFIG_BPF_SYSCALL) += bpf_iter.o map_iter.o task_iter.o prog_iter.o link_iter.o\nkernel/bpf/Makefile:11:obj-$(CONFIG_BPF_SYSCALL) += hashtab.o arraymap.o percpu_freelist.o bpf_lru_list.o lpm_trie.o map_in_map.o bloom_filter.o\nkernel/bpf/Makefile-12-obj-$(CONFIG_BPF_SYSCALL) += local_storage.o queue_stack_maps.o ringbuf.o bpf_insn_array.o\n"
} |
| 23/2 | 2026/10/08 16:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 17620 output: 42 thoughts: 41 |
| 24/2 | 2026/10/08 16:39 | tool | grepper |
0mArgs:{
"Expression": "config BPF_SYSCALL",
"PathPrefixes": [
"init/Kconfig",
"kernel/bpf/Kconfig"
]
}Results: {
"Output": "kernel/bpf/Kconfig=25=menu \"BPF subsystem\"\nkernel/bpf/Kconfig-26-\nkernel/bpf/Kconfig:27:config BPF_SYSCALL\nkernel/bpf/Kconfig-28-\tbool \"Enable bpf() system call\"\n"
} |
| 25/2 | 2026/10/08 16:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 17786 output: 34 thoughts: 19 |
| 26/2 | 2026/10/08 16:39 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/Kconfig",
"FirstLine": 25,
"LineCount": 20
}Results: {
"Contents": " 25:\tmenu \"BPF subsystem\"\n 26:\t\n 27:\tconfig BPF_SYSCALL\n 28:\t\tbool \"Enable bpf() system call\"\n 29:\t\tselect BPF\n 30:\t\tselect IRQ_WORK\n 31:\t\tselect NEED_TASKS_RCU\n 32:\t\tselect TASKS_TRACE_RCU\n 33:\t\tselect BINARY_PRINTF\n 34:\t\tselect NET_SOCK_MSG if NET\n 35:\t\tselect NET_XGRESS if NET\n 36:\t\tselect PAGE_POOL if NET\n 37:\t\tdefault n\n 38:\t\thelp\n 39:\t\t Enable the bpf() system call that allows to manipulate BPF programs\n 40:\t\t and maps via file descriptors.\n 41:\t\n 42:\tconfig BPF_JIT\n 43:\t\tbool \"Enable BPF Just In Time compiler\"\n 44:\t\tdepends on BPF\n"
} |
| 27/2 | 2026/10/08 16:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18090 output: 23 thoughts: 144 |
| 28/2 | 2026/10/08 16:40 | tool | grepper |
0mArgs:{
"Expression": "bpf_percpu_array_update"
}Results: {
"Output": "include/linux/bpf.h=3071=int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value,\ninclude/linux/bpf.h-3072-\t\t\t u64 flags);\ninclude/linux/bpf.h:3073:int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value,\ninclude/linux/bpf.h-3074-\t\t\t u64 flags);\n--\nkernel/bpf/arraymap.c=392=static long array_map_update_elem(struct bpf_map *map, void *key, void *value,\n--\nkernel/bpf/arraymap.c-430-\nkernel/bpf/arraymap.c:431:int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value,\nkernel/bpf/arraymap.c-432-\t\t\t u64 map_flags)\n--\nkernel/bpf/syscall.c=250=static int bpf_map_update_value(struct bpf_map *map, struct file *map_file,\n--\nkernel/bpf/syscall.c-274-\t} else if (map-\u003emap_type == BPF_MAP_TYPE_PERCPU_ARRAY) {\nkernel/bpf/syscall.c:275:\t\terr = bpf_percpu_array_update(map, key, value, flags);\nkernel/bpf/syscall.c-276-\t} else if (map-\u003emap_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) {\n"
} |
| 29/2 | 2026/10/08 16:40 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18682 output: 34 thoughts: 127 |
| 30/2 | 2026/10/08 16:40 | tool | grepper |
0mArgs:{
"Expression": "check_flags\\(",
"PathPrefixes": [
"kernel/bpf/hashtab.c"
]
}Results: {
"Output": "kernel/bpf/hashtab.c=1097=static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key,\n--\nkernel/bpf/hashtab.c-1179-\nkernel/bpf/hashtab.c:1180:static int check_flags(struct bpf_htab *htab, struct htab_elem *l_old,\nkernel/bpf/hashtab.c-1181-\t\t u64 map_flags)\n--\nkernel/bpf/hashtab.c=1195=static long htab_map_update_elem(struct bpf_map *map, void *key, void *value,\n--\nkernel/bpf/hashtab.c-1224-\t\t\t\t\t htab-\u003en_buckets);\nkernel/bpf/hashtab.c:1225:\t\tret = check_flags(htab, l_old, map_flags);\nkernel/bpf/hashtab.c-1226-\t\tif (ret)\n--\nkernel/bpf/hashtab.c-1246-\nkernel/bpf/hashtab.c:1247:\tret = check_flags(htab, l_old, map_flags);\nkernel/bpf/hashtab.c-1248-\tif (ret)\n--\nkernel/bpf/hashtab.c=1302=static long htab_lru_map_update_elem(struct bpf_map *map, void *key, void *value,\n--\nkernel/bpf/hashtab.c-1341-\nkernel/bpf/hashtab.c:1342:\tret = check_flags(htab, l_old, map_flags);\nkernel/bpf/hashtab.c-1343-\tif (ret)\n--\nkernel/bpf/hashtab.c=1379=static long htab_map_update_elem_in_place(struct bpf_map *map, void *key,\n--\nkernel/bpf/hashtab.c-1410-\nkernel/bpf/hashtab.c:1411:\tret = check_flags(htab, l_old, map_flags);\nkernel/bpf/hashtab.c-1412-\tif (ret)\n--\nkernel/bpf/hashtab.c=1442=static long __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\n--\nkernel/bpf/hashtab.c-1483-\nkernel/bpf/hashtab.c:1484:\tret = check_flags(htab, l_old, map_flags);\nkernel/bpf/hashtab.c-1485-\tif (ret)\n"
} |
| 31/2 | 2026/10/08 16:40 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 19544 output: 40 thoughts: 66 |
| 32/2 | 2026/10/08 16:40 | tool | grepper |
0mArgs:{
"Expression": "htab_map_check_update_flags",
"PathPrefixes": [
"kernel/bpf/hashtab.c"
]
}Results: {
"Output": "kernel/bpf/hashtab.c=1302=static long htab_lru_map_update_elem(struct bpf_map *map, void *key, void *value,\n--\nkernel/bpf/hashtab.c-1367-\nkernel/bpf/hashtab.c:1368:static int htab_map_check_update_flags(bool onallcpus, u64 map_flags)\nkernel/bpf/hashtab.c-1369-{\n--\nkernel/bpf/hashtab.c=1379=static long htab_map_update_elem_in_place(struct bpf_map *map, void *key,\n--\nkernel/bpf/hashtab.c-1391-\nkernel/bpf/hashtab.c:1392:\tret = htab_map_check_update_flags(onallcpus, map_flags);\nkernel/bpf/hashtab.c-1393-\tif (unlikely(ret))\n--\nkernel/bpf/hashtab.c=1442=static long __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\n--\nkernel/bpf/hashtab.c-1453-\nkernel/bpf/hashtab.c:1454:\tret = htab_map_check_update_flags(onallcpus, map_flags);\nkernel/bpf/hashtab.c-1455-\tif (unlikely(ret))\n"
} |
| 33/2 | 2026/10/08 16:40 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20039 output: 58 thoughts: 74 |
| 34/2 | 2026/10/08 16:40 | tool | grepper |
0mArgs:{
"Expression": "htab_map_update_elem_in_place|__htab_lru_percpu_map_update_elem",
"PathPrefixes": [
"kernel/bpf/hashtab.c"
]
}Results: {
"Output": "kernel/bpf/hashtab.c=1368=static int htab_map_check_update_flags(bool onallcpus, u64 map_flags)\n--\nkernel/bpf/hashtab.c-1378-\nkernel/bpf/hashtab.c:1379:static long htab_map_update_elem_in_place(struct bpf_map *map, void *key,\nkernel/bpf/hashtab.c-1380-\t\t\t\t\t void *value, u64 map_flags,\n--\nkernel/bpf/hashtab.c-1441-\nkernel/bpf/hashtab.c:1442:static long __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\nkernel/bpf/hashtab.c-1443-\t\t\t\t\t void *value, u64 map_flags,\n--\nkernel/bpf/hashtab.c=1511=static long htab_percpu_map_update_elem(struct bpf_map *map, void *key,\n--\nkernel/bpf/hashtab.c-1513-{\nkernel/bpf/hashtab.c:1514:\treturn htab_map_update_elem_in_place(map, key, value, map_flags, true, false);\nkernel/bpf/hashtab.c-1515-}\n--\nkernel/bpf/hashtab.c=1517=static long htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\n--\nkernel/bpf/hashtab.c-1519-{\nkernel/bpf/hashtab.c:1520:\treturn __htab_lru_percpu_map_update_elem(map, key, value, map_flags,\nkernel/bpf/hashtab.c-1521-\t\t\t\t\t\t false);\n--\nkernel/bpf/hashtab.c=2555=int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value,\n--\nkernel/bpf/hashtab.c-2562-\tif (htab_is_lru(htab))\nkernel/bpf/hashtab.c:2563:\t\tret = __htab_lru_percpu_map_update_elem(map, key, value,\nkernel/bpf/hashtab.c-2564-\t\t\t\t\t\t\tmap_flags, true);\nkernel/bpf/hashtab.c-2565-\telse\nkernel/bpf/hashtab.c:2566:\t\tret = htab_map_update_elem_in_place(map, key, value, map_flags,\nkernel/bpf/hashtab.c-2567-\t\t\t\t\t\t true, true);\n--\nkernel/bpf/hashtab.c=2694=int bpf_fd_htab_map_update_elem(struct bpf_map *map, struct file *map_file,\n--\nkernel/bpf/hashtab.c-2705-\t * htab map, and the following rcu_read_lock() is only used to avoid\nkernel/bpf/hashtab.c:2706:\t * the WARN_ON_ONCE in htab_map_update_elem_in_place().\nkernel/bpf/hashtab.c-2707-\t */\nkernel/bpf/hashtab.c-2708-\trcu_read_lock();\nkernel/bpf/hashtab.c:2709:\tret = htab_map_update_elem_in_place(map, key, \u0026ptr, map_flags, false, false);\nkernel/bpf/hashtab.c-2710-\trcu_read_unlock();\n"
} |
| 35/2 | 2026/10/08 16:40 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21122 output: 23 thoughts: 67 |
| 36/2 | 2026/10/08 16:40 | tool | grepper |
0mArgs:{
"Expression": "bpf_percpu_hash_update"
}Results: {
"Output": "include/linux/bpf.h=3070=int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value, u64 flags);\ninclude/linux/bpf.h:3071:int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value,\ninclude/linux/bpf.h-3072-\t\t\t u64 flags);\n--\nkernel/bpf/hashtab.c=2517=int bpf_percpu_hash_copy(struct bpf_map *map, void *key, void *value, u64 map_flags)\n--\nkernel/bpf/hashtab.c-2554-\nkernel/bpf/hashtab.c:2555:int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value,\nkernel/bpf/hashtab.c-2556-\t\t\t u64 map_flags)\n--\nkernel/bpf/syscall.c=250=static int bpf_map_update_value(struct bpf_map *map, struct file *map_file,\n--\nkernel/bpf/syscall.c-272-\t map-\u003emap_type == BPF_MAP_TYPE_LRU_PERCPU_HASH) {\nkernel/bpf/syscall.c:273:\t\terr = bpf_percpu_hash_update(map, key, value, flags);\nkernel/bpf/syscall.c-274-\t} else if (map-\u003emap_type == BPF_MAP_TYPE_PERCPU_ARRAY) {\n"
} |
| 37/2 | 2026/10/08 16:40 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21628 output: 56 thoughts: 185 |
| 38/2 | 2026/10/08 16:40 | tool | grepper |
0mArgs:{
"Expression": "htab_percpu_map_update_elem|htab_lru_percpu_map_update_elem",
"PathPrefixes": [
"kernel/bpf/hashtab.c"
]
}Results: {
"Output": "kernel/bpf/hashtab.c=1379=static long htab_map_update_elem_in_place(struct bpf_map *map, void *key,\n--\nkernel/bpf/hashtab.c-1441-\nkernel/bpf/hashtab.c:1442:static long __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\nkernel/bpf/hashtab.c-1443-\t\t\t\t\t void *value, u64 map_flags,\n--\nkernel/bpf/hashtab.c-1510-\nkernel/bpf/hashtab.c:1511:static long htab_percpu_map_update_elem(struct bpf_map *map, void *key,\nkernel/bpf/hashtab.c-1512-\t\t\t\t\tvoid *value, u64 map_flags)\n--\nkernel/bpf/hashtab.c-1516-\nkernel/bpf/hashtab.c:1517:static long htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\nkernel/bpf/hashtab.c-1518-\t\t\t\t\t void *value, u64 map_flags)\nkernel/bpf/hashtab.c-1519-{\nkernel/bpf/hashtab.c:1520:\treturn __htab_lru_percpu_map_update_elem(map, key, value, map_flags,\nkernel/bpf/hashtab.c-1521-\t\t\t\t\t\t false);\n--\nkernel/bpf/hashtab.c=2555=int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value,\n--\nkernel/bpf/hashtab.c-2562-\tif (htab_is_lru(htab))\nkernel/bpf/hashtab.c:2563:\t\tret = __htab_lru_percpu_map_update_elem(map, key, value,\nkernel/bpf/hashtab.c-2564-\t\t\t\t\t\t\tmap_flags, true);\n--\nkernel/bpf/hashtab.c=2602=const struct bpf_map_ops htab_percpu_map_ops = {\n--\nkernel/bpf/hashtab.c-2610-\t.map_lookup_and_delete_elem = htab_percpu_map_lookup_and_delete_elem,\nkernel/bpf/hashtab.c:2611:\t.map_update_elem = htab_percpu_map_update_elem,\nkernel/bpf/hashtab.c-2612-\t.map_delete_elem = htab_map_delete_elem,\n--\nkernel/bpf/hashtab.c=2624=const struct bpf_map_ops htab_lru_percpu_map_ops = {\n--\nkernel/bpf/hashtab.c-2631-\t.map_lookup_and_delete_elem = htab_lru_percpu_map_lookup_and_delete_elem,\nkernel/bpf/hashtab.c:2632:\t.map_update_elem = htab_lru_percpu_map_update_elem,\nkernel/bpf/hashtab.c-2633-\t.map_delete_elem = htab_lru_map_delete_elem,\n"
} |
| 39/2 | 2026/10/08 16:40 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22733 output: 35 thoughts: 179 |
| 40/2 | 2026/10/08 16:40 | tool | grepper |
0mError:no matches Args: {
"Expression": "bpf_map_update_elem\\(",
"PathPrefixes": [
"kernel/bpf/"
]
}Results: {
"error": "no matches"
} |
| 41/2 | 2026/10/08 16:40 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22961 output: 34 thoughts: 23 |
| 42/2 | 2026/10/08 16:40 | tool | grepper |
0mArgs:{
"Expression": "map_update_elem",
"PathPrefixes": [
"kernel/bpf/helpers.c"
]
}Results: {
"Output": "kernel/bpf/helpers.c=50=const struct bpf_func_proto bpf_map_lookup_elem_proto = {\n--\nkernel/bpf/helpers.c-58-\nkernel/bpf/helpers.c:59:BPF_CALL_4(bpf_map_update_elem, struct bpf_map *, map, void *, key,\nkernel/bpf/helpers.c-60-\t void *, value, u64, flags)\n--\nkernel/bpf/helpers.c-62-\tWARN_ON_ONCE(!bpf_rcu_lock_held());\nkernel/bpf/helpers.c:63:\treturn map-\u003eops-\u003emap_update_elem(map, key, value, flags);\nkernel/bpf/helpers.c-64-}\nkernel/bpf/helpers.c-65-\nkernel/bpf/helpers.c:66:const struct bpf_func_proto bpf_map_update_elem_proto = {\nkernel/bpf/helpers.c:67:\t.func\t\t= bpf_map_update_elem,\nkernel/bpf/helpers.c-68-\t.gpl_only\t= false,\n--\nkernel/bpf/helpers.c=2067=bpf_base_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)\n--\nkernel/bpf/helpers.c-2071-\t\treturn \u0026bpf_map_lookup_elem_proto;\nkernel/bpf/helpers.c:2072:\tcase BPF_FUNC_map_update_elem:\nkernel/bpf/helpers.c:2073:\t\treturn \u0026bpf_map_update_elem_proto;\nkernel/bpf/helpers.c-2074-\tcase BPF_FUNC_map_delete_elem:\n"
} |
| 43/2 | 2026/10/08 16:40 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 23481 output: 232 thoughts: 1977 |
| 44/2 | 2026/10/08 16:41 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"BPF_SYSCALL"
],
"FocusSymbols": [
"bpf_percpu_array_update",
"bpf_percpu_hash_update",
"htab_percpu_map_update_elem",
"htab_lru_percpu_map_update_elem",
"__htab_lru_percpu_map_update_elem",
"htab_map_update_elem_in_place"
],
"Reasoning": "The patch modifies flag validation and lookup/update logic for BPF per-CPU array and hash maps (allowing valid combinations of BPF_NOEXIST/BPF_EXIST with BPF_F_CPU/BPF_F_ALL_CPUS). This touches reachable core BPF map manipulation paths via the bpf(BPF_MAP_UPDATE_ELEM) syscall and in-kernel BPF map helper calls, making it well-suited for fuzzing to detect regressions or corner-case state inconsistencies.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"BPF_SYSCALL"
],
"FocusSymbols": [
"bpf_percpu_array_update",
"bpf_percpu_hash_update",
"htab_percpu_map_update_elem",
"htab_lru_percpu_map_update_elem",
"__htab_lru_percpu_map_update_elem",
"htab_map_update_elem_in_place"
],
"Reasoning": "The patch modifies flag validation and lookup/update logic for BPF per-CPU array and hash maps (allowing valid combinations of BPF_NOEXIST/BPF_EXIST with BPF_F_CPU/BPF_F_ALL_CPUS). This touches reachable core BPF map manipulation paths via the bpf(BPF_MAP_UPDATE_ELEM) syscall and in-kernel BPF map helper calls, making it well-suited for fuzzing to detect regressions or corner-case state inconsistencies.",
"WorthFuzzing": true
} |
| 45/1 | 2026/10/08 16:41 | action | If |
2mArgs:{
"WorthFuzzing": true
}Results: null |
| 46/2 | 2026/10/08 16:41 | agent | kmsan-evaluator |
2mModel:core Args: null Results: {
"KMSANReasoning": "The patch modifies flag validation logic in the BPF subsystem (specifically in `bpf_percpu_array_update`, `check_flags`, `htab_map_check_update_flags`, and `__htab_lru_percpu_map_update_elem`) to properly handle bitwise combinations of element existence flags (`BPF_EXIST`, `BPF_NOEXIST`) and per-CPU flags (`BPF_F_CPU`, `BPF_F_ALL_CPUS`), while rejecting mutually exclusive combinations (such as `BPF_EXIST | BPF_NOEXIST`).\n\nNone of the changes introduce or expose uninitialized memory risks:\n1. No kernel structures or data buffers are returned or copied to userspace in these paths; they are strictly map update paths.\n2. The conditional logic evaluates `map_flags`, which is passed from the validated syscall attributes (`union bpf_attr`).\n3. Map values in per-CPU hash maps continue to be properly initialized via `pcpu_init_value()` (which zero-initializes non-target CPUs via `zero_map_value()`), and per-CPU array maps are preallocated with zeroed memory.\n4. No bounds calculations or buffer length checks are altered in a way that could allow uninitialized memory reads.\n\nAny potential bugs related to flag handling, incorrect CPU indexing, or pointer offsets would be caught by standard bug detectors and KASAN (e.g. out-of-bounds accesses). Therefore, a dedicated KMSAN fuzzing session is not justified.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
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 a6abfc52d391a674de7e0cb3eb86cb8ede66ab71
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Oct 8 16:38:23 2026 +0000
syz-cluster: applied patch under review
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 0ecb9418dfbd6..29d571e722da7 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -4228,6 +4228,9 @@ static inline bool bpf_map_is_percpu_map(enum bpf_map_type map_type)
}
}
+#define BPF_EXIST_FLAGS (BPF_EXIST | BPF_NOEXIST)
+#define BPF_CPU_FLAGS (BPF_F_CPU | BPF_F_ALL_CPUS)
+
static inline int bpf_map_check_op_flags(struct bpf_map *map, u64 flags, u64 allowed_flags)
{
u32 cpu;
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index 0ce26b538075e..d76d5f202a8c0 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -438,15 +438,15 @@ int bpf_percpu_array_update(struct bpf_map *map, void *key, void *value,
u32 size;
int cpu, off = 0;
- if (unlikely((map_flags & BPF_F_LOCK) || (u32)map_flags > BPF_F_ALL_CPUS))
- /* unknown flags */
+ if (unlikely(((map_flags & BPF_EXIST_FLAGS) == BPF_EXIST_FLAGS) ||
+ ((u32)map_flags & ~(BPF_EXIST_FLAGS | BPF_CPU_FLAGS))))
return -EINVAL;
if (unlikely(index >= array->map.max_entries))
/* all elements were pre-allocated, cannot insert a new one */
return -E2BIG;
- if (unlikely(map_flags == BPF_NOEXIST))
+ if (unlikely(map_flags & BPF_NOEXIST))
/* all elements already exist */
return -EEXIST;
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
index 13a2356c84cf9..62b630bb863ff 100644
--- a/kernel/bpf/hashtab.c
+++ b/kernel/bpf/hashtab.c
@@ -1180,11 +1180,11 @@ static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key,
static int check_flags(struct bpf_htab *htab, struct htab_elem *l_old,
u64 map_flags)
{
- if (l_old && (map_flags & ~BPF_F_LOCK) == BPF_NOEXIST)
+ if (l_old && (map_flags & BPF_NOEXIST))
/* elem already exists */
return -EEXIST;
- if (!l_old && (map_flags & ~BPF_F_LOCK) == BPF_EXIST)
+ if (!l_old && (map_flags & BPF_EXIST))
/* elem doesn't exist, cannot update it */
return -ENOENT;
@@ -1367,9 +1367,11 @@ static long htab_lru_map_update_elem(struct bpf_map *map, void *key, void *value
static int htab_map_check_update_flags(bool onallcpus, u64 map_flags)
{
+ if (unlikely((map_flags & BPF_EXIST_FLAGS) == BPF_EXIST_FLAGS))
+ return -EINVAL;
if (unlikely(!onallcpus && map_flags > BPF_EXIST))
return -EINVAL;
- if (unlikely(onallcpus && ((map_flags & BPF_F_LOCK) || (u32)map_flags > BPF_F_ALL_CPUS)))
+ if (unlikely(onallcpus && ((u32)map_flags & ~(BPF_EXIST_FLAGS | BPF_CPU_FLAGS))))
return -EINVAL;
return 0;
}
@@ -1467,7 +1469,7 @@ static long __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,
* to remove older elem from htab and this removal
* operation will need a bucket lock.
*/
- if (map_flags != BPF_EXIST) {
+ if (!(map_flags & BPF_EXIST)) {
l_new = prealloc_lru_pop(htab, key, hash);
if (!l_new)
return -ENOMEM;
diff --git a/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c b/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c
index 7b4a1e24363b5..67124dd4d8a78 100644
--- a/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c
+++ b/tools/testing/selftests/bpf/prog_tests/percpu_alloc.c
@@ -449,6 +449,95 @@ static void test_lru_percpu_hash_cpu_flag_create(void)
test_percpu_map_cpu_flag_create(BPF_MAP_TYPE_LRU_PERCPU_HASH, 0);
}
+static bool verify_map_value_all_cpus(int map_fd, void *key, void *values, size_t elem_sz,
+ u32 expected_value, int nr_cpus)
+{
+ int i, err;
+
+ err = bpf_map_lookup_elem(map_fd, key, values);
+ if (!ASSERT_OK(err, "bpf_map_lookup_elem all_cpus"))
+ return false;
+
+ for (i = 0 ; i < nr_cpus ; i++) {
+ if (!ASSERT_EQ(*(u32 *)(values + elem_sz * i), expected_value,
+ "bpf_map_lookup_elem value all_cpus"))
+ return false;
+ }
+
+ return true;
+}
+
+static bool verify_map_value_first_cpu(int map_fd, void *key, void *values, size_t elem_sz,
+ u32 expected_value, int nr_cpus)
+{
+ int i, err;
+
+ err = bpf_map_lookup_elem(map_fd, key, values);
+ if (!ASSERT_OK(err, "bpf_map_lookup_elem cpu"))
+ return false;
+
+ if (!ASSERT_EQ(*(u32 *)values, expected_value, "bpf_map_lookup_elem value cpu"))
+ return false;
+
+ for (i = 1 ; i < nr_cpus ; i++) {
+ if (!ASSERT_NEQ(*(u32 *)(values + elem_sz * i), expected_value,
+ "bpf_map_lookup_elem value cpu"))
+ return false;
+ }
+
+ return true;
+}
+
+static void test_percpu_cgroup_storage_flags_combination(struct bpf_map *map, int nr_cpus,
+ struct bpf_cgroup_storage_key *key)
+{
+ size_t value_sz = sizeof(u32), key_sz, elem_sz;
+ u32 *values, test_value = 0xAABBCCDD;
+ int err, map_fd;
+ u64 flags;
+
+ key_sz = sizeof(*key);
+ elem_sz = roundup(value_sz, 8);
+ map_fd = bpf_map__fd(map);
+ values = calloc(nr_cpus, elem_sz);
+ if (!ASSERT_OK_PTR(values, "calloc values"))
+ return;
+
+ flags = BPF_NOEXIST | BPF_EXIST;
+ err = bpf_map__update_elem(map, key, key_sz, values, elem_sz * nr_cpus, flags);
+ if (!ASSERT_EQ(err, -EINVAL, "bpf_map__update_elem noexist|exist"))
+ goto out;
+
+ flags = BPF_F_ALL_CPUS | BPF_NOEXIST;
+ err = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);
+ if (!ASSERT_EQ(err, -EINVAL, "bpf_map__update_elem all_cpus|noexist"))
+ goto out;
+
+ flags = BPF_F_CPU | BPF_NOEXIST;
+ err = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);
+ if (!ASSERT_EQ(err, -EINVAL, "bpf_map__update_elem cpu|noexist"))
+ goto out;
+
+ flags = BPF_F_ALL_CPUS | BPF_EXIST;
+ values[0] = test_value;
+ err = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);
+ if (!ASSERT_OK(err, "bpf_map__update_elem all_cpus|exist"))
+ goto out;
+
+ if (!verify_map_value_all_cpus(map_fd, key, values, elem_sz, test_value, nr_cpus))
+ goto out;
+
+ flags = BPF_F_CPU | BPF_EXIST;
+ values[0] = --test_value;
+ err = bpf_map__update_elem(map, key, key_sz, values, value_sz, flags);
+ if (!ASSERT_OK(err, "bpf_map__update_elem cpu|exist"))
+ goto out;
+
+ verify_map_value_first_cpu(map_fd, key, values, elem_sz, test_value, nr_cpus);
+out:
+ free(values);
+}
+
static void test_percpu_cgroup_storage_cpu_flag(void)
{
struct percpu_alloc_array *skel = NULL;
@@ -489,6 +578,7 @@ static void test_percpu_cgroup_storage_cpu_flag(void)
goto out;
test_percpu_map_op_cpu_flag(map, &key, sizeof(key), 1, nr_cpus, false);
+ test_percpu_cgroup_storage_flags_combination(map, nr_cpus, &key);
out:
bpf_prog_detach2(-1, cgroup, BPF_CGROUP_INET_EGRESS);
close(cgroup);
@@ -537,6 +627,164 @@ static void test_hash_cpu_flag(void)
test_map_op_cpu_flag(BPF_MAP_TYPE_HASH);
}
+static void test_percpu_map_flags_combination(enum bpf_map_type map_type)
+{
+ u32 max_entries = 3, key = 0, first_value = 0xAABBCCDD, test_value = first_value;
+ size_t value_sz = sizeof(u32), elem_sz;
+ int err, map_fd, nr_cpus;
+ bool is_hash_map;
+ u32 *values;
+ u64 flags;
+
+ is_hash_map = (map_type == BPF_MAP_TYPE_PERCPU_HASH ||
+ map_type == BPF_MAP_TYPE_LRU_PERCPU_HASH);
+ nr_cpus = libbpf_num_possible_cpus();
+ if (!ASSERT_GT(nr_cpus, 0, "libbpf_num_possible_cpus"))
+ return;
+
+ elem_sz = roundup(value_sz, 8);
+ values = calloc(nr_cpus, elem_sz);
+ if (!ASSERT_OK_PTR(values, "calloc values"))
+ return;
+
+ map_fd = bpf_map_create(map_type, "test_flags_combination_map",
+ sizeof(u32), value_sz, max_entries, NULL);
+ if (!ASSERT_GE(map_fd, 0, "bpf_map_create")) {
+ free(values);
+ return;
+ }
+
+ flags = BPF_NOEXIST | BPF_EXIST;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (!ASSERT_EQ(err, -EINVAL, "bpf_map_update_elem noexist|exist"))
+ goto out;
+
+ flags = BPF_F_ALL_CPUS | BPF_NOEXIST;
+ values[0] = test_value;
+ key = 0;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (is_hash_map) {
+ if (!ASSERT_OK(err, "bpf_map_update_elem all_cpus|noexist"))
+ goto out;
+
+ if (!verify_map_value_all_cpus(map_fd, &key, values, elem_sz, test_value, nr_cpus))
+ goto out;
+
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ }
+ if (!ASSERT_EQ(err, -EEXIST, "bpf_map_update_elem all_cpus|noexist"))
+ goto out;
+
+ flags = BPF_F_CPU | BPF_NOEXIST;
+ values[0] = --test_value;
+ key = 1;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (is_hash_map) {
+ if (!ASSERT_OK(err, "bpf_map_update_elem cpu|noexist"))
+ goto out;
+
+ if (!verify_map_value_first_cpu(map_fd, &key, values, elem_sz, test_value, nr_cpus))
+ goto out;
+
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ }
+ if (!ASSERT_EQ(err, -EEXIST, "bpf_map_update_elem cpu|noexist"))
+ goto out;
+
+ flags = BPF_F_ALL_CPUS | BPF_EXIST;
+ values[0] = --test_value;
+ key = 2;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (is_hash_map) {
+ if (!ASSERT_EQ(err, -ENOENT, "bpf_map_update_elem all_cpus|exist"))
+ goto out;
+ } else {
+ if (!ASSERT_OK(err, "bpf_map_update_elem all_cpus|exist"))
+ goto out;
+
+ if (!verify_map_value_all_cpus(map_fd, &key, values, elem_sz, test_value, nr_cpus))
+ goto out;
+ }
+
+ flags = BPF_F_CPU | BPF_EXIST;
+ values[0] = --test_value;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (is_hash_map) {
+ if (!ASSERT_EQ(err, -ENOENT, "bpf_map_update_elem cpu|exist"))
+ goto out;
+ } else {
+ if (!ASSERT_OK(err, "bpf_map_update_elem cpu|exist"))
+ goto out;
+
+ if (!verify_map_value_first_cpu(map_fd, &key, values, elem_sz, test_value, nr_cpus))
+ goto out;
+ }
+
+ if (map_type != BPF_MAP_TYPE_LRU_PERCPU_HASH)
+ goto out;
+
+ /* Percpu LRU hash map should not delete old entries unnecessarily */
+ flags = BPF_F_ALL_CPUS | BPF_NOEXIST;
+ key = 2;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (!ASSERT_OK(err, "bpf_map_update_elem lru_percpu_hash all_cpus|noexist"))
+ goto out;
+
+ flags = BPF_F_ALL_CPUS | BPF_EXIST;
+ err = bpf_map_update_elem(map_fd, &key, values, flags);
+ if (!ASSERT_OK(err, "bpf_map_update_elem lru_percpu_hash all_cpus|exist"))
+ goto out;
+
+ key = 0;
+ verify_map_value_all_cpus(map_fd, &key, values, elem_sz, first_value, nr_cpus);
+
+out:
+ close(map_fd);
+ free(values);
+}
+
+static bool pin_current_cpu(cpu_set_t *old_mask)
+{
+ cpu_set_t new_mask;
+ int err, cpu;
+
+ err = sched_getaffinity(0, sizeof(*old_mask), old_mask);
+ if (!ASSERT_OK(err, "sched_getaffinity"))
+ return false;
+
+ cpu = sched_getcpu();
+ if (!ASSERT_GE(cpu, 0, "sched_getcpu"))
+ return false;
+
+ CPU_ZERO(&new_mask);
+ CPU_SET(cpu, &new_mask);
+
+ err = sched_setaffinity(0, sizeof(new_mask), &new_mask);
+ return ASSERT_OK(err, "sched_setaffinity");
+}
+
+static void test_percpu_hash_flags_combination(void)
+{
+ test_percpu_map_flags_combination(BPF_MAP_TYPE_PERCPU_HASH);
+}
+
+static void test_lru_percpu_hash_flags_combination(void)
+{
+ cpu_set_t old_mask;
+
+ if (!pin_current_cpu(&old_mask))
+ return;
+
+ test_percpu_map_flags_combination(BPF_MAP_TYPE_LRU_PERCPU_HASH);
+
+ sched_setaffinity(0, sizeof(old_mask), &old_mask);
+}
+
+static void test_percpu_array_flags_combination(void)
+{
+ test_percpu_map_flags_combination(BPF_MAP_TYPE_PERCPU_ARRAY);
+}
+
void test_percpu_alloc(void)
{
if (test__start_subtest("array"))
@@ -565,4 +813,10 @@ void test_percpu_alloc(void)
test_array_cpu_flag();
if (test__start_subtest("cpu_flag_hash"))
test_hash_cpu_flag();
+ if (test__start_subtest("cpu_flag_combination_percpu_hash"))
+ test_percpu_hash_flags_combination();
+ if (test__start_subtest("cpu_flag_combination_lru_percpu_hash"))
+ test_lru_percpu_hash_flags_combination();
+ if (test__start_subtest("cpu_flag_combination_percpu_array"))
+ test_percpu_array_flags_combination();
}
|
| 47/3 | 2026/10/08 16:41 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 7159 output: 35 thoughts: 162 |
| 48/3 | 2026/10/08 16:41 | tool | grepper |
0mArgs:{
"Expression": "#define BPF_(NOEXIST|EXIST|F_CPU|F_ALL_CPUS)"
}Results: {
"Output": "include/linux/bpf.h=4218=static inline bool bpf_map_is_percpu_map(enum bpf_map_type map_type)\n--\ninclude/linux/bpf.h-4230-\ninclude/linux/bpf.h:4231:#define BPF_EXIST_FLAGS\t\t(BPF_EXIST | BPF_NOEXIST)\ninclude/linux/bpf.h-4232-#define BPF_CPU_FLAGS\t\t(BPF_F_CPU | BPF_F_ALL_CPUS)\n"
} |
| 49/3 | 2026/10/08 16:41 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 7502 output: 53 thoughts: 48 |
| 50/3 | 2026/10/08 16:41 | tool | grepper |
0mArgs:{
"Expression": "BPF_(ANY|NOEXIST|EXIST|F_CPU|F_ALL_CPUS)",
"PathPrefixes": [
"include/uapi/linux/bpf.h"
]
}Results: {
"Output": "include/uapi/linux/bpf.h=132=union bpf_iter_link_info {\n--\ninclude/uapi/linux/bpf.h-203- *\ninclude/uapi/linux/bpf.h:204: *\t\t**BPF_ANY**\ninclude/uapi/linux/bpf.h-205- *\t\t\tCreate a new element or update an existing element.\ninclude/uapi/linux/bpf.h:206: *\t\t**BPF_NOEXIST**\ninclude/uapi/linux/bpf.h-207- *\t\t\tCreate a new element only if it did not exist.\ninclude/uapi/linux/bpf.h:208: *\t\t**BPF_EXIST**\ninclude/uapi/linux/bpf.h-209- *\t\t\tUpdate an existing element.\n--\ninclude/uapi/linux/bpf.h-223- *\t\t**EEXIST**\ninclude/uapi/linux/bpf.h:224: *\t\t\tIf *flags* specifies **BPF_NOEXIST** and the element\ninclude/uapi/linux/bpf.h-225- *\t\t\twith *key* already exists in the map.\ninclude/uapi/linux/bpf.h-226- *\t\t**ENOENT**\ninclude/uapi/linux/bpf.h:227: *\t\t\tIf *flags* specifies **BPF_EXIST** and the element with\ninclude/uapi/linux/bpf.h-228- *\t\t\t*key* does not exist in the map.\n--\ninclude/uapi/linux/bpf.h-723- *\ninclude/uapi/linux/bpf.h:724: *\t\t**BPF_ANY**\ninclude/uapi/linux/bpf.h-725- *\t\t\tCreate new elements or update a existing elements.\ninclude/uapi/linux/bpf.h:726: *\t\t**BPF_NOEXIST**\ninclude/uapi/linux/bpf.h-727- *\t\t\tCreate new elements only if they do not exist.\ninclude/uapi/linux/bpf.h:728: *\t\t**BPF_EXIST**\ninclude/uapi/linux/bpf.h-729- *\t\t\tUpdate existing elements.\n--\ninclude/uapi/linux/bpf.h-751- *\t\t**EEXIST**\ninclude/uapi/linux/bpf.h:752: *\t\t\tIf *flags* specifies **BPF_NOEXIST** and the element\ninclude/uapi/linux/bpf.h-753- *\t\t\twith *key* already exists in the map.\ninclude/uapi/linux/bpf.h-754- *\t\t**ENOENT**\ninclude/uapi/linux/bpf.h:755: *\t\t\tIf *flags* specifies **BPF_EXIST** and the element with\ninclude/uapi/linux/bpf.h-756- *\t\t\t*key* does not exist in the map.\n--\ninclude/uapi/linux/bpf.h=1401=enum {\ninclude/uapi/linux/bpf.h:1402:\tBPF_ANY\t\t= 0, /* create new element or update existing */\ninclude/uapi/linux/bpf.h:1403:\tBPF_NOEXIST\t= 1, /* create new element if it didn't exist */\ninclude/uapi/linux/bpf.h:1404:\tBPF_EXIST\t= 2, /* update existing element */\ninclude/uapi/linux/bpf.h-1405-\tBPF_F_LOCK\t= 4, /* spin_lock-ed map_lookup/map_update */\ninclude/uapi/linux/bpf.h:1406:\tBPF_F_CPU\t= 8, /* cpu flag for percpu maps, upper 32-bit of flags is a cpu number */\ninclude/uapi/linux/bpf.h:1407:\tBPF_F_ALL_CPUS\t= 16, /* update value across all CPUs for percpu maps */\ninclude/uapi/linux/bpf.h-1408-};\n--\ninclude/uapi/linux/bpf.h=1527=union bpf_attr {\n--\ninclude/uapi/linux/bpf.h-1983- *\ninclude/uapi/linux/bpf.h:1984: * \t\t**BPF_NOEXIST**\ninclude/uapi/linux/bpf.h-1985- * \t\t\tThe entry for *key* must not exist in the map.\ninclude/uapi/linux/bpf.h:1986: * \t\t**BPF_EXIST**\ninclude/uapi/linux/bpf.h-1987- * \t\t\tThe entry for *key* must already exist in the map.\ninclude/uapi/linux/bpf.h:1988: * \t\t**BPF_ANY**\ninclude/uapi/linux/bpf.h-1989- * \t\t\tNo condition on the existence of the entry for *key*.\ninclude/uapi/linux/bpf.h-1990- *\ninclude/uapi/linux/bpf.h:1991: * \t\tFlag value **BPF_NOEXIST** cannot be used for maps of types\ninclude/uapi/linux/bpf.h-1992- * \t\t**BPF_MAP_TYPE_ARRAY** or **BPF_MAP_TYPE_PERCPU_ARRAY** (all\n--\ninclude/uapi/linux/bpf.h-3119- *\ninclude/uapi/linux/bpf.h:3120: * \t\t**BPF_NOEXIST**\ninclude/uapi/linux/bpf.h-3121- * \t\t\tThe entry for *key* must not exist in the map.\ninclude/uapi/linux/bpf.h:3122: * \t\t**BPF_EXIST**\ninclude/uapi/linux/bpf.h-3123- * \t\t\tThe entry for *key* must already exist in the map.\ninclude/uapi/linux/bpf.h:3124: * \t\t**BPF_ANY**\ninclude/uapi/linux/bpf.h-3125- * \t\t\tNo condition on the existence of the entry for *key*.\n--\ninclude/uapi/linux/bpf.h-3619- *\ninclude/uapi/linux/bpf.h:3620: *\t\t**BPF_NOEXIST**\ninclude/uapi/linux/bpf.h-3621- *\t\t\tThe entry for *key* must not exist in the map.\ninclude/uapi/linux/bpf.h:3622: *\t\t**BPF_EXIST**\ninclude/uapi/linux/bpf.h-3623- *\t\t\tThe entry for *key* must already exist in the map.\ninclude/uapi/linux/bpf.h:3624: *\t\t**BPF_ANY**\ninclude/uapi/linux/bpf.h-3625- *\t\t\tNo condition on the existence of the entry for *key*.\n--\ninclude/uapi/linux/bpf.h-3957- *\ninclude/uapi/linux/bpf.h:3958: * \t\t**BPF_EXIST**\ninclude/uapi/linux/bpf.h-3959- * \t\t\tIf the queue/stack is full, the oldest element is\n"
} |
| 51/3 | 2026/10/08 16:41 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 9452 output: 37 thoughts: 482 |
| 52/3 | 2026/10/08 16:41 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/arraymap.c",
"FirstLine": 430,
"LineCount": 40
}Results: {
"Contents": " 430:\t\n 431:\tint bpf_percpu_array_update(struct bpf_map *map, void *key, void *value,\n 432:\t\t\t\t u64 map_flags)\n 433:\t{\n 434:\t\tstruct bpf_array *array = container_of(map, struct bpf_array, map);\n 435:\t\tu32 index = *(u32 *)key;\n 436:\t\tvoid __percpu *pptr;\n 437:\t\tvoid *ptr, *val;\n 438:\t\tu32 size;\n 439:\t\tint cpu, off = 0;\n 440:\t\n 441:\t\tif (unlikely(((map_flags \u0026 BPF_EXIST_FLAGS) == BPF_EXIST_FLAGS) ||\n 442:\t\t\t ((u32)map_flags \u0026 ~(BPF_EXIST_FLAGS | BPF_CPU_FLAGS))))\n 443:\t\t\treturn -EINVAL;\n 444:\t\n 445:\t\tif (unlikely(index \u003e= array-\u003emap.max_entries))\n 446:\t\t\t/* all elements were pre-allocated, cannot insert a new one */\n 447:\t\t\treturn -E2BIG;\n 448:\t\n 449:\t\tif (unlikely(map_flags \u0026 BPF_NOEXIST))\n 450:\t\t\t/* all elements already exist */\n 451:\t\t\treturn -EEXIST;\n 452:\t\n 453:\t\t/* the user space will provide round_up(value_size, 8) bytes that\n 454:\t\t * will be copied into per-cpu area. bpf programs can only access\n 455:\t\t * value_size of it. During lookup the same extra bytes will be\n 456:\t\t * returned or zeros which were zero-filled by percpu_alloc,\n 457:\t\t * so no kernel data leaks possible\n 458:\t\t */\n 459:\t\tsize = array-\u003eelem_size;\n 460:\t\trcu_read_lock();\n 461:\t\tpptr = array-\u003epptrs[index \u0026 array-\u003eindex_mask];\n 462:\t\tif (map_flags \u0026 BPF_F_CPU) {\n 463:\t\t\tcpu = map_flags \u003e\u003e 32;\n 464:\t\t\tptr = per_cpu_ptr(pptr, cpu);\n 465:\t\t\tcopy_map_value(map, ptr, value);\n 466:\t\t\tbpf_obj_cancel_fields(map, ptr);\n 467:\t\t\tgoto unlock;\n 468:\t\t}\n 469:\t\tfor_each_possible_cpu(cpu) {\n"
} |
| 53/3 | 2026/10/08 16:41 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10659 output: 38 thoughts: 15 |
| 54/3 | 2026/10/08 16:41 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 1175,
"LineCount": 40
}Results: {
"Contents": "1175:\tdec_count:\n1176:\t\tdec_elem_count(htab);\n1177:\t\treturn l_new;\n1178:\t}\n1179:\t\n1180:\tstatic int check_flags(struct bpf_htab *htab, struct htab_elem *l_old,\n1181:\t\t\t u64 map_flags)\n1182:\t{\n1183:\t\tif (l_old \u0026\u0026 (map_flags \u0026 BPF_NOEXIST))\n1184:\t\t\t/* elem already exists */\n1185:\t\t\treturn -EEXIST;\n1186:\t\n1187:\t\tif (!l_old \u0026\u0026 (map_flags \u0026 BPF_EXIST))\n1188:\t\t\t/* elem doesn't exist, cannot update it */\n1189:\t\t\treturn -ENOENT;\n1190:\t\n1191:\t\treturn 0;\n1192:\t}\n1193:\t\n1194:\t/* Called from syscall or from eBPF program */\n1195:\tstatic long htab_map_update_elem(struct bpf_map *map, void *key, void *value,\n1196:\t\t\t\t\t u64 map_flags)\n1197:\t{\n1198:\t\tstruct bpf_htab *htab = container_of(map, struct bpf_htab, map);\n1199:\t\tstruct htab_elem *l_new, *l_old;\n1200:\t\tstruct hlist_nulls_head *head;\n1201:\t\tunsigned long flags;\n1202:\t\tstruct bucket *b;\n1203:\t\tu32 key_size, hash;\n1204:\t\tint ret;\n1205:\t\n1206:\t\tif (unlikely((map_flags \u0026 ~BPF_F_LOCK) \u003e BPF_EXIST))\n1207:\t\t\t/* unknown flags */\n1208:\t\t\treturn -EINVAL;\n1209:\t\n1210:\t\tWARN_ON_ONCE(!bpf_rcu_lock_held());\n1211:\t\n1212:\t\tkey_size = map-\u003ekey_size;\n1213:\t\n1214:\t\thash = htab_map_hash(key, key_size, htab-\u003ehashrnd);\n"
} |
| 55/3 | 2026/10/08 16:41 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11321 output: 38 thoughts: 46 |
| 56/3 | 2026/10/08 16:41 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 1365,
"LineCount": 50
}Results: {
"Contents": "1365:\t\treturn ret;\n1366:\t}\n1367:\t\n1368:\tstatic int htab_map_check_update_flags(bool onallcpus, u64 map_flags)\n1369:\t{\n1370:\t\tif (unlikely((map_flags \u0026 BPF_EXIST_FLAGS) == BPF_EXIST_FLAGS))\n1371:\t\t\treturn -EINVAL;\n1372:\t\tif (unlikely(!onallcpus \u0026\u0026 map_flags \u003e BPF_EXIST))\n1373:\t\t\treturn -EINVAL;\n1374:\t\tif (unlikely(onallcpus \u0026\u0026 ((u32)map_flags \u0026 ~(BPF_EXIST_FLAGS | BPF_CPU_FLAGS))))\n1375:\t\t\treturn -EINVAL;\n1376:\t\treturn 0;\n1377:\t}\n1378:\t\n1379:\tstatic long htab_map_update_elem_in_place(struct bpf_map *map, void *key,\n1380:\t\t\t\t\t\t void *value, u64 map_flags,\n1381:\t\t\t\t\t\t bool percpu, bool onallcpus)\n1382:\t{\n1383:\t\tstruct bpf_htab *htab = container_of(map, struct bpf_htab, map);\n1384:\t\tstruct htab_elem *l_new, *l_old;\n1385:\t\tstruct hlist_nulls_head *head;\n1386:\t\tvoid *old_map_ptr = NULL;\n1387:\t\tunsigned long flags;\n1388:\t\tstruct bucket *b;\n1389:\t\tu32 key_size, hash;\n1390:\t\tint ret;\n1391:\t\n1392:\t\tret = htab_map_check_update_flags(onallcpus, map_flags);\n1393:\t\tif (unlikely(ret))\n1394:\t\t\treturn ret;\n1395:\t\n1396:\t\tWARN_ON_ONCE(!bpf_rcu_lock_held());\n1397:\t\n1398:\t\tkey_size = map-\u003ekey_size;\n1399:\t\n1400:\t\thash = htab_map_hash(key, key_size, htab-\u003ehashrnd);\n1401:\t\n1402:\t\tb = __select_bucket(htab, hash);\n1403:\t\thead = \u0026b-\u003ehead;\n1404:\t\n1405:\t\tret = htab_lock_bucket(b, \u0026flags);\n1406:\t\tif (ret)\n1407:\t\t\treturn ret;\n1408:\t\n1409:\t\tl_old = lookup_elem_raw(head, hash, key, key_size);\n1410:\t\n1411:\t\tret = check_flags(htab, l_old, map_flags);\n1412:\t\tif (ret)\n1413:\t\t\tgoto err;\n1414:\t\n"
} |
| 57/3 | 2026/10/08 16:41 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 12193 output: 38 thoughts: 29 |
| 58/3 | 2026/10/08 16:41 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 1450,
"LineCount": 40
}Results: {
"Contents": "1450:\t\tstruct bucket *b;\n1451:\t\tu32 key_size, hash;\n1452:\t\tint ret;\n1453:\t\n1454:\t\tret = htab_map_check_update_flags(onallcpus, map_flags);\n1455:\t\tif (unlikely(ret))\n1456:\t\t\treturn ret;\n1457:\t\n1458:\t\tWARN_ON_ONCE(!bpf_rcu_lock_held());\n1459:\t\n1460:\t\tkey_size = map-\u003ekey_size;\n1461:\t\n1462:\t\thash = htab_map_hash(key, key_size, htab-\u003ehashrnd);\n1463:\t\n1464:\t\tb = __select_bucket(htab, hash);\n1465:\t\thead = \u0026b-\u003ehead;\n1466:\t\n1467:\t\t/* For LRU, we need to alloc before taking bucket's\n1468:\t\t * spinlock because LRU's elem alloc may need\n1469:\t\t * to remove older elem from htab and this removal\n1470:\t\t * operation will need a bucket lock.\n1471:\t\t */\n1472:\t\tif (!(map_flags \u0026 BPF_EXIST)) {\n1473:\t\t\tl_new = prealloc_lru_pop(htab, key, hash);\n1474:\t\t\tif (!l_new)\n1475:\t\t\t\treturn -ENOMEM;\n1476:\t\t}\n1477:\t\n1478:\t\tret = htab_lock_bucket(b, \u0026flags);\n1479:\t\tif (ret)\n1480:\t\t\tgoto err_lock_bucket;\n1481:\t\n1482:\t\tl_old = lookup_elem_raw(head, hash, key, key_size);\n1483:\t\n1484:\t\tret = check_flags(htab, l_old, map_flags);\n1485:\t\tif (ret)\n1486:\t\t\tgoto err;\n1487:\t\n1488:\t\tif (l_old) {\n1489:\t\t\tbpf_lru_node_set_ref(\u0026l_old-\u003elru_node);\n"
} |
| 59/3 | 2026/10/08 16:41 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 12856 output: 37 thoughts: 52 |
| 60/3 | 2026/10/08 16:41 | tool | read-file |
0mArgs:{
"File": "include/linux/bpf.h",
"FirstLine": 4225,
"LineCount": 40
}Results: {
"Contents": "4225:\t\t\treturn true;\n4226:\t\tdefault:\n4227:\t\t\treturn false;\n4228:\t\t}\n4229:\t}\n4230:\t\n4231:\t#define BPF_EXIST_FLAGS\t\t(BPF_EXIST | BPF_NOEXIST)\n4232:\t#define BPF_CPU_FLAGS\t\t(BPF_F_CPU | BPF_F_ALL_CPUS)\n4233:\t\n4234:\tstatic inline int bpf_map_check_op_flags(struct bpf_map *map, u64 flags, u64 allowed_flags)\n4235:\t{\n4236:\t\tu32 cpu;\n4237:\t\n4238:\t\tif ((u32)flags \u0026 ~allowed_flags)\n4239:\t\t\treturn -EINVAL;\n4240:\t\n4241:\t\tif ((flags \u0026 BPF_F_LOCK) \u0026\u0026 !btf_record_has_field(map-\u003erecord, BPF_SPIN_LOCK))\n4242:\t\t\treturn -EINVAL;\n4243:\t\n4244:\t\tif (!(flags \u0026 BPF_F_CPU) \u0026\u0026 flags \u003e\u003e 32)\n4245:\t\t\treturn -EINVAL;\n4246:\t\n4247:\t\tif (flags \u0026 (BPF_F_CPU | BPF_F_ALL_CPUS)) {\n4248:\t\t\tif (!bpf_map_is_percpu_map(map-\u003emap_type))\n4249:\t\t\t\treturn -EINVAL;\n4250:\t\t\tif ((flags \u0026 BPF_F_CPU) \u0026\u0026 (flags \u0026 BPF_F_ALL_CPUS))\n4251:\t\t\t\treturn -EINVAL;\n4252:\t\n4253:\t\t\tcpu = flags \u003e\u003e 32;\n4254:\t\t\tif ((flags \u0026 BPF_F_CPU) \u0026\u0026 (cpu \u003e= nr_cpu_ids || !cpu_possible(cpu)))\n4255:\t\t\t\treturn -ERANGE;\n4256:\t\t}\n4257:\t\n4258:\t\treturn 0;\n4259:\t}\n4260:\t\n4261:\t#endif /* _LINUX_BPF_H */\n"
} |
| 61/3 | 2026/10/08 16:41 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13532 output: 24 thoughts: 23 |
| 62/3 | 2026/10/08 16:41 | tool | grepper |
0mArgs:{
"Expression": "bpf_map_check_op_flags"
}Results: {
"Output": "include/linux/bpf.h=4218=static inline bool bpf_map_is_percpu_map(enum bpf_map_type map_type)\n--\ninclude/linux/bpf.h-4233-\ninclude/linux/bpf.h:4234:static inline int bpf_map_check_op_flags(struct bpf_map *map, u64 flags, u64 allowed_flags)\ninclude/linux/bpf.h-4235-{\n--\nkernel/bpf/hashtab.c=1802=__htab_map_lookup_and_delete_batch(struct bpf_map *map,\n--\nkernel/bpf/hashtab.c-1829-\t\tallowed_flags |= BPF_F_CPU;\nkernel/bpf/hashtab.c:1830:\tret = bpf_map_check_op_flags(map, elem_map_flags, allowed_flags);\nkernel/bpf/hashtab.c-1831-\tif (ret)\n--\nkernel/bpf/hashtab.c=3018=static int rhtab_map_lookup_and_delete_elem(struct bpf_map *map, void *key, void *value, u64 flags)\n--\nkernel/bpf/hashtab.c-3023-\nkernel/bpf/hashtab.c:3024:\terr = bpf_map_check_op_flags(map, flags, BPF_F_LOCK);\nkernel/bpf/hashtab.c-3025-\tif (err)\n--\nkernel/bpf/hashtab.c=3276=static int __rhtab_map_lookup_and_delete_batch(struct bpf_map *map,\n--\nkernel/bpf/hashtab.c-3293-\telem_map_flags = attr-\u003ebatch.elem_flags;\nkernel/bpf/hashtab.c:3294:\tret = bpf_map_check_op_flags(map, elem_map_flags, BPF_F_LOCK);\nkernel/bpf/hashtab.c-3295-\tif (ret)\n--\nkernel/bpf/syscall.c=1786=static int map_lookup_elem(union bpf_attr *attr)\n--\nkernel/bpf/syscall.c-1804-\nkernel/bpf/syscall.c:1805:\terr = bpf_map_check_op_flags(map, attr-\u003eflags, BPF_F_LOCK | BPF_F_CPU);\nkernel/bpf/syscall.c-1806-\tif (err)\n--\nkernel/bpf/syscall.c=1847=static int map_update_elem(union bpf_attr *attr, bpfptr_t uattr)\n--\nkernel/bpf/syscall.c-1868-\nkernel/bpf/syscall.c:1869:\terr = bpf_map_check_op_flags(map, attr-\u003eflags, ~0);\nkernel/bpf/syscall.c-1870-\tif (err)\n--\nkernel/bpf/syscall.c=2065=int generic_map_update_batch(struct bpf_map *map, struct file *map_file,\n--\nkernel/bpf/syscall.c-2074-\nkernel/bpf/syscall.c:2075:\terr = bpf_map_check_op_flags(map, attr-\u003ebatch.elem_flags,\nkernel/bpf/syscall.c-2076-\t\t\t\t BPF_F_LOCK | BPF_F_CPU | BPF_F_ALL_CPUS);\n--\nkernel/bpf/syscall.c=2123=int generic_map_lookup_batch(struct bpf_map *map,\n--\nkernel/bpf/syscall.c-2134-\nkernel/bpf/syscall.c:2135:\terr = bpf_map_check_op_flags(map, attr-\u003ebatch.elem_flags, BPF_F_LOCK | BPF_F_CPU);\nkernel/bpf/syscall.c-2136-\tif (err)\n"
} |
| 63/3 | 2026/10/08 16:41 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14620 output: 37 thoughts: 1090 |
| 64/3 | 2026/10/08 16:41 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/syscall.c",
"FirstLine": 1865,
"LineCount": 55
}Results: {
"Contents": "1865:\t\t\terr = -EPERM;\n1866:\t\t\tgoto err_put;\n1867:\t\t}\n1868:\t\n1869:\t\terr = bpf_map_check_op_flags(map, attr-\u003eflags, ~0);\n1870:\t\tif (err)\n1871:\t\t\tgoto err_put;\n1872:\t\n1873:\t\tkey = ___bpf_copy_key(ukey, map-\u003ekey_size);\n1874:\t\tif (IS_ERR(key)) {\n1875:\t\t\terr = PTR_ERR(key);\n1876:\t\t\tgoto err_put;\n1877:\t\t}\n1878:\t\n1879:\t\tvalue_size = bpf_map_value_size(map, attr-\u003eflags);\n1880:\t\tvalue = kvmemdup_bpfptr(uvalue, value_size);\n1881:\t\tif (IS_ERR(value)) {\n1882:\t\t\terr = PTR_ERR(value);\n1883:\t\t\tgoto free_key;\n1884:\t\t}\n1885:\t\n1886:\t\terr = bpf_map_update_value(map, fd_file(f), key, value, attr-\u003eflags);\n1887:\t\tif (!err)\n1888:\t\t\tmaybe_wait_bpf_programs(map);\n1889:\t\n1890:\t\tkvfree(value);\n1891:\tfree_key:\n1892:\t\tkvfree(key);\n1893:\terr_put:\n1894:\t\tbpf_map_write_active_dec(map);\n1895:\t\treturn err;\n1896:\t}\n1897:\t\n1898:\t#define BPF_MAP_DELETE_ELEM_LAST_FIELD key\n1899:\t\n1900:\tstatic int map_delete_elem(union bpf_attr *attr, bpfptr_t uattr)\n1901:\t{\n1902:\t\tbpfptr_t ukey = make_bpfptr(attr-\u003ekey, uattr.is_kernel);\n1903:\t\tstruct bpf_map *map;\n1904:\t\tvoid *key;\n1905:\t\tint err;\n1906:\t\n1907:\t\tif (CHECK_ATTR(BPF_MAP_DELETE_ELEM))\n1908:\t\t\treturn -EINVAL;\n1909:\t\n1910:\t\tCLASS(fd, f)(attr-\u003emap_fd);\n1911:\t\tmap = __bpf_map_get(f);\n1912:\t\tif (IS_ERR(map))\n1913:\t\t\treturn PTR_ERR(map);\n1914:\t\tbpf_map_write_active_inc(map);\n1915:\t\tif (!(map_get_sys_perms(map, f) \u0026 FMODE_CAN_WRITE)) {\n1916:\t\t\terr = -EPERM;\n1917:\t\t\tgoto err_put;\n1918:\t\t}\n1919:\t\n"
} |
| 65/3 | 2026/10/08 16:41 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 16557 output: 43 thoughts: 42 |
| 66/3 | 2026/10/08 16:42 | tool | grepper |
0mArgs:{
"Expression": "bpf_map_value_size|bpf_map_update_value",
"PathPrefixes": [
"kernel/bpf/"
]
}Results: {
"Output": "kernel/bpf/syscall.c=132=bool bpf_map_write_active(const struct bpf_map *map)\n--\nkernel/bpf/syscall.c-136-\nkernel/bpf/syscall.c:137:static u32 bpf_map_value_size(const struct bpf_map *map, u64 flags)\nkernel/bpf/syscall.c-138-{\n--\nkernel/bpf/syscall.c=196=static int bpf_obj_pin_uptrs(struct btf_record *rec, void *obj)\n--\nkernel/bpf/syscall.c-249-\nkernel/bpf/syscall.c:250:static int bpf_map_update_value(struct bpf_map *map, struct file *map_file,\nkernel/bpf/syscall.c-251-\t\t\t\tvoid *key, void *value, __u64 flags)\n--\nkernel/bpf/syscall.c=1786=static int map_lookup_elem(union bpf_attr *attr)\n--\nkernel/bpf/syscall.c-1812-\nkernel/bpf/syscall.c:1813:\tvalue_size = bpf_map_value_size(map, attr-\u003eflags);\nkernel/bpf/syscall.c-1814-\n--\nkernel/bpf/syscall.c=1847=static int map_update_elem(union bpf_attr *attr, bpfptr_t uattr)\n--\nkernel/bpf/syscall.c-1878-\nkernel/bpf/syscall.c:1879:\tvalue_size = bpf_map_value_size(map, attr-\u003eflags);\nkernel/bpf/syscall.c-1880-\tvalue = kvmemdup_bpfptr(uvalue, value_size);\n--\nkernel/bpf/syscall.c-1885-\nkernel/bpf/syscall.c:1886:\terr = bpf_map_update_value(map, fd_file(f), key, value, attr-\u003eflags);\nkernel/bpf/syscall.c-1887-\tif (!err)\n--\nkernel/bpf/syscall.c=2065=int generic_map_update_batch(struct bpf_map *map, struct file *map_file,\n--\nkernel/bpf/syscall.c-2079-\nkernel/bpf/syscall.c:2080:\tvalue_size = bpf_map_value_size(map, attr-\u003ebatch.elem_flags);\nkernel/bpf/syscall.c-2081-\n--\nkernel/bpf/syscall.c-2105-\nkernel/bpf/syscall.c:2106:\t\terr = bpf_map_update_value(map, map_file, key, value,\nkernel/bpf/syscall.c-2107-\t\t\t\t\t attr-\u003ebatch.elem_flags);\n--\nkernel/bpf/syscall.c=2123=int generic_map_lookup_batch(struct bpf_map *map,\n--\nkernel/bpf/syscall.c-2138-\nkernel/bpf/syscall.c:2139:\tvalue_size = bpf_map_value_size(map, attr-\u003ebatch.elem_flags);\nkernel/bpf/syscall.c-2140-\n--\nkernel/bpf/syscall.c=2216=static int map_lookup_and_delete_elem(union bpf_attr *attr)\n--\nkernel/bpf/syscall.c-2260-\nkernel/bpf/syscall.c:2261:\tvalue_size = bpf_map_value_size(map, 0);\nkernel/bpf/syscall.c-2262-\n"
} |
| 67/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 17588 output: 36 thoughts: 25 |
| 68/3 | 2026/10/08 16:42 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/syscall.c",
"FirstLine": 135,
"LineCount": 25
}Results: {
"Contents": " 135:\t}\n 136:\t\n 137:\tstatic u32 bpf_map_value_size(const struct bpf_map *map, u64 flags)\n 138:\t{\n 139:\t\tif (flags \u0026 (BPF_F_CPU | BPF_F_ALL_CPUS))\n 140:\t\t\treturn map-\u003evalue_size;\n 141:\t\telse if (map-\u003emap_type == BPF_MAP_TYPE_PERCPU_HASH ||\n 142:\t\t\t map-\u003emap_type == BPF_MAP_TYPE_LRU_PERCPU_HASH ||\n 143:\t\t\t map-\u003emap_type == BPF_MAP_TYPE_PERCPU_ARRAY ||\n 144:\t\t\t map-\u003emap_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE)\n 145:\t\t\treturn round_up(map-\u003evalue_size, 8) * num_possible_cpus();\n 146:\t\telse if (IS_FD_MAP(map))\n 147:\t\t\treturn sizeof(u32);\n 148:\t\telse\n 149:\t\t\treturn map-\u003evalue_size;\n 150:\t}\n 151:\t\n 152:\tstatic void maybe_wait_bpf_programs(struct bpf_map *map)\n 153:\t{\n 154:\t\t/* Wait for any running non-sleepable BPF programs to complete so that\n 155:\t\t * userspace, when we return to it, knows that all non-sleepable\n 156:\t\t * programs that could be running use the new map value. For sleepable\n 157:\t\t * BPF programs, synchronize_rcu_tasks_trace() should be used to wait\n 158:\t\t * for the completions of these programs, but considering the waiting\n 159:\t\t * time can be very long and userspace may think it will hang forever,\n"
} |
| 69/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18142 output: 36 thoughts: 14 |
| 70/3 | 2026/10/08 16:42 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/syscall.c",
"FirstLine": 245,
"LineCount": 40
}Results: {
"Contents": " 245:\tunpin_all:\n 246:\t\t__bpf_obj_unpin_uptrs(rec, i, obj);\n 247:\t\treturn err;\n 248:\t}\n 249:\t\n 250:\tstatic int bpf_map_update_value(struct bpf_map *map, struct file *map_file,\n 251:\t\t\t\t\tvoid *key, void *value, __u64 flags)\n 252:\t{\n 253:\t\tint err;\n 254:\t\n 255:\t\t/* Need to create a kthread, thus must support schedule */\n 256:\t\tif (bpf_map_is_offloaded(map)) {\n 257:\t\t\treturn bpf_map_offload_update_elem(map, key, value, flags);\n 258:\t\t} else if (map-\u003emap_type == BPF_MAP_TYPE_CPUMAP ||\n 259:\t\t\t map-\u003emap_type == BPF_MAP_TYPE_ARENA ||\n 260:\t\t\t map-\u003emap_type == BPF_MAP_TYPE_STRUCT_OPS) {\n 261:\t\t\treturn map-\u003eops-\u003emap_update_elem(map, key, value, flags);\n 262:\t\t} else if (map-\u003emap_type == BPF_MAP_TYPE_SOCKHASH ||\n 263:\t\t\t map-\u003emap_type == BPF_MAP_TYPE_SOCKMAP) {\n 264:\t\t\treturn sock_map_update_elem_sys(map, key, value, flags);\n 265:\t\t} else if (IS_FD_PROG_ARRAY(map)) {\n 266:\t\t\treturn bpf_fd_array_map_update_elem(map, map_file, key, value,\n 267:\t\t\t\t\t\t\t flags);\n 268:\t\t}\n 269:\t\n 270:\t\tbpf_disable_instrumentation();\n 271:\t\tif (map-\u003emap_type == BPF_MAP_TYPE_PERCPU_HASH ||\n 272:\t\t map-\u003emap_type == BPF_MAP_TYPE_LRU_PERCPU_HASH) {\n 273:\t\t\terr = bpf_percpu_hash_update(map, key, value, flags);\n 274:\t\t} else if (map-\u003emap_type == BPF_MAP_TYPE_PERCPU_ARRAY) {\n 275:\t\t\terr = bpf_percpu_array_update(map, key, value, flags);\n 276:\t\t} else if (map-\u003emap_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) {\n 277:\t\t\terr = bpf_percpu_cgroup_storage_update(map, key, value,\n 278:\t\t\t\t\t\t\t flags);\n 279:\t\t} else if (IS_FD_ARRAY(map)) {\n 280:\t\t\terr = bpf_fd_array_map_update_elem(map, map_file, key, value,\n 281:\t\t\t\t\t\t\t flags);\n 282:\t\t} else if (map-\u003emap_type == BPF_MAP_TYPE_HASH_OF_MAPS) {\n 283:\t\t\terr = bpf_fd_htab_map_update_elem(map, map_file, key, value,\n 284:\t\t\t\t\t\t\t flags);\n"
} |
| 71/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 19042 output: 35 thoughts: 18 |
| 72/3 | 2026/10/08 16:42 | tool | grepper |
0mArgs:{
"Expression": "bpf_percpu_hash_update",
"PathPrefixes": [
"kernel/bpf/"
]
}Results: {
"Output": "kernel/bpf/hashtab.c=2517=int bpf_percpu_hash_copy(struct bpf_map *map, void *key, void *value, u64 map_flags)\n--\nkernel/bpf/hashtab.c-2554-\nkernel/bpf/hashtab.c:2555:int bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value,\nkernel/bpf/hashtab.c-2556-\t\t\t u64 map_flags)\n--\nkernel/bpf/syscall.c=250=static int bpf_map_update_value(struct bpf_map *map, struct file *map_file,\n--\nkernel/bpf/syscall.c-272-\t map-\u003emap_type == BPF_MAP_TYPE_LRU_PERCPU_HASH) {\nkernel/bpf/syscall.c:273:\t\terr = bpf_percpu_hash_update(map, key, value, flags);\nkernel/bpf/syscall.c-274-\t} else if (map-\u003emap_type == BPF_MAP_TYPE_PERCPU_ARRAY) {\n"
} |
| 73/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 19398 output: 38 thoughts: 27 |
| 74/3 | 2026/10/08 16:42 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 2550,
"LineCount": 45
}Results: {
"Contents": "2550:\tout:\n2551:\t\trcu_read_unlock();\n2552:\t\treturn ret;\n2553:\t}\n2554:\t\n2555:\tint bpf_percpu_hash_update(struct bpf_map *map, void *key, void *value,\n2556:\t\t\t\t u64 map_flags)\n2557:\t{\n2558:\t\tstruct bpf_htab *htab = container_of(map, struct bpf_htab, map);\n2559:\t\tint ret;\n2560:\t\n2561:\t\trcu_read_lock();\n2562:\t\tif (htab_is_lru(htab))\n2563:\t\t\tret = __htab_lru_percpu_map_update_elem(map, key, value,\n2564:\t\t\t\t\t\t\t\tmap_flags, true);\n2565:\t\telse\n2566:\t\t\tret = htab_map_update_elem_in_place(map, key, value, map_flags,\n2567:\t\t\t\t\t\t\t true, true);\n2568:\t\trcu_read_unlock();\n2569:\t\n2570:\t\treturn ret;\n2571:\t}\n2572:\t\n2573:\tstatic void htab_percpu_map_seq_show_elem(struct bpf_map *map, void *key,\n2574:\t\t\t\t\t\t struct seq_file *m)\n2575:\t{\n2576:\t\tstruct htab_elem *l;\n2577:\t\tvoid __percpu *pptr;\n2578:\t\tint cpu;\n2579:\t\n2580:\t\trcu_read_lock();\n2581:\t\n2582:\t\tl = __htab_map_lookup_elem(map, key);\n2583:\t\tif (!l) {\n2584:\t\t\trcu_read_unlock();\n2585:\t\t\treturn;\n2586:\t\t}\n2587:\t\n2588:\t\tbtf_type_seq_show(map-\u003ebtf, map-\u003ebtf_key_type_id, key, m);\n2589:\t\tseq_puts(m, \": {\\n\");\n2590:\t\tpptr = htab_elem_get_ptr(l, map-\u003ekey_size);\n2591:\t\tfor_each_possible_cpu(cpu) {\n2592:\t\t\tseq_printf(m, \"\\tcpu%d: \", cpu);\n2593:\t\t\tbtf_type_seq_show(map-\u003ebtf, map-\u003ebtf_value_type_id,\n2594:\t\t\t\t\t per_cpu_ptr(pptr, cpu), m);\n"
} |
| 75/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20178 output: 38 thoughts: 45 |
| 76/3 | 2026/10/08 16:42 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 1410,
"LineCount": 45
}Results: {
"Contents": "1410:\t\n1411:\t\tret = check_flags(htab, l_old, map_flags);\n1412:\t\tif (ret)\n1413:\t\t\tgoto err;\n1414:\t\n1415:\t\tif (l_old) {\n1416:\t\t\t/* Update value in-place */\n1417:\t\t\tif (percpu) {\n1418:\t\t\t\tpcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size),\n1419:\t\t\t\t\t\tvalue, onallcpus, map_flags);\n1420:\t\t\t} else {\n1421:\t\t\t\tvoid **inner_map_pptr = htab_elem_value(l_old, key_size);\n1422:\t\n1423:\t\t\t\told_map_ptr = *inner_map_pptr;\n1424:\t\t\t\tWRITE_ONCE(*inner_map_pptr, *(void **)value);\n1425:\t\t\t}\n1426:\t\t} else {\n1427:\t\t\tl_new = alloc_htab_elem(htab, key, value, key_size,\n1428:\t\t\t\t\t\thash, percpu, onallcpus, NULL, map_flags);\n1429:\t\t\tif (IS_ERR(l_new)) {\n1430:\t\t\t\tret = PTR_ERR(l_new);\n1431:\t\t\t\tgoto err;\n1432:\t\t\t}\n1433:\t\t\thlist_nulls_add_head_rcu(\u0026l_new-\u003ehash_node, head);\n1434:\t\t}\n1435:\terr:\n1436:\t\thtab_unlock_bucket(b, flags);\n1437:\t\tif (old_map_ptr)\n1438:\t\t\tmap-\u003eops-\u003emap_fd_put_ptr(map, old_map_ptr, true);\n1439:\t\treturn ret;\n1440:\t}\n1441:\t\n1442:\tstatic long __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\n1443:\t\t\t\t\t\t void *value, u64 map_flags,\n1444:\t\t\t\t\t\t bool onallcpus)\n1445:\t{\n1446:\t\tstruct bpf_htab *htab = container_of(map, struct bpf_htab, map);\n1447:\t\tstruct htab_elem *l_new = NULL, *l_old;\n1448:\t\tstruct hlist_nulls_head *head;\n1449:\t\tunsigned long flags;\n1450:\t\tstruct bucket *b;\n1451:\t\tu32 key_size, hash;\n1452:\t\tint ret;\n1453:\t\n1454:\t\tret = htab_map_check_update_flags(onallcpus, map_flags);\n"
} |
| 77/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21013 output: 36 thoughts: 21 |
| 78/3 | 2026/10/08 16:42 | tool | grepper |
0mArgs:{
"Expression": "pcpu_copy_value",
"PathPrefixes": [
"kernel/bpf/hashtab.c"
]
}Results: {
"Output": "kernel/bpf/hashtab.c=1019=static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l)\n--\nkernel/bpf/hashtab.c-1032-\nkernel/bpf/hashtab.c:1033:static void pcpu_copy_value(struct bpf_htab *htab, void __percpu *pptr,\nkernel/bpf/hashtab.c-1034-\t\t\t void *value, bool onallcpus, u64 map_flags)\n--\nkernel/bpf/hashtab.c=1066=static void pcpu_init_value(struct bpf_htab *htab, void __percpu *pptr,\n--\nkernel/bpf/hashtab.c-1087-\t} else {\nkernel/bpf/hashtab.c:1088:\t\tpcpu_copy_value(htab, pptr, value, onallcpus, map_flags);\nkernel/bpf/hashtab.c-1089-\t}\n--\nkernel/bpf/hashtab.c=1379=static long htab_map_update_elem_in_place(struct bpf_map *map, void *key,\n--\nkernel/bpf/hashtab.c-1417-\t\tif (percpu) {\nkernel/bpf/hashtab.c:1418:\t\t\tpcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size),\nkernel/bpf/hashtab.c-1419-\t\t\t\t\tvalue, onallcpus, map_flags);\n--\nkernel/bpf/hashtab.c=1442=static long __htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\n--\nkernel/bpf/hashtab.c-1491-\t\t/* per-cpu hash map can update value in-place */\nkernel/bpf/hashtab.c:1492:\t\tpcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size),\nkernel/bpf/hashtab.c-1493-\t\t\t\tvalue, onallcpus, map_flags);\n"
} |
| 79/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21641 output: 38 thoughts: 21 |
| 80/3 | 2026/10/08 16:42 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 1030,
"LineCount": 60
}Results: {
"Contents": "1030:\t\t}\n1031:\t}\n1032:\t\n1033:\tstatic void pcpu_copy_value(struct bpf_htab *htab, void __percpu *pptr,\n1034:\t\t\t\t void *value, bool onallcpus, u64 map_flags)\n1035:\t{\n1036:\t\tvoid *ptr;\n1037:\t\n1038:\t\tif (!onallcpus) {\n1039:\t\t\t/* copy true value_size bytes */\n1040:\t\t\tptr = this_cpu_ptr(pptr);\n1041:\t\t\tcopy_map_value(\u0026htab-\u003emap, ptr, value);\n1042:\t\t\tbpf_obj_cancel_fields(\u0026htab-\u003emap, ptr);\n1043:\t\t} else {\n1044:\t\t\tu32 size = round_up(htab-\u003emap.value_size, 8);\n1045:\t\t\tvoid *val;\n1046:\t\t\tint cpu, off = 0;\n1047:\t\n1048:\t\t\tif (map_flags \u0026 BPF_F_CPU) {\n1049:\t\t\t\tcpu = map_flags \u003e\u003e 32;\n1050:\t\t\t\tptr = per_cpu_ptr(pptr, cpu);\n1051:\t\t\t\tcopy_map_value(\u0026htab-\u003emap, ptr, value);\n1052:\t\t\t\tbpf_obj_cancel_fields(\u0026htab-\u003emap, ptr);\n1053:\t\t\t\treturn;\n1054:\t\t\t}\n1055:\t\n1056:\t\t\tfor_each_possible_cpu(cpu) {\n1057:\t\t\t\tptr = per_cpu_ptr(pptr, cpu);\n1058:\t\t\t\tval = (map_flags \u0026 BPF_F_ALL_CPUS) ? value : value + off;\n1059:\t\t\t\tcopy_map_value(\u0026htab-\u003emap, ptr, val);\n1060:\t\t\t\tbpf_obj_cancel_fields(\u0026htab-\u003emap, ptr);\n1061:\t\t\t\toff += size;\n1062:\t\t\t}\n1063:\t\t}\n1064:\t}\n1065:\t\n1066:\tstatic void pcpu_init_value(struct bpf_htab *htab, void __percpu *pptr,\n1067:\t\t\t\t void *value, bool onallcpus, u64 map_flags)\n1068:\t{\n1069:\t\t/* When not setting the initial value on all cpus, zero-fill element\n1070:\t\t * values for other cpus. Otherwise, bpf program has no way to ensure\n1071:\t\t * known initial values for cpus other than current one\n1072:\t\t * (onallcpus=false always when coming from bpf prog,\n1073:\t\t * map_flags \u0026 BPF_F_CPU when coming from syscall but setting\n1074:\t\t * only one cpu).\n1075:\t\t */\n1076:\t\tif (!onallcpus || (map_flags \u0026 BPF_F_CPU)) {\n1077:\t\t\tint init_cpu = (map_flags \u0026 BPF_F_CPU) ? map_flags \u003e\u003e 32 :\n1078:\t\t\t\t raw_smp_processor_id();\n1079:\t\t\tint cpu;\n1080:\t\n1081:\t\t\tfor_each_possible_cpu(cpu) {\n1082:\t\t\t\tif (cpu == init_cpu)\n1083:\t\t\t\t\tcopy_map_value(\u0026htab-\u003emap, per_cpu_ptr(pptr, cpu), value);\n1084:\t\t\t\telse /* Since elem is preallocated, we cannot touch special fields */\n1085:\t\t\t\t\tzero_map_value(\u0026htab-\u003emap, per_cpu_ptr(pptr, cpu));\n1086:\t\t\t}\n1087:\t\t} else {\n1088:\t\t\tpcpu_copy_value(htab, pptr, value, onallcpus, map_flags);\n1089:\t\t}\n"
} |
| 81/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22734 output: 38 thoughts: 115 |
| 82/3 | 2026/10/08 16:42 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 1140,
"LineCount": 40
}Results: {
"Contents": "1140:\t\n1141:\t\tmemcpy(l_new-\u003ekey, key, key_size);\n1142:\t\tif (percpu) {\n1143:\t\t\tif (prealloc) {\n1144:\t\t\t\tpptr = htab_elem_get_ptr(l_new, key_size);\n1145:\t\t\t} else {\n1146:\t\t\t\t/* alloc_percpu zero-fills */\n1147:\t\t\t\tvoid *ptr = bpf_mem_cache_alloc(\u0026htab-\u003epcpu_ma);\n1148:\t\n1149:\t\t\t\tif (!ptr) {\n1150:\t\t\t\t\tbpf_mem_cache_free(\u0026htab-\u003ema, l_new);\n1151:\t\t\t\t\tl_new = ERR_PTR(-ENOMEM);\n1152:\t\t\t\t\tgoto dec_count;\n1153:\t\t\t\t}\n1154:\t\t\t\tl_new-\u003eptr_to_pptr = ptr;\n1155:\t\t\t\tpptr = *(void __percpu **)ptr;\n1156:\t\t\t}\n1157:\t\n1158:\t\t\tpcpu_init_value(htab, pptr, value, onallcpus, map_flags);\n1159:\t\n1160:\t\t\tif (!prealloc)\n1161:\t\t\t\thtab_elem_set_ptr(l_new, key_size, pptr);\n1162:\t\t} else if (fd_htab_map_needs_adjust(htab)) {\n1163:\t\t\tsize = round_up(size, 8);\n1164:\t\t\tmemcpy(htab_elem_value(l_new, key_size), value, size);\n1165:\t\t} else if (map_flags \u0026 BPF_F_LOCK) {\n1166:\t\t\tcopy_map_value_locked(\u0026htab-\u003emap,\n1167:\t\t\t\t\t htab_elem_value(l_new, key_size),\n1168:\t\t\t\t\t value, false);\n1169:\t\t} else {\n1170:\t\t\tcopy_map_value(\u0026htab-\u003emap, htab_elem_value(l_new, key_size), value);\n1171:\t\t}\n1172:\t\n1173:\t\tl_new-\u003ehash = hash;\n1174:\t\treturn l_new;\n1175:\tdec_count:\n1176:\t\tdec_elem_count(htab);\n1177:\t\treturn l_new;\n1178:\t}\n1179:\t\n"
} |
| 83/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 23539 output: 38 thoughts: 569 |
| 84/3 | 2026/10/08 16:42 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/hashtab.c",
"FirstLine": 1475,
"LineCount": 45
}Results: {
"Contents": "1475:\t\t\t\treturn -ENOMEM;\n1476:\t\t}\n1477:\t\n1478:\t\tret = htab_lock_bucket(b, \u0026flags);\n1479:\t\tif (ret)\n1480:\t\t\tgoto err_lock_bucket;\n1481:\t\n1482:\t\tl_old = lookup_elem_raw(head, hash, key, key_size);\n1483:\t\n1484:\t\tret = check_flags(htab, l_old, map_flags);\n1485:\t\tif (ret)\n1486:\t\t\tgoto err;\n1487:\t\n1488:\t\tif (l_old) {\n1489:\t\t\tbpf_lru_node_set_ref(\u0026l_old-\u003elru_node);\n1490:\t\n1491:\t\t\t/* per-cpu hash map can update value in-place */\n1492:\t\t\tpcpu_copy_value(htab, htab_elem_get_ptr(l_old, key_size),\n1493:\t\t\t\t\tvalue, onallcpus, map_flags);\n1494:\t\t} else {\n1495:\t\t\tpcpu_init_value(htab, htab_elem_get_ptr(l_new, key_size),\n1496:\t\t\t\t\tvalue, onallcpus, map_flags);\n1497:\t\t\thlist_nulls_add_head_rcu(\u0026l_new-\u003ehash_node, head);\n1498:\t\t\tl_new = NULL;\n1499:\t\t}\n1500:\t\tret = 0;\n1501:\terr:\n1502:\t\thtab_unlock_bucket(b, flags);\n1503:\terr_lock_bucket:\n1504:\t\tif (l_new) {\n1505:\t\t\tbpf_map_dec_elem_count(\u0026htab-\u003emap);\n1506:\t\t\tbpf_lru_push_free(\u0026htab-\u003elru, \u0026l_new-\u003elru_node);\n1507:\t\t}\n1508:\t\treturn ret;\n1509:\t}\n1510:\t\n1511:\tstatic long htab_percpu_map_update_elem(struct bpf_map *map, void *key,\n1512:\t\t\t\t\t\tvoid *value, u64 map_flags)\n1513:\t{\n1514:\t\treturn htab_map_update_elem_in_place(map, key, value, map_flags, true, false);\n1515:\t}\n1516:\t\n1517:\tstatic long htab_lru_percpu_map_update_elem(struct bpf_map *map, void *key,\n1518:\t\t\t\t\t\t void *value, u64 map_flags)\n1519:\t{\n"
} |
| 85/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24887 output: 26 thoughts: 274 |
| 86/3 | 2026/10/08 16:42 | tool | grepper |
0mArgs:{
"Expression": "bpf_percpu_cgroup_storage_update"
}Results: {
"Output": "include/linux/bpf-cgroup.h=175=int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, void *value, u64 flags);\ninclude/linux/bpf-cgroup.h:176:int bpf_percpu_cgroup_storage_update(struct bpf_map *map, void *key,\ninclude/linux/bpf-cgroup.h-177-\t\t\t\t void *value, u64 flags);\n--\ninclude/linux/bpf-cgroup.h=473=static inline int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key,\n--\ninclude/linux/bpf-cgroup.h-476-}\ninclude/linux/bpf-cgroup.h:477:static inline int bpf_percpu_cgroup_storage_update(struct bpf_map *map,\ninclude/linux/bpf-cgroup.h-478-\t\t\t\t\tvoid *key, void *value, u64 flags) {\n--\nkernel/bpf/local_storage.c=182=int bpf_percpu_cgroup_storage_copy(struct bpf_map *_map, void *key,\n--\nkernel/bpf/local_storage.c-215-\nkernel/bpf/local_storage.c:216:int bpf_percpu_cgroup_storage_update(struct bpf_map *_map, void *key,\nkernel/bpf/local_storage.c-217-\t\t\t\t void *value, u64 map_flags)\n--\nkernel/bpf/syscall.c=250=static int bpf_map_update_value(struct bpf_map *map, struct file *map_file,\n--\nkernel/bpf/syscall.c-276-\t} else if (map-\u003emap_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) {\nkernel/bpf/syscall.c:277:\t\terr = bpf_percpu_cgroup_storage_update(map, key, value,\nkernel/bpf/syscall.c-278-\t\t\t\t\t\t flags);\n"
} |
| 87/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 25734 output: 38 thoughts: 31 |
| 88/3 | 2026/10/08 16:42 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/local_storage.c",
"FirstLine": 215,
"LineCount": 40
}Results: {
"Contents": " 215:\t\n 216:\tint bpf_percpu_cgroup_storage_update(struct bpf_map *_map, void *key,\n 217:\t\t\t\t\t void *value, u64 map_flags)\n 218:\t{\n 219:\t\tstruct bpf_cgroup_storage_map *map = map_to_storage(_map);\n 220:\t\tstruct bpf_cgroup_storage *storage;\n 221:\t\tvoid *val;\n 222:\t\tu32 size;\n 223:\t\tint cpu, off = 0;\n 224:\t\n 225:\t\tif ((u32)map_flags \u0026 ~(BPF_ANY | BPF_EXIST | BPF_F_CPU | BPF_F_ALL_CPUS))\n 226:\t\t\treturn -EINVAL;\n 227:\t\n 228:\t\trcu_read_lock();\n 229:\t\tstorage = cgroup_storage_lookup(map, key, false);\n 230:\t\tif (!storage) {\n 231:\t\t\trcu_read_unlock();\n 232:\t\t\treturn -ENOENT;\n 233:\t\t}\n 234:\t\n 235:\t\t/* the user space will provide round_up(value_size, 8) bytes that\n 236:\t\t * will be copied into per-cpu area. bpf programs can only access\n 237:\t\t * value_size of it. During lookup the same extra bytes will be\n 238:\t\t * returned or zeros which were zero-filled by percpu_alloc,\n 239:\t\t * so no kernel data leaks possible\n 240:\t\t */\n 241:\t\tif (map_flags \u0026 BPF_F_CPU) {\n 242:\t\t\tcpu = map_flags \u003e\u003e 32;\n 243:\t\t\tcopy_map_value(_map, per_cpu_ptr(storage-\u003epercpu_buf, cpu), value);\n 244:\t\t\tgoto unlock;\n 245:\t\t}\n 246:\t\tsize = round_up(_map-\u003evalue_size, 8);\n 247:\t\tfor_each_possible_cpu(cpu) {\n 248:\t\t\tval = (map_flags \u0026 BPF_F_ALL_CPUS) ? value : value + off;\n 249:\t\t\tcopy_map_value(_map, per_cpu_ptr(storage-\u003epercpu_buf, cpu), val);\n 250:\t\t\toff += size;\n 251:\t\t}\n 252:\tunlock:\n 253:\t\trcu_read_unlock();\n 254:\t\treturn 0;\n"
} |
| 89/3 | 2026/10/08 16:42 | llm | kmsan-evaluator |
1mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 26486 output: 353 thoughts: 3988 |
| 90/3 | 2026/10/08 16:43 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch modifies flag validation logic in the BPF subsystem (specifically in `bpf_percpu_array_update`, `check_flags`, `htab_map_check_update_flags`, and `__htab_lru_percpu_map_update_elem`) to properly handle bitwise combinations of element existence flags (`BPF_EXIST`, `BPF_NOEXIST`) and per-CPU flags (`BPF_F_CPU`, `BPF_F_ALL_CPUS`), while rejecting mutually exclusive combinations (such as `BPF_EXIST | BPF_NOEXIST`).\n\nNone of the changes introduce or expose uninitialized memory risks:\n1. No kernel structures or data buffers are returned or copied to userspace in these paths; they are strictly map update paths.\n2. The conditional logic evaluates `map_flags`, which is passed from the validated syscall attributes (`union bpf_attr`).\n3. Map values in per-CPU hash maps continue to be properly initialized via `pcpu_init_value()` (which zero-initializes non-target CPUs via `zero_map_value()`), and per-CPU array maps are preallocated with zeroed memory.\n4. No bounds calculations or buffer length checks are altered in a way that could allow uninitialized memory reads.\n\nAny potential bugs related to flag handling, incorrect CPU indexing, or pointer offsets would be caught by standard bug detectors and KASAN (e.g. out-of-bounds accesses). Therefore, a dedicated KMSAN fuzzing session is not justified.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch modifies flag validation logic in the BPF subsystem (specifically in `bpf_percpu_array_update`, `check_flags`, `htab_map_check_update_flags`, and `__htab_lru_percpu_map_update_elem`) to properly handle bitwise combinations of element existence flags (`BPF_EXIST`, `BPF_NOEXIST`) and per-CPU flags (`BPF_F_CPU`, `BPF_F_ALL_CPUS`), while rejecting mutually exclusive combinations (such as `BPF_EXIST | BPF_NOEXIST`).\n\nNone of the changes introduce or expose uninitialized memory risks:\n1. No kernel structures or data buffers are returned or copied to userspace in these paths; they are strictly map update paths.\n2. The conditional logic evaluates `map_flags`, which is passed from the validated syscall attributes (`union bpf_attr`).\n3. Map values in per-CPU hash maps continue to be properly initialized via `pcpu_init_value()` (which zero-initializes non-target CPUs via `zero_map_value()`), and per-CPU array maps are preallocated with zeroed memory.\n4. No bounds calculations or buffer length checks are altered in a way that could allow uninitialized memory reads.\n\nAny potential bugs related to flag handling, incorrect CPU indexing, or pointer offsets would be caught by standard bug detectors and KASAN (e.g. out-of-bounds accesses). Therefore, a dedicated KMSAN fuzzing session is not justified.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|