| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/06/29 18:08 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": [
"BPF_SYSCALL",
"NET"
],
"FocusSymbols": [
"check_map_func_compatibility",
"check_helper_call",
"may_update_sockmap"
],
"Reasoning": "The patch restricts the BPF program types that are allowed to update a sockmap. This is a functional change in the BPF verifier that prevents certain program types from performing potentially unsafe operations. Fuzzing the verifier with these restrictions is valuable.",
"WorthFuzzing": true
} |
| 1/1 | 2026/06/29 18:08 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 64fd07093fa574728f0ff6e75f791e04a12ba711\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Mon Jun 29 18:08:08 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c\nindex 25aea4271cd089..58d766c34626e5 100644\n--- a/kernel/bpf/verifier.c\n+++ b/kernel/bpf/verifier.c\n@@ -8489,11 +8489,7 @@ static bool may_update_sockmap(struct bpf_verifier_env *env, int func_id)\n \t\t\treturn true;\n \t\tbreak;\n \tcase BPF_PROG_TYPE_SOCKET_FILTER:\n-\tcase BPF_PROG_TYPE_SCHED_CLS:\n-\tcase BPF_PROG_TYPE_SCHED_ACT:\n-\tcase BPF_PROG_TYPE_XDP:\n \tcase BPF_PROG_TYPE_SK_REUSEPORT:\n-\tcase BPF_PROG_TYPE_FLOW_DISSECTOR:\n \tcase BPF_PROG_TYPE_SK_LOOKUP:\n \t\treturn true;\n \tdefault:\ndiff --git a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c\nindex 92c20803ea765d..d3a954158c3327 100644\n--- a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c\n+++ b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c\n@@ -336,17 +336,6 @@ static void test_fmod_ret_freplace(void)\n }\n \n \n-static void test_func_sockmap_update(void)\n-{\n-\tconst char *prog_name[] = {\n-\t\t\"freplace/cls_redirect\",\n-\t};\n-\ttest_fexit_bpf2bpf_common(\"./freplace_cls_redirect.bpf.o\",\n-\t\t\t\t \"./test_cls_redirect.bpf.o\",\n-\t\t\t\t ARRAY_SIZE(prog_name),\n-\t\t\t\t prog_name, false, NULL);\n-}\n-\n static void test_func_replace_void(void)\n {\n \tconst char *prog_name[] = {\n@@ -599,8 +588,6 @@ void serial_test_fexit_bpf2bpf(void)\n \t\ttest_func_replace();\n \tif (test__start_subtest(\"func_replace_verify\"))\n \t\ttest_func_replace_verify();\n-\tif (test__start_subtest(\"func_sockmap_update\"))\n-\t\ttest_func_sockmap_update();\n \tif (test__start_subtest(\"func_replace_return_code\"))\n \t\ttest_func_replace_return_code();\n \tif (test__start_subtest(\"func_map_prog_compatibility\"))\ndiff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c\nindex cb3229711f93a3..33f788e2786dae 100644\n--- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c\n+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c\n@@ -7,7 +7,6 @@\n \n #include \"test_progs.h\"\n #include \"test_skmsg_load_helpers.skel.h\"\n-#include \"test_sockmap_update.skel.h\"\n #include \"test_sockmap_invalid_update.skel.h\"\n #include \"test_sockmap_skb_verdict_attach.skel.h\"\n #include \"test_sockmap_progs_query.skel.h\"\n@@ -235,53 +234,6 @@ static void test_skmsg_helpers_with_link(enum bpf_map_type map_type)\n \ttest_skmsg_load_helpers__destroy(skel);\n }\n \n-static void test_sockmap_update(enum bpf_map_type map_type)\n-{\n-\tint err, prog, src;\n-\tstruct test_sockmap_update *skel;\n-\tstruct bpf_map *dst_map;\n-\tconst __u32 zero = 0;\n-\tchar dummy[14] = {0};\n-\tLIBBPF_OPTS(bpf_test_run_opts, topts,\n-\t\t.data_in = dummy,\n-\t\t.data_size_in = sizeof(dummy),\n-\t\t.repeat = 1,\n-\t);\n-\t__s64 sk;\n-\n-\tsk = connected_socket_v4();\n-\tif (!ASSERT_NEQ(sk, -1, \"connected_socket_v4\"))\n-\t\treturn;\n-\n-\tskel = test_sockmap_update__open_and_load();\n-\tif (!ASSERT_OK_PTR(skel, \"open_and_load\"))\n-\t\tgoto close_sk;\n-\n-\tprog = bpf_program__fd(skel-\u003eprogs.copy_sock_map);\n-\tsrc = bpf_map__fd(skel-\u003emaps.src);\n-\tif (map_type == BPF_MAP_TYPE_SOCKMAP)\n-\t\tdst_map = skel-\u003emaps.dst_sock_map;\n-\telse\n-\t\tdst_map = skel-\u003emaps.dst_sock_hash;\n-\n-\terr = bpf_map_update_elem(src, \u0026zero, \u0026sk, BPF_NOEXIST);\n-\tif (!ASSERT_OK(err, \"update_elem(src)\"))\n-\t\tgoto out;\n-\n-\terr = bpf_prog_test_run_opts(prog, \u0026topts);\n-\tif (!ASSERT_OK(err, \"test_run\"))\n-\t\tgoto out;\n-\tif (!ASSERT_NEQ(topts.retval, 0, \"test_run retval\"))\n-\t\tgoto out;\n-\n-\tcompare_cookies(skel-\u003emaps.src, dst_map);\n-\n-out:\n-\ttest_sockmap_update__destroy(skel);\n-close_sk:\n-\tclose(sk);\n-}\n-\n static void test_sockmap_invalid_update(void)\n {\n \tstruct test_sockmap_invalid_update *skel;\n@@ -1385,10 +1337,6 @@ void test_sockmap_basic(void)\n \t\ttest_skmsg_helpers(BPF_MAP_TYPE_SOCKMAP);\n \tif (test__start_subtest(\"sockhash sk_msg load helpers\"))\n \t\ttest_skmsg_helpers(BPF_MAP_TYPE_SOCKHASH);\n-\tif (test__start_subtest(\"sockmap update\"))\n-\t\ttest_sockmap_update(BPF_MAP_TYPE_SOCKMAP);\n-\tif (test__start_subtest(\"sockhash update\"))\n-\t\ttest_sockmap_update(BPF_MAP_TYPE_SOCKHASH);\n \tif (test__start_subtest(\"sockmap update in unsafe context\"))\n \t\ttest_sockmap_invalid_update();\n \tif (test__start_subtest(\"sockmap copy\"))\ndiff --git a/tools/testing/selftests/bpf/progs/freplace_cls_redirect.c b/tools/testing/selftests/bpf/progs/freplace_cls_redirect.c\ndeleted file mode 100644\nindex 7e94412d47a5ca..00000000000000\n--- a/tools/testing/selftests/bpf/progs/freplace_cls_redirect.c\n+++ /dev/null\n@@ -1,34 +0,0 @@\n-// SPDX-License-Identifier: GPL-2.0\n-// Copyright (c) 2020 Facebook\n-\n-#include \u003clinux/stddef.h\u003e\n-#include \u003clinux/bpf.h\u003e\n-#include \u003clinux/pkt_cls.h\u003e\n-#include \u003cbpf/bpf_endian.h\u003e\n-#include \u003cbpf/bpf_helpers.h\u003e\n-\n-struct {\n-\t__uint(type, BPF_MAP_TYPE_SOCKMAP);\n-\t__type(key, int);\n-\t__type(value, int);\n-\t__uint(max_entries, 2);\n-} sock_map SEC(\".maps\");\n-\n-SEC(\"freplace/cls_redirect\")\n-int freplace_cls_redirect_test(struct __sk_buff *skb)\n-{\n-\tint ret = 0;\n-\tconst int zero = 0;\n-\tstruct bpf_sock *sk;\n-\n-\tsk = bpf_map_lookup_elem(\u0026sock_map, \u0026zero);\n-\tif (!sk)\n-\t\treturn TC_ACT_SHOT;\n-\n-\tret = bpf_map_update_elem(\u0026sock_map, \u0026zero, sk, 0);\n-\tbpf_sk_release(sk);\n-\n-\treturn ret == 0 ? TC_ACT_OK : TC_ACT_SHOT;\n-}\n-\n-char _license[] SEC(\"license\") = \"GPL\";\ndiff --git a/tools/testing/selftests/bpf/progs/test_sockmap_update.c b/tools/testing/selftests/bpf/progs/test_sockmap_update.c\ndeleted file mode 100644\nindex 6d64ea536e3d81..00000000000000\n--- a/tools/testing/selftests/bpf/progs/test_sockmap_update.c\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-// SPDX-License-Identifier: GPL-2.0\n-// Copyright (c) 2020 Cloudflare\n-#include \"vmlinux.h\"\n-#include \u003cbpf/bpf_helpers.h\u003e\n-\n-struct {\n-\t__uint(type, BPF_MAP_TYPE_SOCKMAP);\n-\t__uint(max_entries, 1);\n-\t__type(key, __u32);\n-\t__type(value, __u64);\n-} src SEC(\".maps\");\n-\n-struct {\n-\t__uint(type, BPF_MAP_TYPE_SOCKMAP);\n-\t__uint(max_entries, 1);\n-\t__type(key, __u32);\n-\t__type(value, __u64);\n-} dst_sock_map SEC(\".maps\");\n-\n-struct {\n-\t__uint(type, BPF_MAP_TYPE_SOCKHASH);\n-\t__uint(max_entries, 1);\n-\t__type(key, __u32);\n-\t__type(value, __u64);\n-} dst_sock_hash SEC(\".maps\");\n-\n-SEC(\"tc\")\n-int copy_sock_map(void *ctx)\n-{\n-\tstruct bpf_sock *sk;\n-\tbool failed = false;\n-\t__u32 key = 0;\n-\n-\tsk = bpf_map_lookup_elem(\u0026src, \u0026key);\n-\tif (!sk)\n-\t\treturn SK_DROP;\n-\n-\tif (bpf_map_update_elem(\u0026dst_sock_map, \u0026key, sk, 0))\n-\t\tfailed = true;\n-\n-\tif (bpf_map_update_elem(\u0026dst_sock_hash, \u0026key, sk, 0))\n-\t\tfailed = true;\n-\n-\tbpf_sk_release(sk);\n-\treturn failed ? SK_DROP : SK_PASS;\n-}\n-\n-char _license[] SEC(\"license\") = \"GPL\";\ndiff --git a/tools/testing/selftests/bpf/progs/verifier_sockmap_mutate.c b/tools/testing/selftests/bpf/progs/verifier_sockmap_mutate.c\nindex fe4b123187b86e..b1102612369037 100644\n--- a/tools/testing/selftests/bpf/progs/verifier_sockmap_mutate.c\n+++ b/tools/testing/selftests/bpf/progs/verifier_sockmap_mutate.c\n@@ -74,7 +74,7 @@ static __always_inline void test_sockmap_lookup_and_mutate(void)\n }\n \n SEC(\"action\")\n-__success\n+__failure __msg(\"cannot update sockmap in this context\")\n int test_sched_act(struct __sk_buff *skb)\n {\n \ttest_sockmap_mutate(skb-\u003esk);\n@@ -82,7 +82,7 @@ int test_sched_act(struct __sk_buff *skb)\n }\n \n SEC(\"classifier\")\n-__success\n+__failure __msg(\"cannot update sockmap in this context\")\n int test_sched_cls(struct __sk_buff *skb)\n {\n \ttest_sockmap_mutate(skb-\u003esk);\n@@ -90,7 +90,7 @@ int test_sched_cls(struct __sk_buff *skb)\n }\n \n SEC(\"flow_dissector\")\n-__success\n+__failure __msg(\"cannot update sockmap in this context\")\n int test_flow_dissector_delete(struct __sk_buff *skb __always_unused)\n {\n \ttest_sockmap_delete();\n@@ -98,7 +98,7 @@ int test_flow_dissector_delete(struct __sk_buff *skb __always_unused)\n }\n \n SEC(\"flow_dissector\")\n-__failure __msg(\"program of this type cannot use helper bpf_sk_release\")\n+__failure __msg(\"cannot update sockmap in this context\")\n int test_flow_dissector_update(struct __sk_buff *skb __always_unused)\n {\n \ttest_sockmap_lookup_and_update(); /* no access to skb-\u003esk */\n@@ -179,7 +179,7 @@ int test_sockops_update_dedicated(struct bpf_sock_ops *ctx)\n }\n \n SEC(\"xdp\")\n-__success\n+__failure __msg(\"cannot update sockmap in this context\")\n int test_xdp(struct xdp_md *ctx __always_unused)\n {\n \ttest_sockmap_lookup_and_mutate();\n"
} |
| 2/1 | 2026/06/29 18:08 | agent | patch-evaluator |
1mModel:gemini-3.1-pro-preview Args: null Results: {
"EnableConfigs": [
"BPF_SYSCALL",
"NET"
],
"FocusSymbols": [
"check_map_func_compatibility",
"check_helper_call",
"may_update_sockmap"
],
"Reasoning": "The patch restricts the BPF program types that are allowed to update a sockmap. This is a functional change in the BPF verifier that prevents certain program types from performing potentially unsafe operations. Fuzzing the verifier with these restrictions is valuable.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Do not list too generic configs (we already have them enabled). Only list those that specifically cover the modified code. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 64fd07093fa574728f0ff6e75f791e04a12ba711
Author: syz-cluster <triage@syzkaller.com>
Date: Mon Jun 29 18:08:08 2026 +0000
syz-cluster: applied patch under review
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 25aea4271cd089..58d766c34626e5 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -8489,11 +8489,7 @@ static bool may_update_sockmap(struct bpf_verifier_env *env, int func_id)
return true;
break;
case BPF_PROG_TYPE_SOCKET_FILTER:
- case BPF_PROG_TYPE_SCHED_CLS:
- case BPF_PROG_TYPE_SCHED_ACT:
- case BPF_PROG_TYPE_XDP:
case BPF_PROG_TYPE_SK_REUSEPORT:
- case BPF_PROG_TYPE_FLOW_DISSECTOR:
case BPF_PROG_TYPE_SK_LOOKUP:
return true;
default:
diff --git a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
index 92c20803ea765d..d3a954158c3327 100644
--- a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
+++ b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
@@ -336,17 +336,6 @@ static void test_fmod_ret_freplace(void)
}
-static void test_func_sockmap_update(void)
-{
- const char *prog_name[] = {
- "freplace/cls_redirect",
- };
- test_fexit_bpf2bpf_common("./freplace_cls_redirect.bpf.o",
- "./test_cls_redirect.bpf.o",
- ARRAY_SIZE(prog_name),
- prog_name, false, NULL);
-}
-
static void test_func_replace_void(void)
{
const char *prog_name[] = {
@@ -599,8 +588,6 @@ void serial_test_fexit_bpf2bpf(void)
test_func_replace();
if (test__start_subtest("func_replace_verify"))
test_func_replace_verify();
- if (test__start_subtest("func_sockmap_update"))
- test_func_sockmap_update();
if (test__start_subtest("func_replace_return_code"))
test_func_replace_return_code();
if (test__start_subtest("func_map_prog_compatibility"))
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
index cb3229711f93a3..33f788e2786dae 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
@@ -7,7 +7,6 @@
#include "test_progs.h"
#include "test_skmsg_load_helpers.skel.h"
-#include "test_sockmap_update.skel.h"
#include "test_sockmap_invalid_update.skel.h"
#include "test_sockmap_skb_verdict_attach.skel.h"
#include "test_sockmap_progs_query.skel.h"
@@ -235,53 +234,6 @@ static void test_skmsg_helpers_with_link(enum bpf_map_type map_type)
test_skmsg_load_helpers__destroy(skel);
}
-static void test_sockmap_update(enum bpf_map_type map_type)
-{
- int err, prog, src;
- struct test_sockmap_update *skel;
- struct bpf_map *dst_map;
- const __u32 zero = 0;
- char dummy[14] = {0};
- LIBBPF_OPTS(bpf_test_run_opts, topts,
- .data_in = dummy,
- .data_size_in = sizeof(dummy),
- .repeat = 1,
- );
- __s64 sk;
-
- sk = connected_socket_v4();
- if (!ASSERT_NEQ(sk, -1, "connected_socket_v4"))
- return;
-
- skel = test_sockmap_update__open_and_load();
- if (!ASSERT_OK_PTR(skel, "open_and_load"))
- goto close_sk;
-
- prog = bpf_program__fd(skel->progs.copy_sock_map);
- src = bpf_map__fd(skel->maps.src);
- if (map_type == BPF_MAP_TYPE_SOCKMAP)
- dst_map = skel->maps.dst_sock_map;
- else
- dst_map = skel->maps.dst_sock_hash;
-
- err = bpf_map_update_elem(src, &zero, &sk, BPF_NOEXIST);
- if (!ASSERT_OK(err, "update_elem(src)"))
- goto out;
-
- err = bpf_prog_test_run_opts(prog, &topts);
- if (!ASSERT_OK(err, "test_run"))
- goto out;
- if (!ASSERT_NEQ(topts.retval, 0, "test_run retval"))
- goto out;
-
- compare_cookies(skel->maps.src, dst_map);
-
-out:
- test_sockmap_update__destroy(skel);
-close_sk:
- close(sk);
-}
-
static void test_sockmap_invalid_update(void)
{
struct test_sockmap_invalid_update *skel;
@@ -1385,10 +1337,6 @@ void test_sockmap_basic(void)
test_skmsg_helpers(BPF_MAP_TYPE_SOCKMAP);
if (test__start_subtest("sockhash sk_msg load helpers"))
test_skmsg_helpers(BPF_MAP_TYPE_SOCKHASH);
- if (test__start_subtest("sockmap update"))
- test_sockmap_update(BPF_MAP_TYPE_SOCKMAP);
- if (test__start_subtest("sockhash update"))
- test_sockmap_update(BPF_MAP_TYPE_SOCKHASH);
if (test__start_subtest("sockmap update in unsafe context"))
test_sockmap_invalid_update();
if (test__start_subtest("sockmap copy"))
diff --git a/tools/testing/selftests/bpf/progs/freplace_cls_redirect.c b/tools/testing/selftests/bpf/progs/freplace_cls_redirect.c
deleted file mode 100644
index 7e94412d47a5ca..00000000000000
--- a/tools/testing/selftests/bpf/progs/freplace_cls_redirect.c
+++ /dev/null
@@ -1,34 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-// Copyright (c) 2020 Facebook
-
-#include <linux/stddef.h>
-#include <linux/bpf.h>
-#include <linux/pkt_cls.h>
-#include <bpf/bpf_endian.h>
-#include <bpf/bpf_helpers.h>
-
-struct {
- __uint(type, BPF_MAP_TYPE_SOCKMAP);
- __type(key, int);
- __type(value, int);
- __uint(max_entries, 2);
-} sock_map SEC(".maps");
-
-SEC("freplace/cls_redirect")
-int freplace_cls_redirect_test(struct __sk_buff *skb)
-{
- int ret = 0;
- const int zero = 0;
- struct bpf_sock *sk;
-
- sk = bpf_map_lookup_elem(&sock_map, &zero);
- if (!sk)
- return TC_ACT_SHOT;
-
- ret = bpf_map_update_elem(&sock_map, &zero, sk, 0);
- bpf_sk_release(sk);
-
- return ret == 0 ? TC_ACT_OK : TC_ACT_SHOT;
-}
-
-char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/progs/test_sockmap_update.c b/tools/testing/selftests/bpf/progs/test_sockmap_update.c
deleted file mode 100644
index 6d64ea536e3d81..00000000000000
--- a/tools/testing/selftests/bpf/progs/test_sockmap_update.c
+++ /dev/null
@@ -1,48 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-// Copyright (c) 2020 Cloudflare
-#include "vmlinux.h"
-#include <bpf/bpf_helpers.h>
-
-struct {
- __uint(type, BPF_MAP_TYPE_SOCKMAP);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
-} src SEC(".maps");
-
-struct {
- __uint(type, BPF_MAP_TYPE_SOCKMAP);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
-} dst_sock_map SEC(".maps");
-
-struct {
- __uint(type, BPF_MAP_TYPE_SOCKHASH);
- __uint(max_entries, 1);
- __type(key, __u32);
- __type(value, __u64);
-} dst_sock_hash SEC(".maps");
-
-SEC("tc")
-int copy_sock_map(void *ctx)
-{
- struct bpf_sock *sk;
- bool failed = false;
- __u32 key = 0;
-
- sk = bpf_map_lookup_elem(&src, &key);
- if (!sk)
- return SK_DROP;
-
- if (bpf_map_update_elem(&dst_sock_map, &key, sk, 0))
- failed = true;
-
- if (bpf_map_update_elem(&dst_sock_hash, &key, sk, 0))
- failed = true;
-
- bpf_sk_release(sk);
- return failed ? SK_DROP : SK_PASS;
-}
-
-char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/progs/verifier_sockmap_mutate.c b/tools/testing/selftests/bpf/progs/verifier_sockmap_mutate.c
index fe4b123187b86e..b1102612369037 100644
--- a/tools/testing/selftests/bpf/progs/verifier_sockmap_mutate.c
+++ b/tools/testing/selftests/bpf/progs/verifier_sockmap_mutate.c
@@ -74,7 +74,7 @@ static __always_inline void test_sockmap_lookup_and_mutate(void)
}
SEC("action")
-__success
+__failure __msg("cannot update sockmap in this context")
int test_sched_act(struct __sk_buff *skb)
{
test_sockmap_mutate(skb->sk);
@@ -82,7 +82,7 @@ int test_sched_act(struct __sk_buff *skb)
}
SEC("classifier")
-__success
+__failure __msg("cannot update sockmap in this context")
int test_sched_cls(struct __sk_buff *skb)
{
test_sockmap_mutate(skb->sk);
@@ -90,7 +90,7 @@ int test_sched_cls(struct __sk_buff *skb)
}
SEC("flow_dissector")
-__success
+__failure __msg("cannot update sockmap in this context")
int test_flow_dissector_delete(struct __sk_buff *skb __always_unused)
{
test_sockmap_delete();
@@ -98,7 +98,7 @@ int test_flow_dissector_delete(struct __sk_buff *skb __always_unused)
}
SEC("flow_dissector")
-__failure __msg("program of this type cannot use helper bpf_sk_release")
+__failure __msg("cannot update sockmap in this context")
int test_flow_dissector_update(struct __sk_buff *skb __always_unused)
{
test_sockmap_lookup_and_update(); /* no access to skb->sk */
@@ -179,7 +179,7 @@ int test_sockops_update_dedicated(struct bpf_sock_ops *ctx)
}
SEC("xdp")
-__success
+__failure __msg("cannot update sockmap in this context")
int test_xdp(struct xdp_md *ctx __always_unused)
{
test_sockmap_lookup_and_mutate();
|
| 3/2 | 2026/06/29 18:08 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 5215 output: 20 thoughts: 309 Thoughts: **Analyzing a BPF Verifier Patch** Okay, so I'm looking at this patch and immediately, my expert eye goes to the core change: it's modifying `kernel/bpf/verifier.c`, specifically the `may_update_sockmap` function. It seems they're removing certain BPF program types from the switch statement within that function. I need to take a closer look at that section of the code, so let me quickly reference it: ```c case BPF_PROG_TYPE_SOCKET_FILTER: - case BPF_PROG_TYPE_SCHED_CLS: - case BPF_PROG_TYPE_SCHED_ACT: - case BPF_PROG_TYPE_XDP: case BPF_PROG_TYPE_SK_REUSEPORT: - case BPF_PROG_TYPE_FLOW_DISSECTOR: case BPF_PROG_TYPE_SK_LOOKUP: return true; ``` Right, I see it now. The patch is stripping out `BPF_PROG_TYPE_SCHED_CLS`, `BPF_PROG_TYPE_SCHED_ACT`, `BPF_PROG_TYPE_XDP`, and `BPF_PROG_TYPE_FLOW_DISSECTOR`. This means the function will now evaluate as `false` or probably return an error for those types. I need to understand the implications of this change and how it impacts the verifier's behavior. It looks like it impacts some of the tests in `tools/testing/selftests/bpf/` as well. |
| 4/2 | 2026/06/29 18:08 | tool | grepper |
0mArgs:{
"Expression": "may_update_sockmap"
}Results: {
"Output": "kernel/bpf/verifier.c=8227=static int check_func_arg(struct bpf_verifier_env *env, u32 arg,\n--\nkernel/bpf/verifier.c-8468-\nkernel/bpf/verifier.c:8469:static bool may_update_sockmap(struct bpf_verifier_env *env, int func_id)\nkernel/bpf/verifier.c-8470-{\n--\nkernel/bpf/verifier.c=8509=static int check_map_func_compatibility(struct bpf_verifier_env *env,\n--\nkernel/bpf/verifier.c-8584-\t\t func_id != BPF_FUNC_map_lookup_elem \u0026\u0026\nkernel/bpf/verifier.c:8585:\t\t !may_update_sockmap(env, func_id))\nkernel/bpf/verifier.c-8586-\t\t\tgoto error;\n--\nkernel/bpf/verifier.c-8593-\t\t func_id != BPF_FUNC_map_lookup_elem \u0026\u0026\nkernel/bpf/verifier.c:8594:\t\t !may_update_sockmap(env, func_id))\nkernel/bpf/verifier.c-8595-\t\t\tgoto error;\n"
} |
| 5/2 | 2026/06/29 18:08 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 6233 output: 37 thoughts: 217 Thoughts: **Analyzing the BPF Verifier Change** Okay, so this patch is all about `may_update_sockmap`. It looks like we're tightening the restrictions on which BPF program types can actually modify a `sockmap`. Specifically, it's removing `BPF_PROG_TYPE_SCHED_CLS`, `BPF_PROG_TYPE_SCHED_ACT`, `BPF_PROG_TYPE_XDP`, and `BPF_PROG_TYPE_FLOW_DISSECTOR` from the list of allowed program types. This is a pretty straightforward functional change to the BPF verifier. My initial thought is, "Security or correctness fix, preventing some kind of crash or state corruption, probably." So, is this fuzzable? Definitely, it's a functional change in the verifier; that's prime fuzzing territory. Then I get a little suspicious: "Won't fuzzing just end up triggering verifier rejections because we're just *restricting* functionality?" That's a valid concern. But it's still a core kernel change, and the change is in `kernel/bpf/verifier.c`, so it's a critical area. Alright, I'll need to double-check the exact code in `may_update_sockmap` to be sure. Gotta see *exactly* what's changing to refine my fuzzing strategy. |
| 6/2 | 2026/06/29 18:08 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/verifier.c",
"FirstLine": 8469,
"LineCount": 40
}Results: {
"Contents": "8469:\tstatic bool may_update_sockmap(struct bpf_verifier_env *env, int func_id)\n8470:\t{\n8471:\t\tenum bpf_attach_type eatype = env-\u003eprog-\u003eexpected_attach_type;\n8472:\t\tenum bpf_prog_type type = resolve_prog_type(env-\u003eprog);\n8473:\t\n8474:\t\tif (func_id != BPF_FUNC_map_update_elem \u0026\u0026\n8475:\t\t func_id != BPF_FUNC_map_delete_elem)\n8476:\t\t\treturn false;\n8477:\t\n8478:\t\t/* It's not possible to get access to a locked struct sock in these\n8479:\t\t * contexts, so updating is safe.\n8480:\t\t */\n8481:\t\tswitch (type) {\n8482:\t\tcase BPF_PROG_TYPE_TRACING:\n8483:\t\t\tif (eatype == BPF_TRACE_ITER)\n8484:\t\t\t\treturn true;\n8485:\t\t\tbreak;\n8486:\t\tcase BPF_PROG_TYPE_SOCK_OPS:\n8487:\t\t\t/* map_update allowed only via dedicated helpers with event type checks */\n8488:\t\t\tif (func_id == BPF_FUNC_map_delete_elem)\n8489:\t\t\t\treturn true;\n8490:\t\t\tbreak;\n8491:\t\tcase BPF_PROG_TYPE_SOCKET_FILTER:\n8492:\t\tcase BPF_PROG_TYPE_SK_REUSEPORT:\n8493:\t\tcase BPF_PROG_TYPE_SK_LOOKUP:\n8494:\t\t\treturn true;\n8495:\t\tdefault:\n8496:\t\t\tbreak;\n8497:\t\t}\n8498:\t\n8499:\t\tverbose(env, \"cannot update sockmap in this context\\n\");\n8500:\t\treturn false;\n8501:\t}\n8502:\t\n8503:\tbool bpf_allow_tail_call_in_subprogs(struct bpf_verifier_env *env)\n8504:\t{\n8505:\t\treturn env-\u003eprog-\u003ejit_requested \u0026\u0026\n8506:\t\t bpf_jit_supports_subprog_tailcalls();\n8507:\t}\n8508:\t\n"
} |
| 7/2 | 2026/06/29 18:08 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 7409 output: 21 thoughts: 126 Thoughts: **Analyzing a BPF Verifier Change** Okay, so this patch limits how certain BPF program types can update sockmaps. Right away, I see this as a functional modification to the BPF verifier. The first question that pops into my head is, "Is this fuzz-worthy?" And the answer is a resounding "Yes!" Any time we alter verifier behavior, we need to stress-test it. The potential for regressions and unexpected behavior is high. Let's hone in on the key symbols: `may_update_sockmap` and `check_map_func_compatibility`. Wait a minute, aren't those static functions? Ah, yes, they are. That means we need to find all the call sites of `check_map_func_compatibility` to build a solid fuzzer target. This is where the real interesting stuff is going to be. |
| 8/2 | 2026/06/29 18:08 | tool | grepper |
0mArgs:{
"Expression": "check_map_func_compatibility"
}Results: {
"Output": "kernel/bpf/verifier.c=8503=bool bpf_allow_tail_call_in_subprogs(struct bpf_verifier_env *env)\n--\nkernel/bpf/verifier.c-8508-\nkernel/bpf/verifier.c:8509:static int check_map_func_compatibility(struct bpf_verifier_env *env,\nkernel/bpf/verifier.c-8510-\t\t\t\t\tstruct bpf_map *map, int func_id)\n--\nkernel/bpf/verifier.c=10182=static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn,\n--\nkernel/bpf/verifier.c-10613-\nkernel/bpf/verifier.c:10614:\terr = check_map_func_compatibility(env, meta.map.ptr, func_id);\nkernel/bpf/verifier.c-10615-\tif (err)\n--\nscripts/bpf_doc.py=607=Compatibility between helper functions and map types can be found in the\nscripts/bpf_doc.py:608:**check_map_func_compatibility**\\\\ () function in file *kernel/bpf/verifier.c*.\nscripts/bpf_doc.py-609-\n"
} |
| 9/2 | 2026/06/29 18:08 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8078 output: 18 thoughts: 195 Thoughts: **Analyzing BPF Verification and Sockmap Configuration** Okay, so I'm diving into this code path, and it looks like the entry point is `check_helper_call`. That's a solid place to start digging; it's the anchor point for this specific aspect of BPF. I need to understand the verification process, and `check_helper_call` is key here. Now, while it's not a performance bottleneck in the *traditional* sense of packet processing, it's definitely a frequent point of execution during BPF program verification. I'll need to remember that when thinking about performance implications later. `check_map_func_compatibility` seems like another relevant function to examine. Then I also need to focus on `may_update_sockmap`. Next, I need to check the relevant configuration options. BPF syscalls are enabled by `CONFIG_BPF_SYSCALL`, that much is clear. But sockmap itself... that feels like it's dependent on `CONFIG_BPF_SYSCALL` *and* perhaps `CONFIG_CGROUP_BPF` or even `CONFIG_NET`. It's time to dig into the source. I'll need to go to `kernel/bpf/verifier.c` to look for any specific dependencies or conditional logic related to those. |
| 10/2 | 2026/06/29 18:08 | tool | grepper |
0mArgs:{
"Expression": "CONFIG_BPF"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 1931 lines.\nUse more precise expression if possible.\n\nDocumentation/networking/filter.rst=516=PowerPC, ARM, ARM64, MIPS, RISC-V, s390, and ARC and can be enabled through\nDocumentation/networking/filter.rst:517:CONFIG_BPF_JIT. The JIT compiler is transparently invoked for each\nDocumentation/networking/filter.rst-518-attached filter from user space or for internal kernel users if it has\n--\nDocumentation/networking/filter.rst=528=Example output from dmesg::\n--\nDocumentation/networking/filter.rst-536-\nDocumentation/networking/filter.rst:537:When CONFIG_BPF_JIT_ALWAYS_ON is enabled, bpf_jit_enable is permanently set to 1 and\nDocumentation/networking/filter.rst-538-setting any other value than that will return in failure. This is even the case for\n--\nDocumentation/scheduler/sched-ext.rst=35=options should be enabled to use sched_ext:\n--\nDocumentation/scheduler/sched-ext.rst-38-\nDocumentation/scheduler/sched-ext.rst:39: CONFIG_BPF=y\nDocumentation/scheduler/sched-ext.rst-40- CONFIG_SCHED_CLASS_EXT=y\nDocumentation/scheduler/sched-ext.rst:41: CONFIG_BPF_SYSCALL=y\nDocumentation/scheduler/sched-ext.rst:42: CONFIG_BPF_JIT=y\nDocumentation/scheduler/sched-ext.rst-43- CONFIG_DEBUG_INFO_BTF=y\nDocumentation/scheduler/sched-ext.rst:44: CONFIG_BPF_JIT_ALWAYS_ON=y\nDocumentation/scheduler/sched-ext.rst:45: CONFIG_BPF_JIT_DEFAULT_ON=y\nDocumentation/scheduler/sched-ext.rst-46-\n--\nDocumentation/trace/fprobetrace.rst=84=parameters by its name instead of ``$argN``. This feature is available if the\nDocumentation/trace/fprobetrace.rst:85:kernel is configured with CONFIG_BPF_SYSCALL and CONFIG_DEBUG_INFO_BTF.\nDocumentation/trace/fprobetrace.rst-86-If user only specify the BTF argument, the event's argument name is also\n--\nMakefile=1547=endif\nMakefile-1548-\nMakefile:1549:ifdef CONFIG_BPF\nMakefile-1550-ifdef CONFIG_DEBUG_INFO_BTF\n--\narch/arc/net/Makefile=3=ifeq ($(CONFIG_ISA_ARCV2),y)\narch/arc/net/Makefile:4:\tobj-$(CONFIG_BPF_JIT) += bpf_jit_core.o\narch/arc/net/Makefile:5:\tobj-$(CONFIG_BPF_JIT) += bpf_jit_arcv2.o\narch/arc/net/Makefile-6-endif\n--\narch/arm/configs/aspeed_g4_defconfig=4=CONFIG_HIGH_RES_TIMERS=y\narch/arm/configs/aspeed_g4_defconfig:5:CONFIG_BPF_SYSCALL=y\narch/arm/configs/aspeed_g4_defconfig-6-CONFIG_IKCONFIG=y\n--\narch/arm/configs/aspeed_g5_defconfig=4=CONFIG_HIGH_RES_TIMERS=y\narch/arm/configs/aspeed_g5_defconfig:5:CONFIG_BPF_SYSCALL=y\narch/arm/configs/aspeed_g5_defconfig-6-CONFIG_IKCONFIG=y\n--\narch/arm/configs/imx_v6_v7_defconfig=3=CONFIG_HIGH_RES_TIMERS=y\narch/arm/configs/imx_v6_v7_defconfig:4:CONFIG_BPF_SYSCALL=y\narch/arm/configs/imx_v6_v7_defconfig-5-CONFIG_PREEMPT_VOLUNTARY=y\n--\narch/arm/configs/imxrt_defconfig-1-# CONFIG_LOCALVERSION_AUTO is not set\narch/arm/configs/imxrt_defconfig:2:CONFIG_BPF_SYSCALL=y\narch/arm/configs/imxrt_defconfig-3-CONFIG_SCHED_AUTOGROUP=y\n--\narch/arm/kernel/spectre.c=8=static bool _unprivileged_ebpf_enabled(void)\narch/arm/kernel/spectre.c-9-{\narch/arm/kernel/spectre.c:10:#ifdef CONFIG_BPF_SYSCALL\narch/arm/kernel/spectre.c-11-\treturn !sysctl_unprivileged_bpf_disabled;\n--\narch/arm/net/Makefile-3-\narch/arm/net/Makefile:4:obj-$(CONFIG_BPF_JIT) += bpf_jit_32.o\n--\narch/arm64/configs/defconfig=5=CONFIG_HIGH_RES_TIMERS=y\narch/arm64/configs/defconfig:6:CONFIG_BPF_SYSCALL=y\narch/arm64/configs/defconfig:7:CONFIG_BPF_JIT=y\narch/arm64/configs/defconfig-8-CONFIG_PREEMPT=y\n--\narch/arm64/include/asm/extable.h=36=bool insn_may_access_user(unsigned long addr, unsigned long esr);\narch/arm64/include/asm/extable.h-37-\narch/arm64/include/asm/extable.h:38:#ifdef CONFIG_BPF_JIT\narch/arm64/include/asm/extable.h-39-bool ex_handler_bpf(const struct exception_table_entry *ex,\narch/arm64/include/asm/extable.h-40-\t\t struct pt_regs *regs);\narch/arm64/include/asm/extable.h:41:#else /* !CONFIG_BPF_JIT */\narch/arm64/include/asm/extable.h-42-static inline\narch/arm64/include/asm/extable.h=43=bool ex_handler_bpf(const struct exception_table_entry *ex,\n--\narch/arm64/include/asm/extable.h-47-}\narch/arm64/include/asm/extable.h:48:#endif /* !CONFIG_BPF_JIT */\narch/arm64/include/asm/extable.h-49-\n--\narch/arm64/kernel/proton-pack.c=111=static bool _unprivileged_ebpf_enabled(void)\narch/arm64/kernel/proton-pack.c-112-{\narch/arm64/kernel/proton-pack.c:113:#ifdef CONFIG_BPF_SYSCALL\narch/arm64/kernel/proton-pack.c-114-\treturn !sysctl_unprivileged_bpf_disabled;\n--\narch/arm64/kernel/proton-pack.c=1168=void __init spectre_bhb_patch_clearbhb(struct alt_instr *alt,\n--\narch/arm64/kernel/proton-pack.c-1179-\narch/arm64/kernel/proton-pack.c:1180:#ifdef CONFIG_BPF_SYSCALL\narch/arm64/kernel/proton-pack.c-1181-#define EBPF_WARN \"Unprivileged eBPF is enabled, data leaks possible via Spectre v2 BHB attacks!\\n\"\n--\narch/arm64/net/Makefile-4-#\narch/arm64/net/Makefile:5:obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o bpf_timed_may_goto.o\n--\narch/loongarch/configs/loongson32_defconfig=6=CONFIG_HIGH_RES_TIMERS=y\narch/loongarch/configs/loongson32_defconfig:7:CONFIG_BPF_SYSCALL=y\narch/loongarch/configs/loongson32_defconfig-8-CONFIG_PREEMPT=y\n--\narch/loongarch/configs/loongson32_defconfig=365=CONFIG_CGROUP_NET_PRIO=y\narch/loongarch/configs/loongson32_defconfig:366:CONFIG_BPF_STREAM_PARSER=y\narch/loongarch/configs/loongson32_defconfig-367-CONFIG_BT=m\n--\narch/loongarch/configs/loongson64_defconfig=6=CONFIG_HIGH_RES_TIMERS=y\narch/loongarch/configs/loongson64_defconfig:7:CONFIG_BPF_SYSCALL=y\narch/loongarch/configs/loongson64_defconfig:8:CONFIG_BPF_JIT=y\narch/loongarch/configs/loongson64_defconfig-9-CONFIG_PREEMPT=y\n--\narch/loongarch/configs/loongson64_defconfig=381=CONFIG_CGROUP_NET_PRIO=y\narch/loongarch/configs/loongson64_defconfig:382:CONFIG_BPF_STREAM_PARSER=y\narch/loongarch/configs/loongson64_defconfig-383-CONFIG_BT=m\n--\narch/loongarch/include/asm/extable.h=26=do {\t\t\t\t\t\t\t\\\n--\narch/loongarch/include/asm/extable.h-34-\narch/loongarch/include/asm/extable.h:35:#ifdef CONFIG_BPF_JIT\narch/loongarch/include/asm/extable.h-36-bool ex_handler_bpf(const struct exception_table_entry *ex, struct pt_regs *regs);\n--\narch/loongarch/include/asm/extable.h=39=bool ex_handler_bpf(const struct exception_table_entry *ex, struct pt_regs *regs)\n--\narch/loongarch/include/asm/extable.h-42-}\narch/loongarch/include/asm/extable.h:43:#endif /* !CONFIG_BPF_JIT */\narch/loongarch/include/asm/extable.h-44-\n--\narch/loongarch/net/Makefile-6-#\narch/loongarch/net/Makefile:7:obj-$(CONFIG_BPF_JIT) += bpf_jit.o\n--\narch/mips/configs/decstation_64_defconfig=7=CONFIG_EXPERT=y\n--\narch/mips/configs/decstation_64_defconfig-9-# CONFIG_SYSFS_SYSCALL is not set\narch/mips/configs/decstation_64_defconfig:10:CONFIG_BPF_SYSCALL=y\narch/mips/configs/decstation_64_defconfig-11-# CONFIG_COMPAT_BRK is not set\n--\narch/mips/configs/decstation_defconfig=7=CONFIG_EXPERT=y\n--\narch/mips/configs/decstation_defconfig-9-# CONFIG_SYSFS_SYSCALL is not set\narch/mips/configs/decstation_defconfig:10:CONFIG_BPF_SYSCALL=y\narch/mips/configs/decstation_defconfig-11-# CONFIG_COMPAT_BRK is not set\n--\narch/mips/configs/decstation_r4k_defconfig=7=CONFIG_EXPERT=y\n--\narch/mips/configs/decstation_r4k_defconfig-9-# CONFIG_SYSFS_SYSCALL is not set\narch/mips/configs/decstation_r4k_defconfig:10:CONFIG_BPF_SYSCALL=y\narch/mips/configs/decstation_r4k_defconfig-11-# CONFIG_COMPAT_BRK is not set\n--\narch/mips/configs/eyeq5_defconfig=3=CONFIG_HIGH_RES_TIMERS=y\narch/mips/configs/eyeq5_defconfig:4:CONFIG_BPF_SYSCALL=y\narch/mips/configs/eyeq5_defconfig-5-CONFIG_TASKSTATS=y\n--\narch/mips/configs/eyeq6_defconfig=3=CONFIG_HIGH_RES_TIMERS=y\narch/mips/configs/eyeq6_defconfig:4:CONFIG_BPF_SYSCALL=y\narch/mips/configs/eyeq6_defconfig-5-CONFIG_TASKSTATS=y\n--\narch/mips/configs/eyeq6lplus_defconfig=3=CONFIG_HIGH_RES_TIMERS=y\narch/mips/configs/eyeq6lplus_defconfig:4:CONFIG_BPF_SYSCALL=y\narch/mips/configs/eyeq6lplus_defconfig-5-CONFIG_TASKSTATS=y\n--\narch/mips/configs/generic_defconfig=16=CONFIG_BLK_DEV_INITRD=y\narch/mips/configs/generic_defconfig:17:CONFIG_BPF_SYSCALL=y\narch/mips/configs/generic_defconfig-18-CONFIG_USERFAULTFD=y\n--\narch/mips/configs/loongson3_defconfig=7=CONFIG_HIGH_RES_TIMERS=y\narch/mips/configs/loongson3_defconfig:8:CONFIG_BPF_SYSCALL=y\narch/mips/configs/loongson3_defconfig:9:CONFIG_BPF_JIT=y\narch/mips/configs/loongson3_defconfig-10-CONFIG_PREEMPT=y\n--\narch/mips/net/Makefile-3-\narch/mips/net/Makefile:4:obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o\narch/mips/net/Makefile-5-\narch/mips/net/Makefile=6=ifeq ($(CONFIG_32BIT),y)\narch/mips/net/Makefile:7: obj-$(CONFIG_BPF_JIT) += bpf_jit_comp32.o\narch/mips/net/Makefile-8-else\narch/mips/net/Makefile:9: obj-$(CONFIG_BPF_JIT) += bpf_jit_comp64.o\narch/mips/net/Makefile-10-endif\n--\narch/parisc/net/Makefile-2-\narch/parisc/net/Makefile:3:obj-$(CONFIG_BPF_JIT) += bpf_jit_core.o\narch/parisc/net/Makefile-4-\narch/parisc/net/Makefile=5=ifeq ($(CONFIG_64BIT),y)\narch/parisc/net/Makefile:6:\tobj-$(CONFIG_BPF_JIT) += bpf_jit_comp64.o\narch/parisc/net/Makefile-7-else\narch/parisc/net/Makefile:8:\tobj-$(CONFIG_BPF_JIT) += bpf_jit_comp32.o\narch/parisc/net/Makefile-9-endif\n--\narch/powerpc/configs/44x/fsp2_defconfig=16=CONFIG_KALLSYMS_ALL=y\narch/powerpc/configs/44x/fsp2_defconfig:17:CONFIG_BPF_SYSCALL=y\narch/powerpc/configs/44x/fsp2_defconfig-18-CONFIG_EXPERT=y\n--\narch/powerpc/configs/mpc885_ads_defconfig=4=CONFIG_HIGH_RES_TIMERS=y\narch/powerpc/configs/mpc885_ads_defconfig:5:CONFIG_BPF_JIT=y\narch/powerpc/configs/mpc885_ads_defconfig-6-CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y\n--\narch/powerpc/configs/powernv_defconfig=28=CONFIG_BLK_DEV_INITRD=y\narch/powerpc/configs/powernv_defconfig:29:CONFIG_BPF_SYSCALL=y\narch/powerpc/configs/powernv_defconfig-30-# CONFIG_COMPAT_BRK is not set\n--\narch/powerpc/configs/powernv_defconfig=94=CONFIG_DNS_RESOLVER=y\narch/powerpc/configs/powernv_defconfig:95:CONFIG_BPF_JIT=y\narch/powerpc/configs/powernv_defconfig-96-# CONFIG_WIRELESS is not set\n--\narch/powerpc/configs/ppc64_defconfig=6=CONFIG_HIGH_RES_TIMERS=y\narch/powerpc/configs/ppc64_defconfig:7:CONFIG_BPF_SYSCALL=y\narch/powerpc/configs/ppc64_defconfig:8:CONFIG_BPF_JIT=y\narch/powerpc/configs/ppc64_defconfig:9:CONFIG_BPF_LSM=y\narch/powerpc/configs/ppc64_defconfig-10-CONFIG_PREEMPT_VOLUNTARY=y\n--\narch/powerpc/net/Makefile-4-#\narch/powerpc/net/Makefile:5:obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o bpf_jit_comp$(BITS).o\narch/powerpc/net/Makefile-6-\narch/powerpc/net/Makefile=7=ifdef CONFIG_PPC64\narch/powerpc/net/Makefile:8:obj-$(CONFIG_BPF_JIT) += bpf_timed_may_goto.o\narch/powerpc/net/Makefile-9-endif\n--\narch/riscv/configs/defconfig=4=CONFIG_HIGH_RES_TIMERS=y\narch/riscv/configs/defconfig:5:CONFIG_BPF_SYSCALL=y\narch/riscv/configs/defconfig-6-CONFIG_IKCONFIG=y\n--\narch/riscv/include/asm/extable.h=38=static inline bool fixup_exception(struct pt_regs *regs) { return false; }\n--\narch/riscv/include/asm/extable.h-40-\narch/riscv/include/asm/extable.h:41:#if defined(CONFIG_BPF_JIT) \u0026\u0026 defined(CONFIG_ARCH_RV64I)\narch/riscv/include/asm/extable.h-42-bool ex_handler_bpf(const struct exception_table_entry *ex, struct pt_regs *regs);\n--\narch/riscv/net/Makefile-2-\narch/riscv/net/Makefile:3:obj-$(CONFIG_BPF_JIT) += bpf_jit_core.o\narch/riscv/net/Makefile-4-\narch/riscv/net/Makefile=5=ifeq ($(CONFIG_ARCH_RV64I),y)\narch/riscv/net/Makefile:6:\tobj-$(CONFIG_BPF_JIT) += bpf_jit_comp64.o\narch/riscv/net/Makefile-7-else\narch/riscv/net/Makefile:8:\tobj-$(CONFIG_BPF_JIT) += bpf_jit_comp32.o\narch/riscv/net/Makefile-9-endif\n--\narch/s390/configs/debug_defconfig=8=CONFIG_POSIX_AUX_CLOCKS=y\narch/s390/configs/debug_defconfig:9:CONFIG_BPF_SYSCALL=y\narch/s390/configs/debug_defconfig:10:CONFIG_BPF_JIT=y\narch/s390/configs/debug_defconfig:11:CONFIG_BPF_JIT_ALWAYS_ON=y\narch/s390/configs/debug_defconfig:12:CONFIG_BPF_LSM=y\narch/s390/configs/debug_defconfig-13-CONFIG_PREEMPT=y\n--\narch/s390/configs/defconfig=7=CONFIG_POSIX_AUX_CLOCKS=y\narch/s390/configs/defconfig:8:CONFIG_BPF_SYSCALL=y\narch/s390/configs/defconfig:9:CONFIG_BPF_JIT=y\narch/s390/configs/defconfig:10:CONFIG_BPF_JIT_ALWAYS_ON=y\narch/s390/configs/defconfig:11:CONFIG_BPF_LSM=y\narch/s390/configs/defconfig-12-CONFIG_SCHED_CORE=y\n--\narch/s390/configs/zfcpdump_defconfig=3=CONFIG_POSIX_AUX_CLOCKS=y\narch/s390/configs/zfcpdump_defconfig:4:CONFIG_BPF_SYSCALL=y\narch/s390/configs/zfcpdump_defconfig-5-# CONFIG_CPU_ISOLATION is not set\n--\narch/s390/include/asm/extable.h=43=static inline void swap_ex_entry_fixup(struct exception_table_entry *a,\n--\narch/s390/include/asm/extable.h-56-\narch/s390/include/asm/extable.h:57:#ifdef CONFIG_BPF_JIT\narch/s390/include/asm/extable.h-58-\narch/s390/include/asm/extable.h=59=bool ex_handler_bpf(const struct exception_table_entry *ex, struct pt_regs *regs);\narch/s390/include/asm/extable.h-60-\narch/s390/include/asm/extable.h:61:#else /* !CONFIG_BPF_JIT */\narch/s390/include/asm/extable.h-62-\narch/s390/include/asm/extable.h=63=static inline bool ex_handler_bpf(const struct exception_table_entry *ex, struct pt_regs *regs)\n--\narch/s390/include/asm/extable.h-67-\narch/s390/include/asm/extable.h:68:#endif /* CONFIG_BPF_JIT */\narch/s390/include/asm/extable.h-69-\n--\narch/s390/kernel/Makefile=81=obj-$(CONFIG_TRACEPOINTS)\t+= trace.o\narch/s390/kernel/Makefile-82-\narch/s390/kernel/Makefile:83:obj-$(CONFIG_BPF_SYSCALL)\t+= bpf.o\narch/s390/kernel/Makefile-84-\n--\narch/s390/net/Makefile-4-#\narch/s390/net/Makefile:5:obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o bpf_timed_may_goto.o\narch/s390/net/Makefile-6-obj-$(CONFIG_HAVE_PNETID) += pnet.o\n--\narch/sparc/net/Makefile-4-#\narch/sparc/net/Makefile:5:obj-$(CONFIG_BPF_JIT) += bpf_jit_comp_$(BITS).o\narch/sparc/net/Makefile-6-ifeq ($(BITS),32)\narch/sparc/net/Makefile:7:obj-$(CONFIG_BPF_JIT) += bpf_jit_asm_32.o\narch/sparc/net/Makefile-8-endif\n--\narch/x86/include/asm/extable.h=46=static inline void __noreturn ex_handler_msr_mce(struct pt_regs *regs, bool wrmsr)\n--\narch/x86/include/asm/extable.h-52-\narch/x86/include/asm/extable.h:53:#if defined(CONFIG_BPF_JIT) \u0026\u0026 defined(CONFIG_X86_64)\narch/x86/include/asm/extable.h-54-bool ex_handler_bpf(const struct exception_table_entry *x, struct pt_regs *regs);\n--\narch/x86/kernel/callthunks.c=265=void *callthunks_translate_call_dest(void *dest)\n--\narch/x86/kernel/callthunks.c-280-\narch/x86/kernel/callthunks.c:281:#ifdef CONFIG_BPF_JIT\narch/x86/kernel/callthunks.c-282-static bool is_callthunk(void *addr)\n--\narch/x86/kernel/cpu/bugs.c=1655=static inline const char *spectre_v2_module_string(void) { return \"\"; }\n--\narch/x86/kernel/cpu/bugs.c-1662-\narch/x86/kernel/cpu/bugs.c:1663:#ifdef CONFIG_BPF_SYSCALL\narch/x86/kernel/cpu/bugs.c-1664-void unpriv_ebpf_notify(int new_state)\n--\narch/x86/kernel/unwind_orc.c=185=static struct orc_entry *orc_bpf_find(unsigned long ip)\narch/x86/kernel/unwind_orc.c-186-{\narch/x86/kernel/unwind_orc.c:187:#ifdef CONFIG_BPF_JIT\narch/x86/kernel/unwind_orc.c-188-\tif (bpf_has_frame_pointer(ip))\n--\narch/x86/net/Makefile=6=ifeq ($(CONFIG_X86_32),y)\narch/x86/net/Makefile:7: obj-$(CONFIG_BPF_JIT) += bpf_jit_comp32.o\narch/x86/net/Makefile-8-else\narch/x86/net/Makefile:9: obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o bpf_timed_may_goto.o\narch/x86/net/Makefile-10-endif\n--\ncrypto/Makefile=24=obj-$(CONFIG_CRYPTO_SKCIPHER2) += crypto_skcipher.o\ncrypto/Makefile:25:ifeq ($(CONFIG_BPF_SYSCALL),y)\ncrypto/Makefile-26-obj-$(CONFIG_CRYPTO_SKCIPHER2) += bpf_crypto_skcipher.o\n--\ndrivers/base/power/power.h=165=static inline void device_pm_init(struct device *dev)\n--\ndrivers/base/power/power.h-171-\ndrivers/base/power/power.h:172:#ifdef CONFIG_BPF_SYSCALL\ndrivers/base/power/power.h-173-struct bpf_ws_lock { };\n--\ndrivers/base/power/wakeup.c=1163=static const struct file_operations wakeup_sources_stats_fops = {\n--\ndrivers/base/power/wakeup.c-1170-\ndrivers/base/power/wakeup.c:1171:#ifdef CONFIG_BPF_SYSCALL\ndrivers/base/power/wakeup.c-1172-#include \u003clinux/btf.h\u003e\n--\ndrivers/base/power/wakeup.c=1233=static inline void wakeup_sources_bpf_init(void) {}\ndrivers/base/power/wakeup.c:1234:#endif /* CONFIG_BPF_SYSCALL */\ndrivers/base/power/wakeup.c-1235-\n--\ndrivers/media/rc/Makefile=7=rc-core-$(CONFIG_MEDIA_CEC_RC) += keymaps/rc-cec.o\ndrivers/media/rc/Makefile:8:rc-core-$(CONFIG_BPF_LIRC_MODE2) += bpf-lirc.o\ndrivers/media/rc/Makefile-9-\n--\ndrivers/media/rc/rc-core-priv.h=48=struct ir_raw_event_ctrl {\n--\ndrivers/media/rc/rc-core-priv.h-62-\ndrivers/media/rc/rc-core-priv.h:63:#ifdef CONFIG_BPF_LIRC_MODE2\ndrivers/media/rc/rc-core-priv.h-64-\tu32\t\t\t\tbpf_sample;\n--\ndrivers/media/rc/rc-core-priv.h=337=static inline void lirc_unregister(struct rc_dev *dev) { }\n--\ndrivers/media/rc/rc-core-priv.h-342- */\ndrivers/media/rc/rc-core-priv.h:343:#ifdef CONFIG_BPF_LIRC_MODE2\ndrivers/media/rc/rc-core-priv.h-344-void lirc_bpf_free(struct rc_dev *dev);\n--\ndrivers/net/ethernet/netronome/nfp/Makefile=64=endif\ndrivers/net/ethernet/netronome/nfp/Makefile-65-\ndrivers/net/ethernet/netronome/nfp/Makefile:66:ifeq ($(CONFIG_BPF_SYSCALL),y)\ndrivers/net/ethernet/netronome/nfp/Makefile-67-nfp-objs += \\\n--\ndrivers/net/ethernet/netronome/nfp/nfp_app.c=18=static const struct nfp_app_type *apps[] = {\ndrivers/net/ethernet/netronome/nfp/nfp_app.c-19-\t[NFP_APP_CORE_NIC]\t= \u0026app_nic,\ndrivers/net/ethernet/netronome/nfp/nfp_app.c:20:#ifdef CONFIG_BPF_SYSCALL\ndrivers/net/ethernet/netronome/nfp/nfp_app.c-21-\t[NFP_APP_BPF_NIC]\t= \u0026app_bpf,\n--\ndrivers/net/netdevsim/Makefile=5=netdevsim-objs := \\\n--\ndrivers/net/netdevsim/Makefile-7-\ndrivers/net/netdevsim/Makefile:8:ifeq ($(CONFIG_BPF_SYSCALL),y)\ndrivers/net/netdevsim/Makefile-9-netdevsim-objs += \\\n--\ndrivers/net/netdevsim/netdevsim.h=176=void nsim_udp_tunnels_info_destroy(struct net_device *dev);\ndrivers/net/netdevsim/netdevsim.h-177-\ndrivers/net/netdevsim/netdevsim.h:178:#ifdef CONFIG_BPF_SYSCALL\ndrivers/net/netdevsim/netdevsim.h-179-int nsim_bpf_dev_init(struct nsim_dev *nsim_dev);\n--\nfs/Makefile=129=obj-$(CONFIG_ZONEFS_FS)\t\t+= zonefs/\nfs/Makefile:130:obj-$(CONFIG_BPF_LSM)\t\t+= bpf_fs_kfuncs.o\nfs/Makefile-131-obj-$(CONFIG_RESCTRL_FS)\t+= resctrl/\n--\nfs/verity/fsverity_private.h=106=fsverity_msg(const struct inode *inode, const char *level,\n--\nfs/verity/fsverity_private.h-115-\nfs/verity/fsverity_private.h:116:#ifdef CONFIG_BPF_SYSCALL\nfs/verity/fsverity_private.h-117-void __init fsverity_init_bpf(void);\n--\nfs/verity/measure.c=105=EXPORT_SYMBOL_GPL(fsverity_get_digest);\nfs/verity/measure.c-106-\nfs/verity/measure.c:107:#ifdef CONFIG_BPF_SYSCALL\nfs/verity/measure.c-108-\n--\nfs/verity/measure.c=183=void __init fsverity_init_bpf(void)\n--\nfs/verity/measure.c-187-\nfs/verity/measure.c:188:#endif /* CONFIG_BPF_SYSCALL */\n--\ninclude/asm-generic/vmlinux.lds.h-298-\ninclude/asm-generic/vmlinux.lds.h:299:#ifdef CONFIG_BPF_EVENTS\ninclude/asm-generic/vmlinux.lds.h-300-#define BPF_RAW_TP() STRUCT_ALIGN();\t\t\t\t\\\n--\ninclude/linux/bpf-cgroup-defs.h=11=struct bpf_prog_array;\ninclude/linux/bpf-cgroup-defs.h-12-\ninclude/linux/bpf-cgroup-defs.h:13:#ifdef CONFIG_BPF_LSM\ninclude/linux/bpf-cgroup-defs.h-14-/* Maximum number of concurrently attachable per-cgroup LSM hooks. */\n--\ninclude/linux/bpf.h=1509=struct bpf_tracing_multi_link;\ninclude/linux/bpf.h-1510-\ninclude/linux/bpf.h:1511:#ifdef CONFIG_BPF_JIT\ninclude/linux/bpf.h-1512-int bpf_trampoline_link_prog(struct bpf_tramp_node *node,\n--\ninclude/linux/bpf.h=2193=static inline bool is_tracing_multi(enum bpf_attach_type type)\n--\ninclude/linux/bpf.h-2198-\ninclude/linux/bpf.h:2199:#if defined(CONFIG_BPF_JIT) \u0026\u0026 defined(CONFIG_BPF_SYSCALL)\ninclude/linux/bpf.h-2200-/* This macro helps developer to register a struct_ops type and generate\n--\ninclude/linux/bpf.h=2348=int bpf_prog_ctx_arg_info_init(struct bpf_prog *prog,\n--\ninclude/linux/bpf.h-2350-\ninclude/linux/bpf.h:2351:#if defined(CONFIG_CGROUP_BPF) \u0026\u0026 defined(CONFIG_BPF_LSM)\ninclude/linux/bpf.h-2352-int bpf_trampoline_link_cgroup_shim(struct bpf_prog *prog,\n--\ninclude/linux/bpf.h=2550=static inline struct bpf_run_ctx *bpf_set_run_ctx(struct bpf_run_ctx *new_ctx)\n--\ninclude/linux/bpf.h-2553-\ninclude/linux/bpf.h:2554:#ifdef CONFIG_BPF_SYSCALL\ninclude/linux/bpf.h-2555-\told_ctx = current-\u003ebpf_ctx;\n--\ninclude/linux/bpf.h=2561=static inline void bpf_reset_run_ctx(struct bpf_run_ctx *old_ctx)\ninclude/linux/bpf.h-2562-{\ninclude/linux/bpf.h:2563:#ifdef CONFIG_BPF_SYSCALL\ninclude/linux/bpf.h-2564-\tcurrent-\u003ebpf_ctx = old_ctx;\n--\ninclude/linux/bpf.h=2654=bool bpf_jit_bypass_spec_v4(void);\n--\ninclude/linux/bpf.h-2658-\ninclude/linux/bpf.h:2659:#ifdef CONFIG_BPF_SYSCALL\ninclude/linux/bpf.h-2660-DECLARE_PER_CPU(int, bpf_prog_active);\n--\ninclude/linux/bpf.h=3047=int bpf_check(struct bpf_prog **fp, union bpf_attr *attr, bpfptr_t uattr,\n--\ninclude/linux/bpf.h-3049-\ninclude/linux/bpf.h:3050:#ifndef CONFIG_BPF_JIT_ALWAYS_ON\ninclude/linux/bpf.h-3051-int bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth);\n--\ninclude/linux/bpf.h=3220=bpf_prog_run_array_sleepable(const struct bpf_prog_array *array,\n--\ninclude/linux/bpf.h-3268-\ninclude/linux/bpf.h:3269:#else /* !CONFIG_BPF_SYSCALL */\ninclude/linux/bpf.h-3270-static inline struct bpf_prog *bpf_prog_get(u32 ufd)\n--\ninclude/linux/bpf.h=3562=static inline void bpf_prog_report_arena_violation(bool write, unsigned long addr,\n--\ninclude/linux/bpf.h-3565-}\ninclude/linux/bpf.h:3566:#endif /* CONFIG_BPF_SYSCALL */\ninclude/linux/bpf.h-3567-\n--\ninclude/linux/bpf.h=3574=bpf_probe_read_kernel_common(void *dst, u32 size, const void *unsafe_ptr)\n--\ninclude/linux/bpf.h-3577-\ninclude/linux/bpf.h:3578:\tif (IS_ENABLED(CONFIG_BPF_EVENTS))\ninclude/linux/bpf.h-3579-\t\tret = copy_from_kernel_nofault(dst, unsafe_ptr, size);\n--\ninclude/linux/bpf.h=3624=void unpriv_ebpf_notify(int new_state);\ninclude/linux/bpf.h-3625-\ninclude/linux/bpf.h:3626:#if defined(CONFIG_NET) \u0026\u0026 defined(CONFIG_BPF_SYSCALL)\ninclude/linux/bpf.h-3627-int bpf_dev_bound_kfunc_check(struct bpf_verifier_log *log,\n--\ninclude/linux/bpf.h=3731=static inline int bpf_prog_test_run_syscall(struct bpf_prog *prog,\n--\ninclude/linux/bpf.h-3737-\ninclude/linux/bpf.h:3738:#ifdef CONFIG_BPF_SYSCALL\ninclude/linux/bpf.h-3739-static inline int sock_map_get_from_fd(const union bpf_attr *attr,\n--\ninclude/linux/bpf.h=3763=static inline int sock_map_link_create(const union bpf_attr *attr, struct bpf_prog *prog)\n--\ninclude/linux/bpf.h-3766-}\ninclude/linux/bpf.h:3767:#endif /* CONFIG_BPF_SYSCALL */\ninclude/linux/bpf.h:3768:#endif /* CONFIG_NET \u0026\u0026 CONFIG_BPF_SYSCALL */\ninclude/linux/bpf.h-3769-\n--\ninclude/linux/bpf.h=3771=bpf_prog_inc_misses_counters(const struct bpf_prog_array *array)\n--\ninclude/linux/bpf.h-3785-\ninclude/linux/bpf.h:3786:#if defined(CONFIG_INET) \u0026\u0026 defined(CONFIG_BPF_SYSCALL)\ninclude/linux/bpf.h-3787-void bpf_sk_reuseport_detach(struct sock *sk);\n--\ninclude/linux/bpf.h=3793=static inline void bpf_sk_reuseport_detach(struct sock *sk)\n--\ninclude/linux/bpf.h-3796-\ninclude/linux/bpf.h:3797:#ifdef CONFIG_BPF_SYSCALL\ninclude/linux/bpf.h-3798-static inline int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map,\n--\ninclude/linux/bpf.h=3804=static inline int bpf_fd_reuseport_array_update_elem(struct bpf_map *map,\n--\ninclude/linux/bpf.h-3809-}\ninclude/linux/bpf.h:3810:#endif /* CONFIG_BPF_SYSCALL */\ninclude/linux/bpf.h:3811:#endif /* defined(CONFIG_INET) \u0026\u0026 defined(CONFIG_BPF_SYSCALL) */\ninclude/linux/bpf.h-3812-\n--\ninclude/linux/bpf.h=3814=struct bpf_key {\n--\ninclude/linux/bpf.h-3819-\ninclude/linux/bpf.h:3820:#if defined(CONFIG_KEYS) \u0026\u0026 defined(CONFIG_BPF_SYSCALL)\ninclude/linux/bpf.h-3821-struct bpf_key *bpf_lookup_user_key(s32 serial, u64 flags);\n--\ninclude/linux/bpf.h=3854=static inline s32 bpf_key_serial(const struct bpf_key *key)\n--\ninclude/linux/bpf.h-3857-}\ninclude/linux/bpf.h:3858:#endif /* defined(CONFIG_KEYS) \u0026\u0026 defined(CONFIG_BPF_SYSCALL) */\ninclude/linux/bpf.h-3859-\n--\ninclude/linux/bpf.h=4112=int bpf_stream_stage_dump_stack(struct bpf_stream_stage *ss);\n\n"
} |
| 11/2 | 2026/06/29 18:08 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 18879 output: 27 thoughts: 167 Thoughts: **Analyzing the BPF Code Change and Dependencies** Okay, so I'm looking at this BPF change, and it seems the patch itself is nestled within `kernel/bpf/verifier.c`. The accompanying test is located in `tools/testing/selftests/bpf/prog_tests/sockmap_basic.c`. My initial thought is that `CONFIG_BPF_SYSCALL` is a given, a foundational requirement. Now, because it's BPF related, I need to consider which other configurations might be relevant. It could be something straightforward, like `CONFIG_CGROUP_BPF`, or perhaps `CONFIG_NET` or `CONFIG_BPF_JIT`. Usually, a verifier change would just need `CONFIG_BPF_SYSCALL`, but because this is sockmap related, it might be more specific. I'll need to dig deeper. I'm wondering if `CONFIG_BPF_STREAM_PARSER` or `CONFIG_NET_SOCK_MSG` is involved. Let me take a closer look at the `Makefile`s within the kernel. I'll start with `kernel/bpf/Makefile` and then move to `net/core/Makefile` to see if I can spot any direct references to sockmap that could shed some light on the required dependencies. That's the best way to get to the bottom of this. |
| 12/2 | 2026/06/29 18:08 | tool | grepper |
0mError:no matches Args: {
"Expression": "sockmap",
"PathPrefix": "net/core/Makefile"
}Results: {
"error": "no matches"
} |
| 13/2 | 2026/06/29 18:08 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 19386 output: 27 thoughts: 20 Thoughts: Here's a summary of my immediate thought process: **Diving into the Kernel Network Core** Alright, let's get down to brass tacks. I need to figure out where the relevant definitions for socket and BPF-related code are, likely in the build system. My gut tells me it'll be in the `net/core/` directory, so the first thing I'm going to look at is the `Makefile` there. It's the central point for building that part of the kernel, and the build system often contains conditional logic or macros for different features. I'm going to scan that `Makefile` looking for directives, includes, or variables that reference "sock" or "bpf" – those are the keywords that'll point me to the files I need. Hopefully, this will lead me to the headers or source files. |
| 14/2 | 2026/06/29 18:09 | tool | grepper |
0mArgs:{
"Expression": "bpf",
"PathPrefix": "net/core/Makefile"
}Results: {
"Output": "net/core/Makefile=38=obj-$(CONFIG_LWTUNNEL) += lwtunnel.o\nnet/core/Makefile:39:obj-$(CONFIG_LWTUNNEL_BPF) += lwt_bpf.o\nnet/core/Makefile-40-obj-$(CONFIG_DST_CACHE) += dst_cache.o\n--\nnet/core/Makefile=45=obj-$(CONFIG_BPF_SYSCALL) += sock_map.o\nnet/core/Makefile:46:obj-$(CONFIG_BPF_SYSCALL) += bpf_sk_storage.o\nnet/core/Makefile-47-obj-$(CONFIG_OF)\t+= of_net.o\n"
} |
| 15/2 | 2026/06/29 18:09 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 19793 output: 31 thoughts: 68 Thoughts: **Investigating the Compilation of sock_map.o** Okay, so I see that `sock_map.o` gets compiled when `CONFIG_BPF_SYSCALL` is enabled. That makes sense, given the name. But hang on... `sock_map.o` resides in `net/core/`. I need to understand this a bit better. This usually means it's a core component. Let me open up `net/core/sock_map.c` and quickly scan the code. I need to figure out what other dependencies or relationships are at play here. This way I can determine why this module is found in a core directory. |
| 16/2 | 2026/06/29 18:09 | tool | grepper |
0mArgs:{
"Expression": "CONFIG_",
"PathPrefix": "net/core/sock_map.c"
}Results: {
"Output": "net/core/sock_map.c=1475=static int sock_map_prog_link_lookup(struct bpf_map *map, struct bpf_prog ***pprog,\n--\nnet/core/sock_map.c-1489-\t\tbreak;\nnet/core/sock_map.c:1490:#if IS_ENABLED(CONFIG_BPF_STREAM_PARSER)\nnet/core/sock_map.c-1491-\tcase BPF_SK_SKB_STREAM_PARSER:\n"
} |
| 17/2 | 2026/06/29 18:09 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 20172 output: 34 thoughts: 163 Thoughts: **Examining BPF Verifier Configuration** Okay, so `CONFIG_BPF_SYSCALL` is the critical piece here, the primary enabler. My initial focus has to be on that. Now, are there any other *specific* configs in play? I need to check. The patch is touching `kernel/bpf/verifier.c`, which makes me think about any program type-specific configurations, like for `BPF_PROG_TYPE_SCHED_CLS` or `BPF_PROG_TYPE_XDP`. Hmm, I wonder if `CONFIG_NET_CLS_BPF` is involved? Wait, the verifier handles all types if `CONFIG_BPF_SYSCALL` is active, right? Though, I suppose some of those types might be unavailable if `CONFIG_NET` is disabled. However, that's not a likely scenario. `CONFIG_NET` is practically always enabled. Still, to be thorough, I should look around the `may_update_sockmap` section in `kernel/bpf/verifier.c`. Let's confirm that area specifically. |
| 18/2 | 2026/06/29 18:09 | tool | grepper |
0mArgs:{
"Expression": "may_update_sockmap",
"PathPrefix": "kernel/bpf/verifier.c"
}Results: {
"Output": "kernel/bpf/verifier.c=8227=static int check_func_arg(struct bpf_verifier_env *env, u32 arg,\n--\nkernel/bpf/verifier.c-8468-\nkernel/bpf/verifier.c:8469:static bool may_update_sockmap(struct bpf_verifier_env *env, int func_id)\nkernel/bpf/verifier.c-8470-{\n--\nkernel/bpf/verifier.c=8509=static int check_map_func_compatibility(struct bpf_verifier_env *env,\n--\nkernel/bpf/verifier.c-8584-\t\t func_id != BPF_FUNC_map_lookup_elem \u0026\u0026\nkernel/bpf/verifier.c:8585:\t\t !may_update_sockmap(env, func_id))\nkernel/bpf/verifier.c-8586-\t\t\tgoto error;\n--\nkernel/bpf/verifier.c-8593-\t\t func_id != BPF_FUNC_map_lookup_elem \u0026\u0026\nkernel/bpf/verifier.c:8594:\t\t !may_update_sockmap(env, func_id))\nkernel/bpf/verifier.c-8595-\t\t\tgoto error;\n"
} |
| 19/2 | 2026/06/29 18:09 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 20934 output: 39 thoughts: 246 Thoughts: **Analyzing Potential Targets for BPF Fuzzing** Okay, so I'm looking at this patch modifying `may_update_sockmap` within `kernel/bpf/verifier.c`. This function, as I recall, is called from `check_map_func_compatibility`, which is interesting from a fuzzing perspective. My initial thought is to target these functions directly: `may_update_sockmap` and `check_map_func_compatibility`. However, both of these are declared `static`. That could be a problem – they might be inlined or, at the very least, not directly accessible. Let's do some quick checks. Yes, `check_map_func_compatibility` is also static, so my initial target is probably not the right one. Let me check `check_helper_call` just to make sure – ah, and that's also static. Okay, let's see, what about the main entry point, `bpf_check`? Yes, it's exported and thus accessible but it’s too generic. I'm leaning towards providing both `check_map_func_compatibility` and `may_update_sockmap`. Fuzzers can usually handle static functions, especially if they are not fully inlined. It's worth a shot. Just to be thorough, I should double-check the relevant kernel configurations. `CONFIG_BPF_SYSCALL` is the obvious one, but are there any others that might influence the visibility or behavior of these functions? Let's take a look at the `tools/testing/selftests/bpf/config` file. It's always good to be certain I have the complete picture before moving forward. |
| 20/2 | 2026/06/29 18:09 | tool | read-file |
0mArgs:{
"File": "tools/testing/selftests/bpf/config",
"FirstLine": 1,
"LineCount": 100
}Results: {
"Contents": " 1:\tCONFIG_BLK_DEV_LOOP=y\n 2:\tCONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y\n 3:\tCONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=1\n 4:\tCONFIG_BPF=y\n 5:\tCONFIG_BPF_EVENTS=y\n 6:\tCONFIG_BPF_JIT=y\n 7:\tCONFIG_BPF_KPROBE_OVERRIDE=y\n 8:\tCONFIG_BPF_LIRC_MODE2=y\n 9:\tCONFIG_BPF_LSM=y\n 10:\tCONFIG_BPF_STREAM_PARSER=y\n 11:\tCONFIG_BPF_SYSCALL=y\n 12:\t# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set\n 13:\tCONFIG_CGROUP_BPF=y\n 14:\tCONFIG_CRYPTO_HMAC=y\n 15:\tCONFIG_CRYPTO_SHA256=y\n 16:\tCONFIG_CRYPTO_USER_API=y\n 17:\tCONFIG_CRYPTO_USER_API_HASH=y\n 18:\tCONFIG_CRYPTO_USER_API_SKCIPHER=y\n 19:\tCONFIG_CRYPTO_SKCIPHER=y\n 20:\tCONFIG_CRYPTO_ECB=y\n 21:\tCONFIG_CRYPTO_AES=y\n 22:\tCONFIG_DEBUG_INFO=y\n 23:\tCONFIG_DEBUG_INFO_BTF=y\n 24:\tCONFIG_DEBUG_INFO_DWARF4=y\n 25:\tCONFIG_DMABUF_HEAPS=y\n 26:\tCONFIG_DMABUF_HEAPS_SYSTEM=y\n 27:\tCONFIG_DUMMY=y\n 28:\tCONFIG_DYNAMIC_FTRACE=y\n 29:\tCONFIG_FPROBE=y\n 30:\tCONFIG_FTRACE_SYSCALLS=y\n 31:\tCONFIG_FUNCTION_ERROR_INJECTION=y\n 32:\tCONFIG_FUNCTION_TRACER=y\n 33:\tCONFIG_FS_VERITY=y\n 34:\tCONFIG_GENEVE=y\n 35:\tCONFIG_IKCONFIG=y\n 36:\tCONFIG_IKCONFIG_PROC=y\n 37:\tCONFIG_IMA=y\n 38:\tCONFIG_IMA_READ_POLICY=y\n 39:\tCONFIG_IMA_WRITE_POLICY=y\n 40:\tCONFIG_INET_ESP=y\n 41:\tCONFIG_IP_NF_FILTER=y\n 42:\tCONFIG_IP_NF_RAW=y\n 43:\tCONFIG_IP_NF_TARGET_SYNPROXY=y\n 44:\tCONFIG_IPV6=y\n 45:\tCONFIG_IPV6_FOU=y\n 46:\tCONFIG_IPV6_FOU_TUNNEL=y\n 47:\tCONFIG_IPV6_GRE=y\n 48:\tCONFIG_IPV6_IOAM6_LWTUNNEL=y\n 49:\tCONFIG_IPV6_SEG6_BPF=y\n 50:\tCONFIG_IPV6_SEG6_LWTUNNEL=y\n 51:\tCONFIG_IPV6_SIT=y\n 52:\tCONFIG_IPV6_TUNNEL=y\n 53:\tCONFIG_KEYS=y\n 54:\tCONFIG_LIRC=y\n 55:\tCONFIG_LIVEPATCH=y\n 56:\tCONFIG_LWTUNNEL=y\n 57:\tCONFIG_LWTUNNEL_BPF=y\n 58:\tCONFIG_MODULE_SIG=y\n 59:\tCONFIG_MODULE_SRCVERSION_ALL=y\n 60:\tCONFIG_MODULE_UNLOAD=y\n 61:\tCONFIG_MODULES=y\n 62:\tCONFIG_MODVERSIONS=y\n 63:\tCONFIG_MPLS=y\n 64:\tCONFIG_MPLS_IPTUNNEL=y\n 65:\tCONFIG_MPLS_ROUTING=y\n 66:\tCONFIG_MPTCP=y\n 67:\tCONFIG_NET_ACT_GACT=y\n 68:\tCONFIG_NET_ACT_MIRRED=y\n 69:\tCONFIG_NET_ACT_SKBMOD=y\n 70:\tCONFIG_NET_CLS=y\n 71:\tCONFIG_NET_CLS_ACT=y\n 72:\tCONFIG_NET_CLS_BPF=y\n 73:\tCONFIG_NET_CLS_FLOWER=y\n 74:\tCONFIG_NET_CLS_MATCHALL=y\n 75:\tCONFIG_NET_FOU=y\n 76:\tCONFIG_NET_FOU_IP_TUNNELS=y\n 77:\tCONFIG_NET_IPGRE=y\n 78:\tCONFIG_NET_IPGRE_DEMUX=y\n 79:\tCONFIG_NET_IPIP=y\n 80:\tCONFIG_NET_MPLS_GSO=y\n 81:\tCONFIG_NET_SCH_BPF=y\n 82:\tCONFIG_NET_SCH_FQ=y\n 83:\tCONFIG_NET_SCH_INGRESS=y\n 84:\tCONFIG_NET_SCH_HTB=y\n 85:\tCONFIG_NET_SCHED=y\n 86:\tCONFIG_NETDEVSIM=y\n 87:\tCONFIG_NETFILTER=y\n 88:\tCONFIG_NETFILTER_ADVANCED=y\n 89:\tCONFIG_NETFILTER_SYNPROXY=y\n 90:\tCONFIG_NETFILTER_XT_CONNMARK=y\n 91:\tCONFIG_NETFILTER_XT_MATCH_STATE=y\n 92:\tCONFIG_NETFILTER_XT_TARGET_CT=y\n 93:\tCONFIG_NETKIT=y\n 94:\tCONFIG_NF_CONNTRACK=y\n 95:\tCONFIG_NF_CONNTRACK_MARK=y\n 96:\tCONFIG_NF_CONNTRACK_ZONES=y\n 97:\tCONFIG_NF_DEFRAG_IPV4=y\n 98:\tCONFIG_NF_DEFRAG_IPV6=y\n 99:\tCONFIG_NF_TABLES=y\n 100:\tCONFIG_NF_TABLES_INET=y\n"
} |
| 21/2 | 2026/06/29 18:09 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 23132 output: 38 thoughts: 56 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Kernel Configuration Considerations for Sockmap Implementation** Right, let's nail down these kernel config options for this sockmap implementation. Absolutely, `CONFIG_BPF_SYSCALL` is a non-negotiable prerequisite. We can't do anything BPF-related without it. Now, given the nature of sockmap, and how deeply it interfaces with network streams, I'm leaning towards also needing `CONFIG_BPF_STREAM_PARSER`. This feels right, doesn't it? It just seems incredibly likely that stream parsing will be essential for making it all sing. Just to be absolutely sure, let's take another quick pass over `net/core/sock_map.c`. A fresh look always helps clarify dependencies and potential gotchas. I want to make sure I'm not missing anything obvious, any subtle interplay. Need to be certain before moving forward. |
| 22/2 | 2026/06/29 18:09 | tool | grepper |
0mArgs:{
"Expression": "CONFIG_BPF_STREAM_PARSER",
"PathPrefix": "net/core/sock_map.c"
}Results: {
"Output": "net/core/sock_map.c=1475=static int sock_map_prog_link_lookup(struct bpf_map *map, struct bpf_prog ***pprog,\n--\nnet/core/sock_map.c-1489-\t\tbreak;\nnet/core/sock_map.c:1490:#if IS_ENABLED(CONFIG_BPF_STREAM_PARSER)\nnet/core/sock_map.c-1491-\tcase BPF_SK_SKB_STREAM_PARSER:\n"
} |
| 23/2 | 2026/06/29 18:09 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 23570 output: 40 thoughts: 319 Thoughts: **My Configuration Considerations** Okay, so it looks like `CONFIG_BPF_SYSCALL` handles the verifier's needs, which is good. Now, I need to confirm whether `CONFIG_NET` is essential. Ah, yes, `sockmap` is definitely networking-related. Therefore, the core requirements are going to be `CONFIG_BPF_SYSCALL` and `CONFIG_NET`. I should return `BPF_SYSCALL` and `NET` as a basic set. Wait a second, this patch removes some BPF program types from the allowed list. Specifically, `BPF_PROG_TYPE_SCHED_CLS`, `BPF_PROG_TYPE_SCHED_ACT`, `BPF_PROG_TYPE_XDP`, and `BPF_PROG_TYPE_FLOW_DISSECTOR`. To adequately test this, I'll need to be able to load these program types, which means enabling the necessary configuration options. Let's see, `BPF_PROG_TYPE_SCHED_CLS` requires `CONFIG_NET_CLS_BPF`. `BPF_PROG_TYPE_SCHED_ACT` needs either `CONFIG_NET_ACT_BPF` or `CONFIG_NET_CLS_ACT`. Both `BPF_PROG_TYPE_XDP` and `BPF_PROG_TYPE_FLOW_DISSECTOR` require `CONFIG_NET`. It's starting to look like `CONFIG_NET_CLS_BPF` and `CONFIG_NET_ACT_BPF` are wise additions to my configuration for testing purposes. I think I'll dive into `kernel/bpf/verifier.c` to double-check the dependencies of these program types before making any final decisions. |
| 24/2 | 2026/06/29 18:09 | tool | grepper |
0mArgs:{
"Expression": "BPF_PROG_TYPE_SCHED_CLS",
"PathPrefix": "kernel/bpf/verifier.c"
}Results: {
"Output": "kernel/bpf/verifier.c=4636=static bool may_access_direct_pkt_data(struct bpf_verifier_env *env,\n--\nkernel/bpf/verifier.c-4654-\t/* Program types with direct read + write access go here! */\nkernel/bpf/verifier.c:4655:\tcase BPF_PROG_TYPE_SCHED_CLS:\nkernel/bpf/verifier.c-4656-\tcase BPF_PROG_TYPE_SCHED_ACT:\n--\nkernel/bpf/verifier.c=16286=static bool may_access_skb(enum bpf_prog_type type)\n--\nkernel/bpf/verifier.c-16289-\tcase BPF_PROG_TYPE_SOCKET_FILTER:\nkernel/bpf/verifier.c:16290:\tcase BPF_PROG_TYPE_SCHED_CLS:\nkernel/bpf/verifier.c-16291-\tcase BPF_PROG_TYPE_SCHED_ACT:\n"
} |
| 25/2 | 2026/06/29 18:09 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 24583 output: 120 thoughts: 325 Thoughts: **My Assessment of the BPF Verifier Change** Okay, so here's the deal: even if a subsystem for a specific BPF program type isn't active, the verifier will *still* run its checks on that program type, as long as `CONFIG_BPF_SYSCALL` is enabled. That's the crucial point. The program types themselves are laid out in `include/uapi/linux/bpf.h`, and the verifier does its job looking them over at load time. Sure, you need the subsystem to *actually* attach the programs, but the verification happens upfront. So, enabling `CONFIG_BPF_SYSCALL` is enough to trigger the relevant code. So, to recap for fuzzing purposes: * **WorthFuzzing:** Absolutely. * **Reasoning:** This patch is about a functional change, restricting what BPF program types can touch a sockmap. This alters the verifier's behavior to enhance safety, and thus needs targeted fuzzing. * **FocusSymbols:** `may_update_sockmap`, `check_map_func_compatibility`, and `check_helper_call` are key areas. * **EnableConfigs:** `BPF_SYSCALL` and `NET` are necessary. Now, let's confirm the targets: I've checked and confirmed that `may_update_sockmap`, `check_map_func_compatibility`, and `check_helper_call` are all static functions. That's good, it narrows the scope a bit. The main entry point, `bpf_check`, is a little too broad for targeted fuzzing. My approach will be to focus on `check_helper_call` and `check_map_func_compatibility`. These static functions are the most promising targets for fuzzing to ensure the verifier correctly enforces these new restrictions. Let's call set-results. |
| 26/2 | 2026/06/29 18:09 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"BPF_SYSCALL",
"NET"
],
"FocusSymbols": [
"check_map_func_compatibility",
"check_helper_call",
"may_update_sockmap"
],
"Reasoning": "The patch restricts the BPF program types that are allowed to update a sockmap. This is a functional change in the BPF verifier that prevents certain program types from performing potentially unsafe operations. Fuzzing the verifier with these restrictions is valuable.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"BPF_SYSCALL",
"NET"
],
"FocusSymbols": [
"check_map_func_compatibility",
"check_helper_call",
"may_update_sockmap"
],
"Reasoning": "The patch restricts the BPF program types that are allowed to update a sockmap. This is a functional change in the BPF verifier that prevents certain program types from performing potentially unsafe operations. Fuzzing the verifier with these restrictions is valuable.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|