| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/06/26 20:24 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": [
"BPF_JIT"
],
"FocusSymbols": [
"bpf_jit_alloc_exec",
"bpf_jit_alloc_exec_rw",
"bpf_prog_pack_alloc",
"bpf_dispatcher_change_prog"
],
"Reasoning": "The patch modifies BPF JIT memory allocation logic, introducing a new `bpf_jit_alloc_exec_rw` function and conditionally setting memory to ROX based on `bpf_jit_mem_is_rox()`. It also changes `bpf_dispatcher_change_prog` to use `vmalloc` instead of `bpf_jit_alloc_exec`. These are functional changes to BPF JIT memory management and are reachable via BPF program loading and dispatcher updates.",
"WorthFuzzing": true
} |
| 1/1 | 2026/06/26 20:24 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 98b24ce7e0aa3a955934521da9c6614cbb2ffa73\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Fri Jun 26 20:24:36 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c\nindex fb67217fddcd37..079f8c7e9e3cde 100644\n--- a/arch/x86/mm/init.c\n+++ b/arch/x86/mm/init.c\n@@ -1107,10 +1107,10 @@ struct execmem_info __init *execmem_arch_setup(void)\n \t\t\t\t.alignment = MODULE_ALIGN,\n \t\t\t},\n \t\t\t[EXECMEM_BPF] = {\n-\t\t\t\t.flags\t= EXECMEM_KASAN_SHADOW,\n+\t\t\t\t.flags\t= flags,\n \t\t\t\t.start\t= start,\n \t\t\t\t.end\t= MODULES_END,\n-\t\t\t\t.pgprot\t= PAGE_KERNEL,\n+\t\t\t\t.pgprot\t= pgprot,\n \t\t\t\t.alignment = MODULE_ALIGN,\n \t\t\t},\n \t\t\t[EXECMEM_MODULE_DATA] = {\ndiff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c\nindex 054e043ffcd22d..ba562d3bf031e9 100644\n--- a/arch/x86/net/bpf_jit_comp.c\n+++ b/arch/x86/net/bpf_jit_comp.c\n@@ -3703,13 +3703,12 @@ int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\n \tint ret;\n \n \t/* Allocate a temporary buffer for __arch_prepare_bpf_trampoline().\n-\t * This will NOT cause fragmentation in direct map, as we do not\n-\t * call set_memory_*() on this buffer.\n \t *\n \t * We cannot use kvmalloc here, because we need image to be in\n \t * module memory range.\n+\t * Since it must be writable use bpf_jit_alloc_exec_rw().\n \t */\n-\timage = bpf_jit_alloc_exec(PAGE_SIZE);\n+\timage = bpf_jit_alloc_exec_rw(PAGE_SIZE);\n \tif (!image)\n \t\treturn -ENOMEM;\n \ndiff --git a/include/linux/filter.h b/include/linux/filter.h\nindex 67d337ede91b8e..773b16f06572c0 100644\n--- a/include/linux/filter.h\n+++ b/include/linux/filter.h\n@@ -1323,6 +1323,7 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,\n void bpf_jit_binary_free(struct bpf_binary_header *hdr);\n u64 bpf_jit_alloc_exec_limit(void);\n void *bpf_jit_alloc_exec(unsigned long size);\n+void *bpf_jit_alloc_exec_rw(unsigned long size);\n void bpf_jit_free_exec(void *addr);\n void bpf_jit_free(struct bpf_prog *fp);\n struct bpf_binary_header *\ndiff --git a/kernel/bpf/core.c b/kernel/bpf/core.c\nindex 649cce41e13f3b..55284b5d0292dc 100644\n--- a/kernel/bpf/core.c\n+++ b/kernel/bpf/core.c\n@@ -904,6 +904,11 @@ static LIST_HEAD(pack_list);\n \n #define BPF_PROG_CHUNK_COUNT (BPF_PROG_PACK_SIZE / BPF_PROG_CHUNK_SIZE)\n \n+static bool bpf_jit_mem_is_rox(void)\n+{\n+\treturn execmem_is_rox(EXECMEM_BPF);\n+}\n+\n static struct bpf_prog_pack *alloc_new_pack(bpf_jit_fill_hole_t bpf_fill_ill_insns)\n {\n \tstruct bpf_prog_pack *pack;\n@@ -915,14 +920,16 @@ static struct bpf_prog_pack *alloc_new_pack(bpf_jit_fill_hole_t bpf_fill_ill_ins\n \tpack-\u003eptr = bpf_jit_alloc_exec(BPF_PROG_PACK_SIZE);\n \tif (!pack-\u003eptr)\n \t\tgoto out;\n-\tbpf_fill_ill_insns(pack-\u003eptr, BPF_PROG_PACK_SIZE);\n \tbitmap_zero(pack-\u003ebitmap, BPF_PROG_PACK_SIZE / BPF_PROG_CHUNK_SIZE);\n \n-\tset_vm_flush_reset_perms(pack-\u003eptr);\n-\terr = set_memory_rox((unsigned long)pack-\u003eptr,\n-\t\t\t BPF_PROG_PACK_SIZE / PAGE_SIZE);\n-\tif (err)\n-\t\tgoto out;\n+\tif (!bpf_jit_mem_is_rox()) {\n+\t\tbpf_fill_ill_insns(pack-\u003eptr, BPF_PROG_PACK_SIZE);\n+\t\tset_vm_flush_reset_perms(pack-\u003eptr);\n+\t\terr = set_memory_rox((unsigned long)pack-\u003eptr,\n+\t\t\t\t BPF_PROG_PACK_SIZE / PAGE_SIZE);\n+\t\tif (err)\n+\t\t\tgoto out;\n+\t}\n \tlist_add_tail(\u0026pack-\u003elist, \u0026pack_list);\n \treturn pack;\n \n@@ -943,7 +950,7 @@ void *bpf_prog_pack_alloc(u32 size, bpf_jit_fill_hole_t bpf_fill_ill_insns)\n \tif (size \u003e BPF_PROG_PACK_SIZE) {\n \t\tsize = round_up(size, PAGE_SIZE);\n \t\tptr = bpf_jit_alloc_exec(size);\n-\t\tif (ptr) {\n+\t\tif (ptr \u0026\u0026 !bpf_jit_mem_is_rox()) {\n \t\t\tint err;\n \n \t\t\tbpf_fill_ill_insns(ptr, size);\n@@ -1060,12 +1067,17 @@ void bpf_jit_uncharge_modmem(u32 size)\n \tatomic_long_sub(size, \u0026bpf_jit_current);\n }\n \n-void *__weak bpf_jit_alloc_exec(unsigned long size)\n+void *bpf_jit_alloc_exec(unsigned long size)\n {\n \treturn execmem_alloc(EXECMEM_BPF, size);\n }\n \n-void __weak bpf_jit_free_exec(void *addr)\n+void *bpf_jit_alloc_exec_rw(unsigned long size)\n+{\n+\treturn execmem_alloc_rw(EXECMEM_BPF, size);\n+}\n+\n+void bpf_jit_free_exec(void *addr)\n {\n \texecmem_free(addr);\n }\ndiff --git a/kernel/bpf/dispatcher.c b/kernel/bpf/dispatcher.c\nindex b77db7413f8c70..a7a6a375cdd31d 100644\n--- a/kernel/bpf/dispatcher.c\n+++ b/kernel/bpf/dispatcher.c\n@@ -148,7 +148,10 @@ void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from,\n \t\td-\u003eimage = bpf_prog_pack_alloc(PAGE_SIZE, bpf_jit_fill_hole_with_zero);\n \t\tif (!d-\u003eimage)\n \t\t\tgoto out;\n-\t\td-\u003erw_image = bpf_jit_alloc_exec(PAGE_SIZE);\n+\t\t/* d-\u003erw_image doesn't need to be in module memory range, so we\n+\t\t * can use vmalloc.\n+\t\t */\n+\t\td-\u003erw_image = vmalloc(PAGE_SIZE);\n \t\tif (!d-\u003erw_image) {\n \t\t\tbpf_prog_pack_free(d-\u003eimage, PAGE_SIZE);\n \t\t\td-\u003eimage = NULL;\n"
} |
| 2/1 | 2026/06/26 20:24 | agent | patch-evaluator |
1mModel:gemini-3.1-pro-preview Args: null Results: {
"EnableConfigs": [
"BPF_JIT"
],
"FocusSymbols": [
"bpf_jit_alloc_exec",
"bpf_jit_alloc_exec_rw",
"bpf_prog_pack_alloc",
"bpf_dispatcher_change_prog"
],
"Reasoning": "The patch modifies BPF JIT memory allocation logic, introducing a new `bpf_jit_alloc_exec_rw` function and conditionally setting memory to ROX based on `bpf_jit_mem_is_rox()`. It also changes `bpf_dispatcher_change_prog` to use `vmalloc` instead of `bpf_jit_alloc_exec`. These are functional changes to BPF JIT memory management and are reachable via BPF program loading and dispatcher updates.",
"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 98b24ce7e0aa3a955934521da9c6614cbb2ffa73
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Jun 26 20:24:36 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index fb67217fddcd37..079f8c7e9e3cde 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -1107,10 +1107,10 @@ struct execmem_info __init *execmem_arch_setup(void)
.alignment = MODULE_ALIGN,
},
[EXECMEM_BPF] = {
- .flags = EXECMEM_KASAN_SHADOW,
+ .flags = flags,
.start = start,
.end = MODULES_END,
- .pgprot = PAGE_KERNEL,
+ .pgprot = pgprot,
.alignment = MODULE_ALIGN,
},
[EXECMEM_MODULE_DATA] = {
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 054e043ffcd22d..ba562d3bf031e9 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -3703,13 +3703,12 @@ int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
int ret;
/* Allocate a temporary buffer for __arch_prepare_bpf_trampoline().
- * This will NOT cause fragmentation in direct map, as we do not
- * call set_memory_*() on this buffer.
*
* We cannot use kvmalloc here, because we need image to be in
* module memory range.
+ * Since it must be writable use bpf_jit_alloc_exec_rw().
*/
- image = bpf_jit_alloc_exec(PAGE_SIZE);
+ image = bpf_jit_alloc_exec_rw(PAGE_SIZE);
if (!image)
return -ENOMEM;
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 67d337ede91b8e..773b16f06572c0 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -1323,6 +1323,7 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
void bpf_jit_binary_free(struct bpf_binary_header *hdr);
u64 bpf_jit_alloc_exec_limit(void);
void *bpf_jit_alloc_exec(unsigned long size);
+void *bpf_jit_alloc_exec_rw(unsigned long size);
void bpf_jit_free_exec(void *addr);
void bpf_jit_free(struct bpf_prog *fp);
struct bpf_binary_header *
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 649cce41e13f3b..55284b5d0292dc 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -904,6 +904,11 @@ static LIST_HEAD(pack_list);
#define BPF_PROG_CHUNK_COUNT (BPF_PROG_PACK_SIZE / BPF_PROG_CHUNK_SIZE)
+static bool bpf_jit_mem_is_rox(void)
+{
+ return execmem_is_rox(EXECMEM_BPF);
+}
+
static struct bpf_prog_pack *alloc_new_pack(bpf_jit_fill_hole_t bpf_fill_ill_insns)
{
struct bpf_prog_pack *pack;
@@ -915,14 +920,16 @@ static struct bpf_prog_pack *alloc_new_pack(bpf_jit_fill_hole_t bpf_fill_ill_ins
pack->ptr = bpf_jit_alloc_exec(BPF_PROG_PACK_SIZE);
if (!pack->ptr)
goto out;
- bpf_fill_ill_insns(pack->ptr, BPF_PROG_PACK_SIZE);
bitmap_zero(pack->bitmap, BPF_PROG_PACK_SIZE / BPF_PROG_CHUNK_SIZE);
- set_vm_flush_reset_perms(pack->ptr);
- err = set_memory_rox((unsigned long)pack->ptr,
- BPF_PROG_PACK_SIZE / PAGE_SIZE);
- if (err)
- goto out;
+ if (!bpf_jit_mem_is_rox()) {
+ bpf_fill_ill_insns(pack->ptr, BPF_PROG_PACK_SIZE);
+ set_vm_flush_reset_perms(pack->ptr);
+ err = set_memory_rox((unsigned long)pack->ptr,
+ BPF_PROG_PACK_SIZE / PAGE_SIZE);
+ if (err)
+ goto out;
+ }
list_add_tail(&pack->list, &pack_list);
return pack;
@@ -943,7 +950,7 @@ void *bpf_prog_pack_alloc(u32 size, bpf_jit_fill_hole_t bpf_fill_ill_insns)
if (size > BPF_PROG_PACK_SIZE) {
size = round_up(size, PAGE_SIZE);
ptr = bpf_jit_alloc_exec(size);
- if (ptr) {
+ if (ptr && !bpf_jit_mem_is_rox()) {
int err;
bpf_fill_ill_insns(ptr, size);
@@ -1060,12 +1067,17 @@ void bpf_jit_uncharge_modmem(u32 size)
atomic_long_sub(size, &bpf_jit_current);
}
-void *__weak bpf_jit_alloc_exec(unsigned long size)
+void *bpf_jit_alloc_exec(unsigned long size)
{
return execmem_alloc(EXECMEM_BPF, size);
}
-void __weak bpf_jit_free_exec(void *addr)
+void *bpf_jit_alloc_exec_rw(unsigned long size)
+{
+ return execmem_alloc_rw(EXECMEM_BPF, size);
+}
+
+void bpf_jit_free_exec(void *addr)
{
execmem_free(addr);
}
diff --git a/kernel/bpf/dispatcher.c b/kernel/bpf/dispatcher.c
index b77db7413f8c70..a7a6a375cdd31d 100644
--- a/kernel/bpf/dispatcher.c
+++ b/kernel/bpf/dispatcher.c
@@ -148,7 +148,10 @@ void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from,
d->image = bpf_prog_pack_alloc(PAGE_SIZE, bpf_jit_fill_hole_with_zero);
if (!d->image)
goto out;
- d->rw_image = bpf_jit_alloc_exec(PAGE_SIZE);
+ /* d->rw_image doesn't need to be in module memory range, so we
+ * can use vmalloc.
+ */
+ d->rw_image = vmalloc(PAGE_SIZE);
if (!d->rw_image) {
bpf_prog_pack_free(d->image, PAGE_SIZE);
d->image = NULL;
|
| 3/2 | 2026/06/26 20:24 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 3685 output: 23 thoughts: 432 Thoughts: **BPF JIT Memory Allocation Patch: Fuzzing Focus** Okay, so we've got a patch series here that's tweaking BPF JIT memory allocation. Seems like a straightforward, functional change – always worth a closer look from a fuzzing perspective, especially when it involves memory. Let's see what's actually been modified. The changes touch `arch/x86/mm/init.c` adjusting `EXECMEM_BPF` flags, and `arch/x86/net/bpf_jit_comp.c`, and they introduce a new allocation function called `bpf_jit_alloc_exec_rw`. We also have some additions to `include/linux/filter.h` and changes in `kernel/bpf/core.c` including a call to `bpf_jit_mem_is_rox()`. It also appears we're using `vmalloc` instead of `bpf_jit_alloc_exec` for `d->rw_image` in `kernel/bpf/dispatcher.c`. Alright, let's find the high-value targets for fuzzing. We have several function modifications: `execmem_arch_setup` (seems less interesting for direct fuzzing, it's an initialization function), `arch_bpf_trampoline_size`, `alloc_new_pack`, `bpf_prog_pack_alloc`, and the allocation functions: `bpf_jit_alloc_exec`, `bpf_jit_alloc_exec_rw`, and the free function `bpf_jit_free_exec`. Finally `bpf_dispatcher_change_prog` also seems relevant. Okay, let's zero in on potential fuzzing targets. Hmm, I think `arch_bpf_trampoline_size`, `bpf_prog_pack_alloc`, and `bpf_dispatcher_change_prog` are good candidates. However, `bpf_jit_alloc_exec` and especially `bpf_jit_alloc_exec_rw` look like the *really* juicy targets, given the memory allocation aspect. I should probably start by checking `arch_bpf_trampoline_size`, to see how that function works. |
| 4/2 | 2026/06/26 20:24 | tool | grepper |
0mArgs:{
"Expression": "arch_bpf_trampoline_size"
}Results: {
"Output": "arch/arm64/net/bpf_jit_comp.c=2844=bool bpf_jit_supports_fsession(void)\n--\narch/arm64/net/bpf_jit_comp.c-2848-\narch/arm64/net/bpf_jit_comp.c:2849:int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\narch/arm64/net/bpf_jit_comp.c-2850-\t\t\t struct bpf_tramp_nodes *tnodes, void *func_addr)\n--\narch/loongarch/net/bpf_jit.c=2116=int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *ro_image,\n--\narch/loongarch/net/bpf_jit.c-2153-\narch/loongarch/net/bpf_jit.c:2154:int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\narch/loongarch/net/bpf_jit.c-2155-\t\t\t struct bpf_tramp_nodes *tnodes, void *func_addr)\n--\narch/powerpc/net/bpf_jit_comp.c=812=static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_image,\n--\narch/powerpc/net/bpf_jit_comp.c-1191-\narch/powerpc/net/bpf_jit_comp.c:1192:int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\narch/powerpc/net/bpf_jit_comp.c-1193-\t\t\t struct bpf_tramp_nodes *tnodes, void *func_addr)\n--\narch/riscv/net/bpf_jit_comp64.c=1022=static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,\n--\narch/riscv/net/bpf_jit_comp64.c-1306-\narch/riscv/net/bpf_jit_comp64.c:1307:int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\narch/riscv/net/bpf_jit_comp64.c-1308-\t\t\t struct bpf_tramp_nodes *tnodes, void *func_addr)\n--\narch/s390/net/bpf_jit_comp.c=2650=static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,\n--\narch/s390/net/bpf_jit_comp.c-2965-\narch/s390/net/bpf_jit_comp.c:2966:int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\narch/s390/net/bpf_jit_comp.c-2967-\t\t\t struct bpf_tramp_nodes *tnodes, void *orig_call)\n--\narch/x86/net/bpf_jit_comp.c=3669=int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *image_end,\n--\narch/x86/net/bpf_jit_comp.c-3697-\narch/x86/net/bpf_jit_comp.c:3698:int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\narch/x86/net/bpf_jit_comp.c-3699-\t\t\t struct bpf_tramp_nodes *tnodes, void *func_addr)\n--\ninclude/linux/bpf.h=1319=int __must_check arch_protect_bpf_trampoline(void *image, unsigned int size);\ninclude/linux/bpf.h:1320:int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\ninclude/linux/bpf.h-1321-\t\t\t struct bpf_tramp_nodes *tnodes, void *func_addr);\n--\nkernel/bpf/bpf_struct_ops.c=597=int bpf_struct_ops_prepare_trampoline(struct bpf_tramp_nodes *tnodes,\n--\nkernel/bpf/bpf_struct_ops.c-613-\nkernel/bpf/bpf_struct_ops.c:614:\tsize = arch_bpf_trampoline_size(model, flags, tnodes, stub_func);\nkernel/bpf/bpf_struct_ops.c-615-\tif (size \u003c= 0)\n--\nkernel/bpf/trampoline.c=673=static int bpf_trampoline_update(struct bpf_trampoline *tr, bool lock_direct_mutex,\n--\nkernel/bpf/trampoline.c-724-\nkernel/bpf/trampoline.c:725:\tsize = arch_bpf_trampoline_size(\u0026tr-\u003efunc.model, tr-\u003eflags,\nkernel/bpf/trampoline.c-726-\t\t\t\t\ttnodes, tr-\u003efunc.addr);\n--\nkernel/bpf/trampoline.c=1461=int __weak arch_protect_bpf_trampoline(void *image, unsigned int size)\n--\nkernel/bpf/trampoline.c-1466-\nkernel/bpf/trampoline.c:1467:int __weak arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\nkernel/bpf/trampoline.c-1468-\t\t\t\t struct bpf_tramp_nodes *tnodes, void *func_addr)\n"
} |
| 5/2 | 2026/06/26 20:24 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 6144 output: 22 thoughts: 14 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Analyzing `bpf_prog_pack_alloc`** Alright, let's dive into this `bpf_prog_pack_alloc` function. My initial thought process revolves around understanding its core responsibility within the BPF ecosystem. I immediately need to consider its position in the overall allocation strategy for BPF programs. Is it a central allocator, or is it a layer on top of a more general memory management scheme? The name itself suggests it's related to "packing," so I'm expecting to look into how BPF program structures are organized and optimized for memory efficiency within this function. I'll need to figure out what data structures it manipulates. Does it deal with program headers, instructions, or associated metadata? Specifically, I will examine the algorithm for memory allocation. Is it a simple `kmalloc` wrapper, or does it incorporate more advanced techniques like slab allocation, object caching, or maybe something BPF-specific like packing multiple programs into a single pack to minimize overhead? I'll also check for any potential pitfalls, like memory fragmentation or race conditions, that may be inherent in its design. Furthermore, I will check the potential for performance bottlenecks in this function. Does it employ spinlocks or other locking mechanisms? How does it handle potential allocation failures, and what are the implications for overall BPF program loading and execution? I expect to have a good look at error handling and robustness too. Basically, I want to form a complete mental map of this function's purpose, design, potential issues, and optimization possibilities. |
| 6/2 | 2026/06/26 20:24 | tool | grepper |
0mArgs:{
"Expression": "bpf_prog_pack_alloc"
}Results: {
"Output": "arch/arm64/net/bpf_jit_comp.c=2871=void *arch_alloc_bpf_trampoline(unsigned int size)\narch/arm64/net/bpf_jit_comp.c-2872-{\narch/arm64/net/bpf_jit_comp.c:2873:\treturn bpf_prog_pack_alloc(size, jit_fill_hole);\narch/arm64/net/bpf_jit_comp.c-2874-}\n--\narch/loongarch/net/bpf_jit.c=1763=void *arch_alloc_bpf_trampoline(unsigned int size)\narch/loongarch/net/bpf_jit.c-1764-{\narch/loongarch/net/bpf_jit.c:1765:\treturn bpf_prog_pack_alloc(size, jit_fill_hole);\narch/loongarch/net/bpf_jit.c-1766-}\n--\narch/powerpc/net/bpf_jit_comp.c=589=void *arch_alloc_bpf_trampoline(unsigned int size)\narch/powerpc/net/bpf_jit_comp.c-590-{\narch/powerpc/net/bpf_jit_comp.c:591:\treturn bpf_prog_pack_alloc(size, bpf_jit_fill_ill_insns);\narch/powerpc/net/bpf_jit_comp.c-592-}\n--\narch/riscv/net/bpf_jit_comp64.c=1322=void *arch_alloc_bpf_trampoline(unsigned int size)\narch/riscv/net/bpf_jit_comp64.c-1323-{\narch/riscv/net/bpf_jit_comp64.c:1324:\treturn bpf_prog_pack_alloc(size, bpf_fill_ill_insns);\narch/riscv/net/bpf_jit_comp64.c-1325-}\n--\narch/x86/net/bpf_jit_comp.c=3654=void *arch_alloc_bpf_trampoline(unsigned int size)\narch/x86/net/bpf_jit_comp.c-3655-{\narch/x86/net/bpf_jit_comp.c:3656:\treturn bpf_prog_pack_alloc(size, jit_fill_hole);\narch/x86/net/bpf_jit_comp.c-3657-}\n--\ninclude/linux/filter.h=1330=bpf_jit_binary_pack_hdr(const struct bpf_prog *fp);\ninclude/linux/filter.h-1331-\ninclude/linux/filter.h:1332:void *bpf_prog_pack_alloc(u32 size, bpf_jit_fill_hole_t bpf_fill_ill_insns);\ninclude/linux/filter.h-1333-void bpf_prog_pack_free(void *ptr, u32 size);\n--\nkernel/bpf/core.c=912=static struct bpf_prog_pack *alloc_new_pack(bpf_jit_fill_hole_t bpf_fill_ill_insns)\n--\nkernel/bpf/core.c-941-\nkernel/bpf/core.c:942:void *bpf_prog_pack_alloc(u32 size, bpf_jit_fill_hole_t bpf_fill_ill_insns)\nkernel/bpf/core.c-943-{\n--\nkernel/bpf/core.c=1141=bpf_jit_binary_pack_alloc(unsigned int proglen, u8 **image_ptr,\n--\nkernel/bpf/core.c-1157-\t\treturn NULL;\nkernel/bpf/core.c:1158:\tro_header = bpf_prog_pack_alloc(size, bpf_fill_ill_insns);\nkernel/bpf/core.c-1159-\tif (!ro_header) {\n--\nkernel/bpf/dispatcher.c=137=void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from,\n--\nkernel/bpf/dispatcher.c-147-\tif (!d-\u003eimage) {\nkernel/bpf/dispatcher.c:148:\t\td-\u003eimage = bpf_prog_pack_alloc(PAGE_SIZE, bpf_jit_fill_hole_with_zero);\nkernel/bpf/dispatcher.c-149-\t\tif (!d-\u003eimage)\n"
} |
| 7/2 | 2026/06/26 20:24 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 7689 output: 24 thoughts: 105 Thoughts: **Analyzing BPF Program Allocation** Okay, so I'm tracing the allocation process for BPF programs, and it looks like `bpf_prog_pack_alloc` is the key function. It's called by a few other important components, specifically `arch_alloc_bpf_trampoline`, `bpf_jit_binary_pack_alloc`, and `bpf_dispatcher_change_prog`. Right off the bat, I recognize that `bpf_jit_binary_pack_alloc` is related to the BPF JIT compilation process, which is critical for performance. And, from the names, `bpf_dispatcher_change_prog` handles changes to BPF dispatchers. Now, I need to understand what's happening within these components. The next logical step is to dive into how `bpf_jit_alloc_exec_rw` factors into this process. I need to understand its role in the allocation and execution process. This will help clarify the overall program flow. |
| 8/2 | 2026/06/26 20:25 | tool | grepper |
0mArgs:{
"Expression": "bpf_jit_alloc_exec_rw"
}Results: {
"Output": "arch/x86/net/bpf_jit_comp.c=3698=int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\n--\narch/x86/net/bpf_jit_comp.c-3708-\t * module memory range.\narch/x86/net/bpf_jit_comp.c:3709:\t * Since it must be writable use bpf_jit_alloc_exec_rw().\narch/x86/net/bpf_jit_comp.c-3710-\t */\narch/x86/net/bpf_jit_comp.c:3711:\timage = bpf_jit_alloc_exec_rw(PAGE_SIZE);\narch/x86/net/bpf_jit_comp.c-3712-\tif (!image)\n--\ninclude/linux/filter.h=1325=void *bpf_jit_alloc_exec(unsigned long size);\ninclude/linux/filter.h:1326:void *bpf_jit_alloc_exec_rw(unsigned long size);\ninclude/linux/filter.h-1327-void bpf_jit_free_exec(void *addr);\n--\nkernel/bpf/core.c=1070=void *bpf_jit_alloc_exec(unsigned long size)\n--\nkernel/bpf/core.c-1074-\nkernel/bpf/core.c:1075:void *bpf_jit_alloc_exec_rw(unsigned long size)\nkernel/bpf/core.c-1076-{\n"
} |
| 9/2 | 2026/06/26 20:25 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8446 output: 22 thoughts: 46 Thoughts: Okay, here's my interpretation of those thoughts, presented as my own mental process, given my expertise: **Examining BPF JIT Allocation on x86** Alright, I'm taking a look at this `bpf_jit_alloc_exec_rw` function. The code seems to indicate it's exclusively employed within `arch_bpf_trampoline_size` specifically on the x86 architecture. Hmm, that's interesting and certainly warrants closer examination. My immediate question is: what's the deal with `bpf_jit_alloc_exec`? Is it also x86-specific? Or is it used more broadly, perhaps across other architectures or in different contexts within the BPF JIT compilation process? It's important to understand the relationship between these two allocation routines. Are they complementary? Do they have different purposes? Is one a subset of the other? Are there any use cases where one is preferred over the other and if so why? This distinction is crucial for getting a full grasp on memory management in the JIT environment, especially when optimizing for various architectures or exploring new features and capabilities within the BPF framework. I need to dig deeper into the code and the wider BPF ecosystem to determine where these allocation functions diverge. |
| 10/2 | 2026/06/26 20:25 | tool | grepper |
0mArgs:{
"Expression": "bpf_jit_alloc_exec"
}Results: {
"Output": "arch/arm64/net/bpf_jit_comp.c=2320=void *bpf_arch_text_copy(void *dst, void *src, size_t len)\n--\narch/arm64/net/bpf_jit_comp.c-2326-\narch/arm64/net/bpf_jit_comp.c:2327:u64 bpf_jit_alloc_exec_limit(void)\narch/arm64/net/bpf_jit_comp.c-2328-{\n--\narch/riscv/net/bpf_jit_core.c=44=struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\n--\narch/riscv/net/bpf_jit_core.c-192-\narch/riscv/net/bpf_jit_core.c:193:u64 bpf_jit_alloc_exec_limit(void)\narch/riscv/net/bpf_jit_core.c-194-{\n--\narch/x86/net/bpf_jit_comp.c=3698=int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\n--\narch/x86/net/bpf_jit_comp.c-3708-\t * module memory range.\narch/x86/net/bpf_jit_comp.c:3709:\t * Since it must be writable use bpf_jit_alloc_exec_rw().\narch/x86/net/bpf_jit_comp.c-3710-\t */\narch/x86/net/bpf_jit_comp.c:3711:\timage = bpf_jit_alloc_exec_rw(PAGE_SIZE);\narch/x86/net/bpf_jit_comp.c-3712-\tif (!image)\n--\ninclude/linux/filter.h=1323=void bpf_jit_binary_free(struct bpf_binary_header *hdr);\ninclude/linux/filter.h:1324:u64 bpf_jit_alloc_exec_limit(void);\ninclude/linux/filter.h:1325:void *bpf_jit_alloc_exec(unsigned long size);\ninclude/linux/filter.h:1326:void *bpf_jit_alloc_exec_rw(unsigned long size);\ninclude/linux/filter.h-1327-void bpf_jit_free_exec(void *addr);\n--\nkernel/bpf/core.c=912=static struct bpf_prog_pack *alloc_new_pack(bpf_jit_fill_hole_t bpf_fill_ill_insns)\n--\nkernel/bpf/core.c-919-\t\treturn NULL;\nkernel/bpf/core.c:920:\tpack-\u003eptr = bpf_jit_alloc_exec(BPF_PROG_PACK_SIZE);\nkernel/bpf/core.c-921-\tif (!pack-\u003eptr)\n--\nkernel/bpf/core.c=942=void *bpf_prog_pack_alloc(u32 size, bpf_jit_fill_hole_t bpf_fill_ill_insns)\n--\nkernel/bpf/core.c-951-\t\tsize = round_up(size, PAGE_SIZE);\nkernel/bpf/core.c:952:\t\tptr = bpf_jit_alloc_exec(size);\nkernel/bpf/core.c-953-\t\tif (ptr \u0026\u0026 !bpf_jit_mem_is_rox()) {\n--\nkernel/bpf/core.c=1028=static atomic_long_t bpf_jit_current;\n--\nkernel/bpf/core.c-1033- */\nkernel/bpf/core.c:1034:u64 __weak bpf_jit_alloc_exec_limit(void)\nkernel/bpf/core.c-1035-{\n--\nkernel/bpf/core.c=1043=static int __init bpf_jit_charge_init(void)\n--\nkernel/bpf/core.c-1045-\t/* Only used as heuristic here to derive limit. */\nkernel/bpf/core.c:1046:\tbpf_jit_limit_max = bpf_jit_alloc_exec_limit();\nkernel/bpf/core.c-1047-\tbpf_jit_limit = min_t(u64, round_up(bpf_jit_limit_max \u003e\u003e 1,\n--\nkernel/bpf/core.c=1065=void bpf_jit_uncharge_modmem(u32 size)\n--\nkernel/bpf/core.c-1069-\nkernel/bpf/core.c:1070:void *bpf_jit_alloc_exec(unsigned long size)\nkernel/bpf/core.c-1071-{\n--\nkernel/bpf/core.c-1074-\nkernel/bpf/core.c:1075:void *bpf_jit_alloc_exec_rw(unsigned long size)\nkernel/bpf/core.c-1076-{\n--\nkernel/bpf/core.c=1086=bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,\n--\nkernel/bpf/core.c-1103-\t\treturn NULL;\nkernel/bpf/core.c:1104:\thdr = bpf_jit_alloc_exec(size);\nkernel/bpf/core.c-1105-\tif (!hdr) {\n--\nkernel/bpf/trampoline.c=1440=void * __weak arch_alloc_bpf_trampoline(unsigned int size)\n--\nkernel/bpf/trampoline.c-1445-\t\treturn NULL;\nkernel/bpf/trampoline.c:1446:\timage = bpf_jit_alloc_exec(PAGE_SIZE);\nkernel/bpf/trampoline.c-1447-\tif (image)\n"
} |
| 11/2 | 2026/06/26 20:25 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 10327 output: 22 thoughts: 136 Thoughts: **Analyzing the Kernel's BPF JIT Memory Allocation Strategy** Okay, so I'm looking at how the BPF JIT memory is being managed within the kernel. My initial impression is that `bpf_jit_alloc_exec` is a key function, heavily used in allocating memory for compiled BPF programs, particularly within routines like `alloc_new_pack`, `bpf_prog_pack_alloc`, `bpf_jit_binary_alloc`, and `arch_alloc_bpf_trampoline`. The current patch I'm examining appears to be making some significant changes. I see modifications to `alloc_new_pack` and `bpf_prog_pack_alloc` – specifically, it seems like there's now a check for `bpf_jit_mem_is_rox()`. This suggests we're probably addressing security concerns or perhaps trying to optimize read-only memory segments for JIT-ed code. Interesting. Then, there's another change related to `bpf_dispatcher_change_prog`. This is where things get really interesting; the patch is switching it over to use `vmalloc` instead of `bpf_jit_alloc_exec`. This is a pretty significant alteration, as `vmalloc` has different allocation semantics and memory mapping characteristics. I need to dig deeper into the rationale here. The implications could be broad, potentially impacting performance, security, or even how BPF programs are dynamically loaded and executed. Let's start by scrutinizing the changes in `bpf_dispatcher_change_prog` to understand the intent and potential consequences of this `vmalloc` shift. |
| 12/2 | 2026/06/26 20:25 | tool | grepper |
0mArgs:{
"Expression": "bpf_dispatcher_change_prog"
}Results: {
"Output": "include/linux/bpf.h=1525=int bpf_trampoline_multi_detach(struct bpf_prog *prog,\n--\ninclude/linux/bpf.h-1590-#define BPF_DISPATCHER_PTR(name) (\u0026bpf_dispatcher_##name)\ninclude/linux/bpf.h:1591:void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from,\ninclude/linux/bpf.h-1592-\t\t\t\tstruct bpf_prog *to);\n--\ninclude/linux/bpf.h=1624=static inline void bpf_trampoline_put(struct bpf_trampoline *tr) {}\n--\ninclude/linux/bpf.h-1628-#define BPF_DISPATCHER_PTR(name) NULL\ninclude/linux/bpf.h:1629:static inline void bpf_dispatcher_change_prog(struct bpf_dispatcher *d,\ninclude/linux/bpf.h-1630-\t\t\t\t\t struct bpf_prog *from,\n--\nkernel/bpf/dispatcher.c=106=static void bpf_dispatcher_update(struct bpf_dispatcher *d, int prev_num_progs)\n--\nkernel/bpf/dispatcher.c-136-\nkernel/bpf/dispatcher.c:137:void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from,\nkernel/bpf/dispatcher.c-138-\t\t\t\tstruct bpf_prog *to)\n--\nnet/core/filter.c=12026=void bpf_prog_change_xdp(struct bpf_prog *prev_prog, struct bpf_prog *prog)\nnet/core/filter.c-12027-{\nnet/core/filter.c:12028:\tbpf_dispatcher_change_prog(BPF_DISPATCHER_PTR(xdp), prev_prog, prog);\nnet/core/filter.c-12029-}\n"
} |
| 13/2 | 2026/06/26 20:25 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 11347 output: 24 thoughts: 52 Thoughts: Okay, here's my take on those thoughts, framed as my own mental processing: **Focussing on Fuzzing Target Identification** Alright, let's see, `bpf_dispatcher_change_prog`... right, that gets called by `bpf_prog_change_xdp`. Hmm, that suggests a definite point of interest for fuzzing! It's clearly a reachable code path, so that's a good starting point to dig into. Now, I should probably check `bpf_jit_mem_is_rox`... that function's often associated with memory protection issues. I'll need to understand how these pieces fit together to craft effective fuzzing harnesses. |
| 14/2 | 2026/06/26 20:25 | tool | grepper |
0mArgs:{
"Expression": "bpf_jit_mem_is_rox"
}Results: {
"Output": "kernel/bpf/core.c=889=static LIST_HEAD(pack_list);\n--\nkernel/bpf/core.c-906-\nkernel/bpf/core.c:907:static bool bpf_jit_mem_is_rox(void)\nkernel/bpf/core.c-908-{\n--\nkernel/bpf/core.c=912=static struct bpf_prog_pack *alloc_new_pack(bpf_jit_fill_hole_t bpf_fill_ill_insns)\n--\nkernel/bpf/core.c-924-\nkernel/bpf/core.c:925:\tif (!bpf_jit_mem_is_rox()) {\nkernel/bpf/core.c-926-\t\tbpf_fill_ill_insns(pack-\u003eptr, BPF_PROG_PACK_SIZE);\n--\nkernel/bpf/core.c=942=void *bpf_prog_pack_alloc(u32 size, bpf_jit_fill_hole_t bpf_fill_ill_insns)\n--\nkernel/bpf/core.c-952-\t\tptr = bpf_jit_alloc_exec(size);\nkernel/bpf/core.c:953:\t\tif (ptr \u0026\u0026 !bpf_jit_mem_is_rox()) {\nkernel/bpf/core.c-954-\t\t\tint err;\n"
} |
| 15/2 | 2026/06/26 20:25 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 11934 output: 21 thoughts: 189 Thoughts: **Analyzing the BPF JIT Memory Allocation Patch** Okay, so this patch is clearly focused on how BPF JIT memory is allocated and managed, specifically targeting the interaction between `alloc_new_pack`, `bpf_prog_pack_alloc`, and the memory protection mechanisms. The conditional call to `set_memory_rox` based on `bpf_jit_mem_is_rox()` is the giveaway – this is all about making the JIT'd code read-only where appropriate. My primary areas of interest within the code are, naturally, these key symbols: `bpf_jit_alloc_exec`, `bpf_jit_alloc_exec_rw`, `bpf_prog_pack_alloc`, `alloc_new_pack`, and `bpf_dispatcher_change_prog`. I'll need to understand exactly how these functions interact and where this `set_memory_rox` call fits in the overall picture of code generation and execution. Now, let's see about relevant configurations. `CONFIG_BPF_JIT` is a given; without it, the JIT isn't even enabled, and this patch would be moot. However, the use of `CONFIG_BPF_SYSCALL` will tell me if the modifications would also affect syscall BPF programs. I'll need to delve into the code to determine whether the patch touches areas of code associated with syscall BPF programs, which would inform me about the potential scope of this change. I'll start by checking `kernel/bpf/core.c` and `kernel/bpf/dispatcher.c`, that's usually where the BPF core functionality and the dispatching logic reside. |
| 16/2 | 2026/06/26 20:26 | tool | grepper |
0mArgs:{
"Expression": "CONFIG_BPF_JIT"
}Results: {
"Output": "Documentation/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-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--\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/net/Makefile-3-\narch/arm/net/Makefile:4:obj-$(CONFIG_BPF_JIT) += bpf_jit_32.o\n--\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/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/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/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/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/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=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=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\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/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=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\n--\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\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/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/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--\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=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_types.h=67=BPF_PROG_TYPE(BPF_PROG_TYPE_SK_LOOKUP, sk_lookup,\n--\ninclude/linux/bpf_types.h-69-#endif\ninclude/linux/bpf_types.h:70:#if defined(CONFIG_BPF_JIT)\ninclude/linux/bpf_types.h-71-BPF_PROG_TYPE(BPF_PROG_TYPE_STRUCT_OPS, bpf_struct_ops,\n--\ninclude/linux/bpf_types.h=128=BPF_MAP_TYPE(BPF_MAP_TYPE_STACK, stack_map_ops)\ninclude/linux/bpf_types.h:129:#if defined(CONFIG_BPF_JIT)\ninclude/linux/bpf_types.h-130-BPF_MAP_TYPE(BPF_MAP_TYPE_STRUCT_OPS, bpf_struct_ops_map_ops)\n--\ninclude/linux/btf.h=532=struct bpf_verifier_log;\ninclude/linux/btf.h-533-\ninclude/linux/btf.h:534:#if defined(CONFIG_BPF_JIT) \u0026\u0026 defined(CONFIG_BPF_SYSCALL)\ninclude/linux/btf.h-535-struct bpf_struct_ops;\n--\ninclude/linux/extable.h=30=search_module_extables(unsigned long addr)\n--\ninclude/linux/extable.h-35-\ninclude/linux/extable.h:36:#ifdef CONFIG_BPF_JIT\ninclude/linux/extable.h-37-const struct exception_table_entry *search_bpf_extables(unsigned long addr);\n--\ninclude/linux/filter.h=1098=static inline int __must_check bpf_prog_lock_ro(struct bpf_prog *fp)\ninclude/linux/filter.h-1099-{\ninclude/linux/filter.h:1100:#ifndef CONFIG_BPF_JIT_ALWAYS_ON\ninclude/linux/filter.h-1101-\tif (!fp-\u003ejited) {\n--\ninclude/linux/filter.h=1299=bpf_run_sk_reuseport(struct sock_reuseport *reuse, struct sock *sk,\n--\ninclude/linux/filter.h-1307-\ninclude/linux/filter.h:1308:#ifdef CONFIG_BPF_JIT\ninclude/linux/filter.h-1309-extern int bpf_jit_enable;\n--\ninclude/linux/filter.h=1440=void bpf_prog_kallsyms_del(struct bpf_prog *fp);\ninclude/linux/filter.h-1441-\ninclude/linux/filter.h:1442:#else /* CONFIG_BPF_JIT */\ninclude/linux/filter.h-1443-\n--\ninclude/linux/filter.h=1518=static inline void bpf_jit_prog_release_other(struct bpf_prog *fp, struct bpf_prog *fp_other)\n--\ninclude/linux/filter.h-1520-}\ninclude/linux/filter.h:1521:#endif /* CONFIG_BPF_JIT */\ninclude/linux/filter.h-1522-\n--\nkernel/bpf/Kconfig=58=config BPF_JIT_ALWAYS_ON\n--\nkernel/bpf/Kconfig-64-\nkernel/bpf/Kconfig:65:\t When CONFIG_BPF_JIT_ALWAYS_ON is enabled, /proc/sys/net/core/bpf_jit_enable\nkernel/bpf/Kconfig-66-\t is permanently set to 1 and setting any other value than that will\n--\nkernel/bpf/Makefile=2=obj-y := core.o\nkernel/bpf/Makefile:3:ifneq ($(CONFIG_BPF_JIT_ALWAYS_ON),y)\nkernel/bpf/Makefile-4-# ___bpf_prog_run() needs GCSE disabled on x86; see 3193c0836f203 for details\n--\nkernel/bpf/Makefile=16=obj-$(CONFIG_BPF_SYSCALL) += disasm.o mprog.o\nkernel/bpf/Makefile:17:obj-$(CONFIG_BPF_JIT) += trampoline.o\nkernel/bpf/Makefile-18-obj-$(CONFIG_BPF_SYSCALL) += btf.o memalloc.o rqspinlock.o stream.o\n--\nkernel/bpf/Makefile=21=endif\nkernel/bpf/Makefile:22:obj-$(CONFIG_BPF_JIT) += dispatcher.o\nkernel/bpf/Makefile-23-ifeq ($(CONFIG_NET),y)\n--\nkernel/bpf/Makefile=42=endif\nkernel/bpf/Makefile:43:ifeq ($(CONFIG_BPF_JIT),y)\nkernel/bpf/Makefile-44-obj-$(CONFIG_BPF_SYSCALL) += bpf_struct_ops.o\n--\nkernel/bpf/btf.c=9778=bool btf_type_ids_nocast_alias(struct bpf_verifier_log *log,\n--\nkernel/bpf/btf.c-9832-\nkernel/bpf/btf.c:9833:#ifdef CONFIG_BPF_JIT\nkernel/bpf/btf.c-9834-static int\n--\nkernel/bpf/core.c=539=void bpf_prog_kallsyms_del_all(struct bpf_prog *fp)\n--\nkernel/bpf/core.c-544-\nkernel/bpf/core.c:545:#ifdef CONFIG_BPF_JIT\nkernel/bpf/core.c-546-/* All BPF JIT sysctl knobs here. */\nkernel/bpf/core.c:547:int bpf_jit_enable __read_mostly = IS_BUILTIN(CONFIG_BPF_JIT_DEFAULT_ON);\nkernel/bpf/core.c:548:int bpf_jit_kallsyms __read_mostly = IS_BUILTIN(CONFIG_BPF_JIT_DEFAULT_ON);\nkernel/bpf/core.c-549-int bpf_jit_harden __read_mostly;\n--\nkernel/bpf/core.c=1598=u16 bpf_out_stack_arg_cnt(const struct bpf_verifier_env *env, const struct bpf_prog *prog)\n--\nkernel/bpf/core.c-1606-}\nkernel/bpf/core.c:1607:#endif /* CONFIG_BPF_JIT */\nkernel/bpf/core.c-1608-\n--\nkernel/bpf/core.c=1766=bool bpf_opcode_in_insntable(u8 code)\n--\nkernel/bpf/core.c-1788-\nkernel/bpf/core.c:1789:#ifndef CONFIG_BPF_JIT_ALWAYS_ON\nkernel/bpf/core.c-1790-/* Absolute value of s32 without undefined behavior for S32_MIN */\n--\nkernel/bpf/core.c=2553=static bool bpf_prog_select_interpreter(struct bpf_prog *fp)\n--\nkernel/bpf/core.c-2555-\tbool select_interpreter = false;\nkernel/bpf/core.c:2556:#ifndef CONFIG_BPF_JIT_ALWAYS_ON\nkernel/bpf/core.c-2557-\tu32 stack_depth = max_t(u32, fp-\u003eaux-\u003estack_depth, 1);\n--\nkernel/bpf/core.c=2576=static struct bpf_prog *bpf_prog_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\nkernel/bpf/core.c-2577-{\nkernel/bpf/core.c:2578:#ifdef CONFIG_BPF_JIT\nkernel/bpf/core.c-2579-\tstruct bpf_prog *orig_prog;\n--\nkernel/bpf/core.c=2623=struct bpf_prog *__bpf_prog_select_runtime(struct bpf_verifier_env *env, struct bpf_prog *fp,\n--\nkernel/bpf/core.c-2633-\nkernel/bpf/core.c:2634:\tif (IS_ENABLED(CONFIG_BPF_JIT_ALWAYS_ON) ||\nkernel/bpf/core.c-2635-\t bpf_prog_has_kfunc_call(fp))\n--\nkernel/bpf/fixups.c=127=static int add_kfunc_in_insns(struct bpf_verifier_env *env,\n--\nkernel/bpf/fixups.c-141-\nkernel/bpf/fixups.c:142:#ifndef CONFIG_BPF_JIT_ALWAYS_ON\nkernel/bpf/fixups.c-143-static int get_callee_stack_depth(struct bpf_verifier_env *env,\n--\nkernel/bpf/fixups.c=1376=int bpf_fixup_call_args(struct bpf_verifier_env *env)\nkernel/bpf/fixups.c-1377-{\nkernel/bpf/fixups.c:1378:#ifndef CONFIG_BPF_JIT_ALWAYS_ON\nkernel/bpf/fixups.c-1379-\tstruct bpf_prog *prog = env-\u003eprog;\n--\nkernel/bpf/fixups.c-1405-\t}\nkernel/bpf/fixups.c:1406:#ifndef CONFIG_BPF_JIT_ALWAYS_ON\nkernel/bpf/fixups.c-1407-\tif (has_kfunc_call) {\n--\nkernel/bpf/syscall.c=6578=int kern_sys_bpf(int cmd, union bpf_attr *attr, unsigned int size)\n--\nkernel/bpf/syscall.c-6583-\tswitch (cmd) {\nkernel/bpf/syscall.c:6584:#ifdef CONFIG_BPF_JIT /* __bpf_prog_enter_sleepable used by trampoline and JIT */\nkernel/bpf/syscall.c-6585-\tcase BPF_PROG_TEST_RUN:\n--\nkernel/bpf/verifier.c=4418=BTF_ID(struct, cgroup)\nkernel/bpf/verifier.c-4419-#endif\nkernel/bpf/verifier.c:4420:#ifdef CONFIG_BPF_JIT\nkernel/bpf/verifier.c-4421-BTF_ID(struct, bpf_cpumask)\n--\nnet/bpf/Makefile=2=obj-$(CONFIG_BPF_SYSCALL)\t:= test_run.o\nnet/bpf/Makefile:3:ifeq ($(CONFIG_BPF_JIT),y)\nnet/bpf/Makefile-4-obj-$(CONFIG_BPF_SYSCALL)\t+= bpf_dummy_struct_ops.o\n--\nnet/core/sysctl_net_core.c=352=static int proc_do_skb_defer_max(const struct ctl_table *table, int write,\n--\nnet/core/sysctl_net_core.c-374-\nnet/core/sysctl_net_core.c:375:#ifdef CONFIG_BPF_JIT\nnet/core/sysctl_net_core.c-376-static int proc_dointvec_minmax_bpf_enable(const struct ctl_table *table, int write,\n--\nnet/core/sysctl_net_core.c-401-\tif (write \u0026\u0026 ret \u0026\u0026 min == max)\nnet/core/sysctl_net_core.c:402:\t\tpr_info_once(\"CONFIG_BPF_JIT_ALWAYS_ON is enabled, bpf_jit_enable is permanently set to 1.\\n\");\nnet/core/sysctl_net_core.c-403-\n--\nnet/core/sysctl_net_core.c=430=static struct ctl_table net_core_table[] = {\n--\nnet/core/sysctl_net_core.c-483-\t},\nnet/core/sysctl_net_core.c:484:#ifdef CONFIG_BPF_JIT\nnet/core/sysctl_net_core.c-485-\t{\n--\nnet/core/sysctl_net_core.c-490-\t\t.proc_handler\t= proc_dointvec_minmax_bpf_enable,\nnet/core/sysctl_net_core.c:491:# ifdef CONFIG_BPF_JIT_ALWAYS_ON\nnet/core/sysctl_net_core.c-492-\t\t.extra1\t\t= SYSCTL_ONE,\n--\nnet/ipv4/Makefile=69=obj-$(CONFIG_TCP_AO) += tcp_ao.o\nnet/ipv4/Makefile-70-\nnet/ipv4/Makefile:71:ifeq ($(CONFIG_BPF_JIT),y)\nnet/ipv4/Makefile-72-obj-$(CONFIG_BPF_SYSCALL) += bpf_tcp_ca.o\n--\nscripts/gdb/linux/bpf.py=9=from linux import constants, lists, radixtree, utils\n--\nscripts/gdb/linux/bpf.py-11-\nscripts/gdb/linux/bpf.py:12:if constants.LX_CONFIG_BPF and constants.LX_CONFIG_BPF_JIT:\nscripts/gdb/linux/bpf.py-13- bpf_ksym_type = utils.CachedType(\"struct bpf_ksym\")\n--\nscripts/gdb/linux/bpf.py=26=def list_ksyms():\nscripts/gdb/linux/bpf.py:27: if not (constants.LX_CONFIG_BPF and constants.LX_CONFIG_BPF_JIT):\nscripts/gdb/linux/bpf.py-28- return []\n--\nscripts/gdb/linux/constants.py.in=173=LX_CONFIG(CONFIG_BPF)\nscripts/gdb/linux/constants.py.in:174:LX_CONFIG(CONFIG_BPF_JIT)\nscripts/gdb/linux/constants.py.in-175-LX_CONFIG(CONFIG_BPF_SYSCALL)\n--\nscripts/gdb/linux/symbols.py=121=are loaded as well.\"\"\"\n--\nscripts/gdb/linux/symbols.py-332- self.remove_bpf_prog)\nscripts/gdb/linux/symbols.py:333: if constants.LX_CONFIG_BPF and constants.LX_CONFIG_BPF_JIT:\nscripts/gdb/linux/symbols.py-334- self.bpf_ksym_monitor = bpf.KsymMonitor(self.add_bpf_ksym,\n--\ntools/bpf/bpftool/feature.c=328=static void probe_kernel_image_config(const char *define_prefix)\n--\ntools/bpf/bpftool/feature.c-337-\t\t/* Compile eBPF JIT compiler */\ntools/bpf/bpftool/feature.c:338:\t\t{ \"CONFIG_BPF_JIT\", },\ntools/bpf/bpftool/feature.c-339-\t\t/* Avoid compiling eBPF interpreter (use JIT only) */\ntools/bpf/bpftool/feature.c:340:\t\t{ \"CONFIG_BPF_JIT_ALWAYS_ON\", },\ntools/bpf/bpftool/feature.c-341-\t\t/* Kernel BTF debug information available */\n--\ntools/sched_ext/Kconfig=4=CONFIG_BPF_SYSCALL=y\ntools/sched_ext/Kconfig:5:CONFIG_BPF_JIT=y\ntools/sched_ext/Kconfig-6-CONFIG_DEBUG_INFO_BTF=y\ntools/sched_ext/Kconfig:7:CONFIG_BPF_JIT_ALWAYS_ON=y\ntools/sched_ext/Kconfig:8:CONFIG_BPF_JIT_DEFAULT_ON=y\ntools/sched_ext/Kconfig-9-CONFIG_SCHED_CLASS_EXT=y\n--\ntools/sched_ext/README.md=58=CONFIG_BPF_SYSCALL=y\ntools/sched_ext/README.md:59:CONFIG_BPF_JIT=y\ntools/sched_ext/README.md-60-CONFIG_DEBUG_INFO_BTF=y\ntools/sched_ext/README.md:61:CONFIG_BPF_JIT_ALWAYS_ON=y\ntools/sched_ext/README.md:62:CONFIG_BPF_JIT_DEFAULT_ON=y\ntools/sched_ext/README.md-63-```\n--\ntools/testing/selftests/bpf/config=5=CONFIG_BPF_EVENTS=y\ntools/testing/selftests/bpf/config:6:CONFIG_BPF_JIT=y\ntools/testing/selftests/bpf/config-7-CONFIG_BPF_KPROBE_OVERRIDE=y\n--\ntools/testing/selftests/bpf/config.aarch64=13=CONFIG_BONDING=y\ntools/testing/selftests/bpf/config.aarch64:14:CONFIG_BPF_JIT_ALWAYS_ON=y\ntools/testing/selftests/bpf/config.aarch64:15:CONFIG_BPF_JIT_DEFAULT_ON=y\ntools/testing/selftests/bpf/config.aarch64-16-CONFIG_BPF_PRELOAD_UMD=y\n--\ntools/testing/selftests/bpf/config.ppc64el=6=CONFIG_BONDING=y\ntools/testing/selftests/bpf/config.ppc64el:7:CONFIG_BPF_JIT_ALWAYS_ON=y\ntools/testing/selftests/bpf/config.ppc64el-8-CONFIG_BPF_PRELOAD_UMD=y\n--\ntools/testing/selftests/bpf/config.riscv64=5=CONFIG_BONDING=y\ntools/testing/selftests/bpf/config.riscv64:6:CONFIG_BPF_JIT_ALWAYS_ON=y\ntools/testing/selftests/bpf/config.riscv64-7-CONFIG_BPF_PRELOAD=y\n--\ntools/testing/selftests/bpf/config.s390x=7=CONFIG_BONDING=y\ntools/testing/selftests/bpf/config.s390x:8:CONFIG_BPF_JIT_ALWAYS_ON=y\ntools/testing/selftests/bpf/config.s390x:9:CONFIG_BPF_JIT_DEFAULT_ON=y\ntools/testing/selftests/bpf/config.s390x-10-CONFIG_BPF_PRELOAD=y\n--\ntools/testing/selftests/bpf/config.x86_64=18=CONFIG_BOOTTIME_TRACING=y\ntools/testing/selftests/bpf/config.x86_64:19:CONFIG_BPF_JIT_ALWAYS_ON=y\ntools/testing/selftests/bpf/config.x86_64-20-CONFIG_BPF_PRELOAD=y\n--\ntools/testing/selftests/hid/config=1=CONFIG_BPF_EVENTS=y\ntools/testing/selftests/hid/config:2:CONFIG_BPF_JIT_ALWAYS_ON=y\ntools/testing/selftests/hid/config:3:CONFIG_BPF_JIT=y\ntools/testing/selftests/hid/config-4-CONFIG_BPF_KPROBE_OVERRIDE=y\n--\ntools/testing/selftests/vsock/config=3=CONFIG_BPF_SYSCALL=y\ntools/testing/selftests/vsock/config:4:CONFIG_BPF_JIT=y\ntools/testing/selftests/vsock/config-5-CONFIG_HAVE_EBPF_JIT=y\n"
} |
| 17/2 | 2026/06/26 20:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 21732 output: 37 thoughts: 578 Thoughts: **BPF JIT Memory Allocation Review** Okay, so I'm looking at this patch and the primary point of interest is `CONFIG_BPF_JIT`. That's the key. Let's see what's being touched. I need to focus on these symbols: `bpf_jit_alloc_exec`, `bpf_jit_alloc_exec_rw`, `bpf_prog_pack_alloc`, and `bpf_dispatcher_change_prog`. I already know `alloc_new_pack` is static, so I can ignore it for my purposes. Now, let me confirm: are those critical functions exported? Yes, `bpf_jit_alloc_exec`, `bpf_jit_alloc_exec_rw`, `bpf_prog_pack_alloc`, and `bpf_dispatcher_change_prog` are all global symbols. That means they are definitely within reach. Therefore, I'll include all of those in my analysis: `bpf_jit_alloc_exec`, `bpf_jit_alloc_exec_rw`, `bpf_prog_pack_alloc`, and `bpf_dispatcher_change_prog`. My reasoning is this: This patch is fundamentally altering the BPF JIT memory allocation strategy. It's introducing `bpf_jit_alloc_exec_rw`, and it's conditionally making memory read-only based on `bpf_jit_mem_is_rox()`. Furthermore, I see that the patch alters `bpf_dispatcher_change_prog` to employ `vmalloc` instead of using `bpf_jit_alloc_exec`. That's a significant change. These are all functional changes to BPF JIT memory management. They are *reachable* through BPF program loading and dispatcher updates, which means they're absolutely worth investigating. This patch depends on `BPF_JIT`. That's not surprising. And, since the changes are significant and involve memory management, this is definitely worth fuzzing. Just to double check, I want to confirm `bpf_dispatcher_change_prog`'s context. I can see it is located in `kernel/bpf/dispatcher.c`. Is it controlled by `CONFIG_BPF_JIT`? Ah, yes, looking at the `kernel/bpf/Makefile`, the dispatcher code is built if `CONFIG_BPF_JIT` is enabled. And regarding `bpf_jit_alloc_exec_rw`, I see it is in `kernel/bpf/core.c`. Hang on. It seems `kernel/bpf/core.c` is always compiled. However, is `bpf_jit_alloc_exec_rw` *unconditionally* defined in `kernel/bpf/core.c`? Okay, I'll quickly look around line 1070 in `kernel/bpf/core.c` to be certain. |
| 18/2 | 2026/06/26 20:26 | tool | read-file |
0mArgs:{
"File": "kernel/bpf/core.c",
"FirstLine": 1060,
"LineCount": 30
}Results: {
"Contents": "1060:\t\t}\n1061:\t\n1062:\t\treturn 0;\n1063:\t}\n1064:\t\n1065:\tvoid bpf_jit_uncharge_modmem(u32 size)\n1066:\t{\n1067:\t\tatomic_long_sub(size, \u0026bpf_jit_current);\n1068:\t}\n1069:\t\n1070:\tvoid *bpf_jit_alloc_exec(unsigned long size)\n1071:\t{\n1072:\t\treturn execmem_alloc(EXECMEM_BPF, size);\n1073:\t}\n1074:\t\n1075:\tvoid *bpf_jit_alloc_exec_rw(unsigned long size)\n1076:\t{\n1077:\t\treturn execmem_alloc_rw(EXECMEM_BPF, size);\n1078:\t}\n1079:\t\n1080:\tvoid bpf_jit_free_exec(void *addr)\n1081:\t{\n1082:\t\texecmem_free(addr);\n1083:\t}\n1084:\t\n1085:\tstruct bpf_binary_header *\n1086:\tbpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,\n1087:\t\t\t unsigned int alignment,\n1088:\t\t\t bpf_jit_fill_hole_t bpf_fill_ill_insns)\n1089:\t{\n"
} |
| 19/2 | 2026/06/26 20:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 23387 output: 186 thoughts: 75 Thoughts: Okay, here's my interpretation of that. **BPF JIT Dependency** Right, so, I see that this is *unconditionally* defined, which is good. That's a solid foundation. Specifically, the definition is sitting in `kernel/bpf/core.c`. No surprises there. However, and this is the crucial point, its practical application—its actual *use*—hinges on the BPF JIT compiler. The function `bpf_jit_alloc_exec_rw` is key here. I need that BPF JIT functionality. Looking at the code path, this `bpf_jit_alloc_exec_rw` is actually called from `arch/x86/net/bpf_jit_comp.c`. That tells me I need to be sure that the JIT is enabled and functional within that architecture, specifically. Now I have what I need, I'm ready to proceed. |
| 20/2 | 2026/06/26 20:26 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"BPF_JIT"
],
"FocusSymbols": [
"bpf_jit_alloc_exec",
"bpf_jit_alloc_exec_rw",
"bpf_prog_pack_alloc",
"bpf_dispatcher_change_prog"
],
"Reasoning": "The patch modifies BPF JIT memory allocation logic, introducing a new `bpf_jit_alloc_exec_rw` function and conditionally setting memory to ROX based on `bpf_jit_mem_is_rox()`. It also changes `bpf_dispatcher_change_prog` to use `vmalloc` instead of `bpf_jit_alloc_exec`. These are functional changes to BPF JIT memory management and are reachable via BPF program loading and dispatcher updates.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"BPF_JIT"
],
"FocusSymbols": [
"bpf_jit_alloc_exec",
"bpf_jit_alloc_exec_rw",
"bpf_prog_pack_alloc",
"bpf_dispatcher_change_prog"
],
"Reasoning": "The patch modifies BPF JIT memory allocation logic, introducing a new `bpf_jit_alloc_exec_rw` function and conditionally setting memory to ROX based on `bpf_jit_mem_is_rox()`. It also changes `bpf_dispatcher_change_prog` to use `vmalloc` instead of `bpf_jit_alloc_exec`. These are functional changes to BPF JIT memory management and are reachable via BPF program loading and dispatcher updates.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|