| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/07/28 06:41 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"CFI",
"BPF_JIT"
],
"FocusSymbols": [
"bpf_int_jit_compile",
"arch_prepare_bpf_trampoline"
],
"Reasoning": "The patch implements Kernel Control Flow Integrity (kCFI) support for the s390 architecture. It modifies the BPF JIT compiler to emit KCFI hashes for BPF programs and trampolines, and updates assembly functions to use typed function macros. The BPF JIT changes are reachable and functional when BPF programs are loaded or trampolines are attached.",
"WorthFuzzing": true
} |
| 1/1 | 2026/07/28 06:41 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 6984ab8544d323ec8a5a822c57517910edab28b4\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Tue Jul 28 06:41:55 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/arch/s390/Kconfig b/arch/s390/Kconfig\nindex 84404e6778d504..ec96595cae39f0 100644\n--- a/arch/s390/Kconfig\n+++ b/arch/s390/Kconfig\n@@ -144,6 +144,7 @@ config S390\n \tselect ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE\n \tselect ARCH_STACKWALK\n \tselect ARCH_SUPPORTS_ATOMIC_RMW\n+\tselect ARCH_SUPPORTS_CFI\n \tselect ARCH_SUPPORTS_DEBUG_PAGEALLOC\n \tselect ARCH_SUPPORTS_HUGETLBFS\n \tselect ARCH_SUPPORTS_INT128 if CC_HAS_INT128 \u0026\u0026 CC_IS_CLANG\n@@ -151,6 +152,7 @@ config S390\n \tselect ARCH_SUPPORTS_NUMA_BALANCING\n \tselect ARCH_SUPPORTS_PAGE_TABLE_CHECK\n \tselect ARCH_SUPPORTS_PER_VMA_LOCK\n+\tselect ARCH_USES_CFI_GENERIC_LLVM_PASS if CC_IS_CLANG\n \tselect ARCH_USE_BUILTIN_BSWAP\n \tselect ARCH_USE_CMPXCHG_LOCKREF\n \tselect ARCH_USE_SYM_ANNOTATIONS\ndiff --git a/arch/s390/include/asm/cfi.h b/arch/s390/include/asm/cfi.h\nnew file mode 100644\nindex 00000000000000..9af2c7cb70ca7a\n--- /dev/null\n+++ b/arch/s390/include/asm/cfi.h\n@@ -0,0 +1,7 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+#ifndef _ASM_S390_CFI_H\n+#define _ASM_S390_CFI_H\n+\n+#define __bpfcall\n+\n+#endif /* _ASM_S390_CFI_H */\ndiff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S\nindex 1fec370fecf481..6bc44c767642e5 100644\n--- a/arch/s390/kernel/mcount.S\n+++ b/arch/s390/kernel/mcount.S\n@@ -4,6 +4,7 @@\n *\n */\n \n+#include \u003clinux/cfi_types.h\u003e\n #include \u003clinux/linkage.h\u003e\n #include \u003casm/asm-offsets.h\u003e\n #include \u003casm/ftrace.h\u003e\n@@ -34,10 +35,16 @@\n \n \t.section .kprobes.text, \"ax\"\n \n-SYM_FUNC_START(ftrace_stub)\n+SYM_TYPED_FUNC_START(ftrace_stub)\n \tBR_EX\t%r14\n SYM_FUNC_END(ftrace_stub)\n \n+#ifdef CONFIG_FUNCTION_GRAPH_TRACER\n+SYM_TYPED_FUNC_START(ftrace_stub_graph)\n+\tBR_EX\t%r14\n+SYM_FUNC_END(ftrace_stub_graph)\n+#endif\n+\n SYM_CODE_START(ftrace_stub_direct_tramp)\n \tlgr\t%r1, %r0\n \tBR_EX\t%r1\ndiff --git a/arch/s390/kernel/text_amode31.S b/arch/s390/kernel/text_amode31.S\nindex 26f2981aa09e31..f007d892d0c5fd 100644\n--- a/arch/s390/kernel/text_amode31.S\n+++ b/arch/s390/kernel/text_amode31.S\n@@ -5,6 +5,7 @@\n * Copyright IBM Corp. 2019\n */\n \n+#include \u003clinux/cfi_types.h\u003e\n #include \u003clinux/linkage.h\u003e\n #include \u003casm/asm-extable.h\u003e\n #include \u003casm/errno.h\u003e\n@@ -26,7 +27,7 @@\n /*\n * int _diag14_amode31(unsigned long rx, unsigned long ry1, unsigned long subcode)\n */\n-SYM_FUNC_START(_diag14_amode31)\n+SYM_TYPED_FUNC_START(_diag14_amode31)\n \tlgr\t%r1,%r2\n \tlgr\t%r2,%r3\n \tlgr\t%r3,%r4\n@@ -46,7 +47,7 @@ SYM_FUNC_END(_diag14_amode31)\n /*\n * int _diag210_amode31(struct diag210 *addr)\n */\n-SYM_FUNC_START(_diag210_amode31)\n+SYM_TYPED_FUNC_START(_diag210_amode31)\n \tlgr\t%r1,%r2\n \tlhi\t%r2,-1\n \tsam31\n@@ -64,7 +65,7 @@ SYM_FUNC_END(_diag210_amode31)\n /*\n * int diag8c(struct diag8c *addr, struct ccw_dev_id *devno, size_t len)\n */\n-SYM_FUNC_START(_diag8c_amode31)\n+SYM_TYPED_FUNC_START(_diag8c_amode31)\n \tllgf\t%r3,0(%r3)\n \tsam31\n \tdiag\t%r2,%r4,0x8c\n@@ -77,7 +78,7 @@ SYM_FUNC_END(_diag8c_amode31)\n /*\n * int _diag26c_amode31(void *req, void *resp, enum diag26c_sc subcode)\n */\n-SYM_FUNC_START(_diag26c_amode31)\n+SYM_TYPED_FUNC_START(_diag26c_amode31)\n \tlghi\t%r5,-EOPNOTSUPP\n \tsam31\n \tdiag\t%r2,%r4,0x26c\n@@ -91,7 +92,7 @@ SYM_FUNC_END(_diag26c_amode31)\n /*\n * void _diag0c_amode31(unsigned long rx)\n */\n-SYM_FUNC_START(_diag0c_amode31)\n+SYM_TYPED_FUNC_START(_diag0c_amode31)\n \tsam31\n \tdiag\t%r2,%r2,0x0c\n \tsam64\n@@ -103,7 +104,7 @@ SYM_FUNC_END(_diag0c_amode31)\n *\n * Calls diag 308 subcode 1 and continues execution\n */\n-SYM_FUNC_START(_diag308_reset_amode31)\n+SYM_TYPED_FUNC_START(_diag308_reset_amode31)\n \tlarl\t%r4,ctlregs\t\t# Save control registers\n \tstctg\t%c0,%c15,0(%r4)\n \tlg\t%r2,0(%r4)\t\t# Disable lowcore protection\ndiff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c\nindex 31749c0362ca23..7f45c106444de4 100644\n--- a/arch/s390/net/bpf_jit_comp.c\n+++ b/arch/s390/net/bpf_jit_comp.c\n@@ -21,6 +21,7 @@\n #include \u003clinux/filter.h\u003e\n #include \u003clinux/init.h\u003e\n #include \u003clinux/bpf.h\u003e\n+#include \u003clinux/cfi.h\u003e\n #include \u003clinux/mm.h\u003e\n #include \u003clinux/kernel.h\u003e\n #include \u003casm/cacheflush.h\u003e\n@@ -356,6 +357,19 @@ static void emit6_pcrel_rilc(struct bpf_jit *jit, u32 op, u8 mask, s64 pcrel)\n \t}\t\t\t\t\t\t\t\\\n })\n \n+static inline void emit_u32_data(const u32 data, struct bpf_jit *jit)\n+{\n+\tif (jit-\u003eprg_buf)\n+\t\t*(u32 *)(jit-\u003eprg_buf + jit-\u003eprg) = data;\n+\tjit-\u003eprg += 4;\n+}\n+\n+static inline void emit_kcfi(u32 hash, struct bpf_jit *jit)\n+{\n+\tif (IS_ENABLED(CONFIG_CFI))\n+\t\temit_u32_data(hash, jit);\n+}\n+\n /*\n * Return whether this is the first pass. The first pass is special, since we\n * don't know any sizes yet, and thus must be conservative.\n@@ -597,6 +611,8 @@ static void bpf_jit_prologue(struct bpf_jit *jit, struct bpf_prog *fp)\n {\n \tBUILD_BUG_ON(sizeof(struct prog_frame) != STACK_FRAME_OVERHEAD);\n \n+\temit_kcfi(bpf_is_subprog(fp) ? cfi_bpf_subprog_hash : cfi_bpf_hash, jit);\n+\n \t/* No-op for hotpatching */\n \t/* brcl 0,prologue_plt */\n \tEMIT6_PCREL_RILC(0xc0040000, 0, jit-\u003eprologue_plt);\n@@ -616,7 +632,7 @@ static void bpf_jit_prologue(struct bpf_jit *jit, struct bpf_prog *fp)\n \t\tbpf_skip(jit, 6);\n \t}\n \t/* Tail calls have to skip above initialization */\n-\tjit-\u003etail_call_start = jit-\u003eprg;\n+\tjit-\u003etail_call_start = jit-\u003eprg - cfi_get_offset();\n \tif (fp-\u003eaux-\u003eexception_cb) {\n \t\t/*\n \t\t * Switch stack, the new address is in the 2nd parameter.\n@@ -2401,11 +2417,13 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr\n \t\tjit_data-\u003ectx = jit;\n \t\tjit_data-\u003epass = pass;\n \t}\n-\tfp-\u003ebpf_func = (void *) jit.prg_buf;\n+\tfp-\u003ebpf_func = (void *)jit.prg_buf + cfi_get_offset();\n \tfp-\u003ejited = 1;\n-\tfp-\u003ejited_len = jit.size;\n+\tfp-\u003ejited_len = jit.size - cfi_get_offset();\n \n \tif (!fp-\u003eis_func || extra_pass) {\n+\t\tfor (int i = 0; i \u003c fp-\u003elen; i++)\n+\t\t\tjit.addrs[i] -= cfi_get_offset();\n \t\tbpf_prog_fill_jited_linfo(fp, jit.addrs + 1);\n free_addrs:\n \t\tkvfree(jit.addrs);\n@@ -2671,8 +2689,10 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,\n \t\treturn -ENOTSUPP;\n \n \t/* Return to %r14 in the struct_ops case. */\n-\tif (flags \u0026 BPF_TRAMP_F_INDIRECT)\n+\tif (flags \u0026 BPF_TRAMP_F_INDIRECT) {\n \t\tflags |= BPF_TRAMP_F_SKIP_FRAME;\n+\t\temit_kcfi(cfi_get_func_hash(func_addr), jit);\n+\t}\n \n \t/*\n \t * Compute how many arguments we need to pass to BPF programs.\ndiff --git a/arch/s390/tools/relocs.c b/arch/s390/tools/relocs.c\nindex 30a732c808f35e..72178dc90a4cf8 100644\n--- a/arch/s390/tools/relocs.c\n+++ b/arch/s390/tools/relocs.c\n@@ -41,6 +41,10 @@\n static Elf_Ehdr\t\tehdr;\n static unsigned long\tshnum;\n static unsigned int\tshstrndx;\n+static unsigned int\tshsymtabndx;\n+static unsigned int\tshxsymtabndx;\n+\n+static int sym_index(Elf_Sym *sym);\n \n struct relocs {\n \tuint32_t\t*offset;\n@@ -54,11 +58,40 @@ static struct relocs relocs64;\n struct section {\n \tElf_Shdr\tshdr;\n \tstruct section\t*link;\n+\tElf_Sym\t\t*symtab;\n+\tElf32_Word\t*xsymtab;\n \tElf_Rel\t\t*reltab;\n+\tchar\t\t*strtab;\n };\n \n static struct section *secs;\n \n+static const char *sec_name(unsigned shndx)\n+{\n+\tconst char *sec_strtab;\n+\tconst char *name = \"\u003cnoname\u003e\";\n+\tsec_strtab = secs[shstrndx].strtab;\n+\n+\tif (shndx \u003c shnum)\n+\t\tname = sec_strtab + secs[shndx].shdr.sh_name;\n+\telse if (shndx == SHN_ABS)\n+\t\tname = \"ABSOLUTE\";\n+\telse if (shndx == SHN_COMMON)\n+\t\tname = \"COMMON\";\n+\treturn name;\n+}\n+\n+static const char *sym_name(const char *sym_strtab, Elf_Sym *sym)\n+{\n+\tconst char *name;\n+\n+\tif (sym-\u003est_name)\n+\t\tname = sym_strtab + sym-\u003est_name;\n+\telse\n+\t\tname = sec_name(sym_index(sym));\n+\treturn name;\n+}\n+\n #if BYTE_ORDER == LITTLE_ENDIAN\n #define le16_to_cpu(val)\t(val)\n #define le32_to_cpu(val)\t(val)\n@@ -105,6 +138,23 @@ static uint64_t elf64_to_cpu(uint64_t val)\n #define elf_off_to_cpu(x)\telf64_to_cpu(x)\n #define elf_xword_to_cpu(x)\telf64_to_cpu(x)\n \n+static int sym_index(Elf_Sym *sym)\n+{\n+\tElf_Sym *symtab = secs[shsymtabndx].symtab;\n+\tElf32_Word *xsymtab = secs[shxsymtabndx].xsymtab;\n+\tunsigned long offset;\n+\tint index;\n+\n+\tif (sym-\u003est_shndx != SHN_XINDEX)\n+\t\treturn sym-\u003est_shndx;\n+\n+\t/* calculate offset of sym from head of table. */\n+\toffset = (unsigned long)sym - (unsigned long)symtab;\n+\tindex = offset / sizeof(*sym);\n+\n+\treturn elf32_to_cpu(xsymtab[index]);\n+}\n+\n static void die(char *fmt, ...)\n {\n \tva_list ap;\n@@ -216,6 +266,81 @@ static void read_shdrs(FILE *fp)\n \n }\n \n+static void read_strtabs(FILE *fp)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i \u003c shnum; i++) {\n+\t\tstruct section *sec = \u0026secs[i];\n+\n+\t\tif (sec-\u003eshdr.sh_type != SHT_STRTAB)\n+\t\t\tcontinue;\n+\n+\t\tsec-\u003estrtab = malloc(sec-\u003eshdr.sh_size);\n+\t\tif (!sec-\u003estrtab)\n+\t\t\tdie(\"malloc of %\" FMT \" bytes for strtab failed\\n\", sec-\u003eshdr.sh_size);\n+\n+\t\tif (fseek(fp, sec-\u003eshdr.sh_offset, SEEK_SET) \u003c 0)\n+\t\t\tdie(\"Seek to %\" FMT \" failed: %s\\n\", sec-\u003eshdr.sh_offset, strerror(errno));\n+\n+\t\tif (fread(sec-\u003estrtab, 1, sec-\u003eshdr.sh_size, fp) != sec-\u003eshdr.sh_size)\n+\t\t\tdie(\"Cannot read symbol table: %s\\n\", strerror(errno));\n+\t}\n+}\n+\n+static void read_symtabs(FILE *fp)\n+{\n+\tint i, j;\n+\n+\tfor (i = 0; i \u003c shnum; i++) {\n+\t\tstruct section *sec = \u0026secs[i];\n+\t\tint num_syms;\n+\n+\t\tswitch (sec-\u003eshdr.sh_type) {\n+\t\tcase SHT_SYMTAB_SHNDX:\n+\t\t\tsec-\u003exsymtab = malloc(sec-\u003eshdr.sh_size);\n+\t\t\tif (!sec-\u003exsymtab)\n+\t\t\t\tdie(\"malloc of %\" FMT \" bytes for xsymtab failed\\n\", sec-\u003eshdr.sh_size);\n+\n+\t\t\tif (fseek(fp, sec-\u003eshdr.sh_offset, SEEK_SET) \u003c 0)\n+\t\t\t\tdie(\"Seek to %\" FMT \" failed: %s\\n\", sec-\u003eshdr.sh_offset, strerror(errno));\n+\n+\t\t\tif (fread(sec-\u003exsymtab, 1, sec-\u003eshdr.sh_size, fp) != sec-\u003eshdr.sh_size)\n+\t\t\t\tdie(\"Cannot read extended symbol table: %s\\n\", strerror(errno));\n+\n+\t\t\tshxsymtabndx = i;\n+\t\t\tcontinue;\n+\n+\t\tcase SHT_SYMTAB:\n+\t\t\tnum_syms = sec-\u003eshdr.sh_size / sizeof(Elf_Sym);\n+\n+\t\t\tsec-\u003esymtab = malloc(sec-\u003eshdr.sh_size);\n+\t\t\tif (!sec-\u003esymtab)\n+\t\t\t\tdie(\"malloc of %\" FMT \" bytes for symtab failed\\n\", sec-\u003eshdr.sh_size);\n+\n+\t\t\tif (fseek(fp, sec-\u003eshdr.sh_offset, SEEK_SET) \u003c 0)\n+\t\t\t\tdie(\"Seek to %\" FMT \" failed: %s\\n\", sec-\u003eshdr.sh_offset, strerror(errno));\n+\n+\t\t\tif (fread(sec-\u003esymtab, 1, sec-\u003eshdr.sh_size, fp) != sec-\u003eshdr.sh_size)\n+\t\t\t\tdie(\"Cannot read symbol table: %s\\n\", strerror(errno));\n+\n+\t\t\tfor (j = 0; j \u003c num_syms; j++) {\n+\t\t\t\tElf_Sym *sym = \u0026sec-\u003esymtab[j];\n+\n+\t\t\t\tsym-\u003est_name = elf_word_to_cpu(sym-\u003est_name);\n+\t\t\t\tsym-\u003est_value = elf_addr_to_cpu(sym-\u003est_value);\n+\t\t\t\tsym-\u003est_size = elf_xword_to_cpu(sym-\u003est_size);\n+\t\t\t\tsym-\u003est_shndx = elf_half_to_cpu(sym-\u003est_shndx);\n+\t\t\t}\n+\t\t\tshsymtabndx = i;\n+\t\t\tcontinue;\n+\n+\t\tdefault:\n+\t\t\tcontinue;\n+\t\t}\n+\t}\n+}\n+\n static void read_relocs(FILE *fp)\n {\n \tint i, j;\n@@ -263,7 +388,8 @@ static void add_reloc(struct relocs *r, uint32_t offset)\n \tr-\u003eoffset[r-\u003ecount++] = offset;\n }\n \n-static int do_reloc(struct section *sec, Elf_Rel *rel)\n+static int do_reloc(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,\n+\t\t const char *symname)\n {\n \tunsigned int r_type = ELF64_R_TYPE(rel-\u003er_info);\n \tElfW(Addr) offset = rel-\u003er_offset;\n@@ -279,6 +405,22 @@ static int do_reloc(struct section *sec, Elf_Rel *rel)\n \tcase R_390_GOTPCDBL:\n \tcase R_390_GOTOFF64:\n \t\tbreak;\n+\tcase R_390_32: {\n+\t\tstatic const char kcfipfx[] = \"__kcfi_typeid_\";\n+\n+\t\tif (sym-\u003est_shndx != SHN_ABS)\n+\t\t\tdie(\"Unsupported relocation type: %d\\n\", r_type);\n+\t\t/*\n+\t\t * Symbols with __kcfi_typeid_ prefix have constant values,\n+\t\t * which do not change if bzImage is loaded at a different\n+\t\t * physical address than the address for which it has been\n+\t\t * compiled.\n+\t\t */\n+\t\tif (!strncmp(kcfipfx, symname, sizeof(kcfipfx) - 1))\n+\t\t\tbreak;\n+\t\tdie(\"Invalid absolute R_390_32 relocation: %s\\n\", symname);\n+\t\tbreak;\n+\t}\n \tcase R_390_64:\n \t\tadd_reloc(\u0026relocs64, offset);\n \t\tbreak;\n@@ -296,21 +438,29 @@ static void walk_relocs(void)\n \n \t/* Walk through the relocations */\n \tfor (i = 0; i \u003c shnum; i++) {\n-\t\tstruct section *sec_applies;\n+\t\tchar *sym_strtab;\n+\t\tElf_Sym *sh_symtab;\n+\t\tstruct section *sec_applies, *sec_symtab;\n \t\tint j;\n \t\tstruct section *sec = \u0026secs[i];\n \n \t\tif (sec-\u003eshdr.sh_type != SHT_REL_TYPE)\n \t\t\tcontinue;\n \n+\t\tsec_symtab = sec-\u003elink;\n \t\tsec_applies = \u0026secs[sec-\u003eshdr.sh_info];\n \t\tif (!(sec_applies-\u003eshdr.sh_flags \u0026 SHF_ALLOC))\n \t\t\tcontinue;\n \n+\t\tsh_symtab = sec_symtab-\u003esymtab;\n+\t\tsym_strtab = sec_symtab-\u003elink-\u003estrtab;\n+\n \t\tfor (j = 0; j \u003c sec-\u003eshdr.sh_size / sizeof(Elf_Rel); j++) {\n \t\t\tElf_Rel *rel = \u0026sec-\u003ereltab[j];\n+\t\t\tElf_Sym *sym = \u0026sh_symtab[ELF_R_SYM(rel-\u003er_info)];\n+\t\t\tconst char *symname = sym_name(sym_strtab, sym);\n \n-\t\t\tdo_reloc(sec, rel);\n+\t\t\tdo_reloc(sec, rel, sym, symname);\n \t\t}\n \t}\n }\n@@ -349,6 +499,8 @@ static void process(FILE *fp)\n {\n \tread_ehdr(fp);\n \tread_shdrs(fp);\n+\tread_strtabs(fp);\n+\tread_symtabs(fp);\n \tread_relocs(fp);\n \temit_relocs();\n }\n"
} |
| 2/1 | 2026/07/28 06:41 | agent | patch-evaluator |
0mModel:best-expensive Args: null Results: {
"EnableConfigs": [
"CFI",
"BPF_JIT"
],
"FocusSymbols": [
"bpf_int_jit_compile",
"arch_prepare_bpf_trampoline"
],
"Reasoning": "The patch implements Kernel Control Flow Integrity (kCFI) support for the s390 architecture. It modifies the BPF JIT compiler to emit KCFI hashes for BPF programs and trampolines, and updates assembly functions to use typed function macros. The BPF JIT changes are reachable and functional when BPF programs are loaded or trampolines are attached.",
"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). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. 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. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 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. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. 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 6984ab8544d323ec8a5a822c57517910edab28b4
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Jul 28 06:41:55 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 84404e6778d504..ec96595cae39f0 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -144,6 +144,7 @@ config S390
select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
select ARCH_STACKWALK
select ARCH_SUPPORTS_ATOMIC_RMW
+ select ARCH_SUPPORTS_CFI
select ARCH_SUPPORTS_DEBUG_PAGEALLOC
select ARCH_SUPPORTS_HUGETLBFS
select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && CC_IS_CLANG
@@ -151,6 +152,7 @@ config S390
select ARCH_SUPPORTS_NUMA_BALANCING
select ARCH_SUPPORTS_PAGE_TABLE_CHECK
select ARCH_SUPPORTS_PER_VMA_LOCK
+ select ARCH_USES_CFI_GENERIC_LLVM_PASS if CC_IS_CLANG
select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_CMPXCHG_LOCKREF
select ARCH_USE_SYM_ANNOTATIONS
diff --git a/arch/s390/include/asm/cfi.h b/arch/s390/include/asm/cfi.h
new file mode 100644
index 00000000000000..9af2c7cb70ca7a
--- /dev/null
+++ b/arch/s390/include/asm/cfi.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_S390_CFI_H
+#define _ASM_S390_CFI_H
+
+#define __bpfcall
+
+#endif /* _ASM_S390_CFI_H */
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S
index 1fec370fecf481..6bc44c767642e5 100644
--- a/arch/s390/kernel/mcount.S
+++ b/arch/s390/kernel/mcount.S
@@ -4,6 +4,7 @@
*
*/
+#include <linux/cfi_types.h>
#include <linux/linkage.h>
#include <asm/asm-offsets.h>
#include <asm/ftrace.h>
@@ -34,10 +35,16 @@
.section .kprobes.text, "ax"
-SYM_FUNC_START(ftrace_stub)
+SYM_TYPED_FUNC_START(ftrace_stub)
BR_EX %r14
SYM_FUNC_END(ftrace_stub)
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+SYM_TYPED_FUNC_START(ftrace_stub_graph)
+ BR_EX %r14
+SYM_FUNC_END(ftrace_stub_graph)
+#endif
+
SYM_CODE_START(ftrace_stub_direct_tramp)
lgr %r1, %r0
BR_EX %r1
diff --git a/arch/s390/kernel/text_amode31.S b/arch/s390/kernel/text_amode31.S
index 26f2981aa09e31..f007d892d0c5fd 100644
--- a/arch/s390/kernel/text_amode31.S
+++ b/arch/s390/kernel/text_amode31.S
@@ -5,6 +5,7 @@
* Copyright IBM Corp. 2019
*/
+#include <linux/cfi_types.h>
#include <linux/linkage.h>
#include <asm/asm-extable.h>
#include <asm/errno.h>
@@ -26,7 +27,7 @@
/*
* int _diag14_amode31(unsigned long rx, unsigned long ry1, unsigned long subcode)
*/
-SYM_FUNC_START(_diag14_amode31)
+SYM_TYPED_FUNC_START(_diag14_amode31)
lgr %r1,%r2
lgr %r2,%r3
lgr %r3,%r4
@@ -46,7 +47,7 @@ SYM_FUNC_END(_diag14_amode31)
/*
* int _diag210_amode31(struct diag210 *addr)
*/
-SYM_FUNC_START(_diag210_amode31)
+SYM_TYPED_FUNC_START(_diag210_amode31)
lgr %r1,%r2
lhi %r2,-1
sam31
@@ -64,7 +65,7 @@ SYM_FUNC_END(_diag210_amode31)
/*
* int diag8c(struct diag8c *addr, struct ccw_dev_id *devno, size_t len)
*/
-SYM_FUNC_START(_diag8c_amode31)
+SYM_TYPED_FUNC_START(_diag8c_amode31)
llgf %r3,0(%r3)
sam31
diag %r2,%r4,0x8c
@@ -77,7 +78,7 @@ SYM_FUNC_END(_diag8c_amode31)
/*
* int _diag26c_amode31(void *req, void *resp, enum diag26c_sc subcode)
*/
-SYM_FUNC_START(_diag26c_amode31)
+SYM_TYPED_FUNC_START(_diag26c_amode31)
lghi %r5,-EOPNOTSUPP
sam31
diag %r2,%r4,0x26c
@@ -91,7 +92,7 @@ SYM_FUNC_END(_diag26c_amode31)
/*
* void _diag0c_amode31(unsigned long rx)
*/
-SYM_FUNC_START(_diag0c_amode31)
+SYM_TYPED_FUNC_START(_diag0c_amode31)
sam31
diag %r2,%r2,0x0c
sam64
@@ -103,7 +104,7 @@ SYM_FUNC_END(_diag0c_amode31)
*
* Calls diag 308 subcode 1 and continues execution
*/
-SYM_FUNC_START(_diag308_reset_amode31)
+SYM_TYPED_FUNC_START(_diag308_reset_amode31)
larl %r4,ctlregs # Save control registers
stctg %c0,%c15,0(%r4)
lg %r2,0(%r4) # Disable lowcore protection
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 31749c0362ca23..7f45c106444de4 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -21,6 +21,7 @@
#include <linux/filter.h>
#include <linux/init.h>
#include <linux/bpf.h>
+#include <linux/cfi.h>
#include <linux/mm.h>
#include <linux/kernel.h>
#include <asm/cacheflush.h>
@@ -356,6 +357,19 @@ static void emit6_pcrel_rilc(struct bpf_jit *jit, u32 op, u8 mask, s64 pcrel)
} \
})
+static inline void emit_u32_data(const u32 data, struct bpf_jit *jit)
+{
+ if (jit->prg_buf)
+ *(u32 *)(jit->prg_buf + jit->prg) = data;
+ jit->prg += 4;
+}
+
+static inline void emit_kcfi(u32 hash, struct bpf_jit *jit)
+{
+ if (IS_ENABLED(CONFIG_CFI))
+ emit_u32_data(hash, jit);
+}
+
/*
* Return whether this is the first pass. The first pass is special, since we
* don't know any sizes yet, and thus must be conservative.
@@ -597,6 +611,8 @@ static void bpf_jit_prologue(struct bpf_jit *jit, struct bpf_prog *fp)
{
BUILD_BUG_ON(sizeof(struct prog_frame) != STACK_FRAME_OVERHEAD);
+ emit_kcfi(bpf_is_subprog(fp) ? cfi_bpf_subprog_hash : cfi_bpf_hash, jit);
+
/* No-op for hotpatching */
/* brcl 0,prologue_plt */
EMIT6_PCREL_RILC(0xc0040000, 0, jit->prologue_plt);
@@ -616,7 +632,7 @@ static void bpf_jit_prologue(struct bpf_jit *jit, struct bpf_prog *fp)
bpf_skip(jit, 6);
}
/* Tail calls have to skip above initialization */
- jit->tail_call_start = jit->prg;
+ jit->tail_call_start = jit->prg - cfi_get_offset();
if (fp->aux->exception_cb) {
/*
* Switch stack, the new address is in the 2nd parameter.
@@ -2401,11 +2417,13 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
jit_data->ctx = jit;
jit_data->pass = pass;
}
- fp->bpf_func = (void *) jit.prg_buf;
+ fp->bpf_func = (void *)jit.prg_buf + cfi_get_offset();
fp->jited = 1;
- fp->jited_len = jit.size;
+ fp->jited_len = jit.size - cfi_get_offset();
if (!fp->is_func || extra_pass) {
+ for (int i = 0; i < fp->len; i++)
+ jit.addrs[i] -= cfi_get_offset();
bpf_prog_fill_jited_linfo(fp, jit.addrs + 1);
free_addrs:
kvfree(jit.addrs);
@@ -2671,8 +2689,10 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
return -ENOTSUPP;
/* Return to %r14 in the struct_ops case. */
- if (flags & BPF_TRAMP_F_INDIRECT)
+ if (flags & BPF_TRAMP_F_INDIRECT) {
flags |= BPF_TRAMP_F_SKIP_FRAME;
+ emit_kcfi(cfi_get_func_hash(func_addr), jit);
+ }
/*
* Compute how many arguments we need to pass to BPF programs.
diff --git a/arch/s390/tools/relocs.c b/arch/s390/tools/relocs.c
index 30a732c808f35e..72178dc90a4cf8 100644
--- a/arch/s390/tools/relocs.c
+++ b/arch/s390/tools/relocs.c
@@ -41,6 +41,10 @@
static Elf_Ehdr ehdr;
static unsigned long shnum;
static unsigned int shstrndx;
+static unsigned int shsymtabndx;
+static unsigned int shxsymtabndx;
+
+static int sym_index(Elf_Sym *sym);
struct relocs {
uint32_t *offset;
@@ -54,11 +58,40 @@ static struct relocs relocs64;
struct section {
Elf_Shdr shdr;
struct section *link;
+ Elf_Sym *symtab;
+ Elf32_Word *xsymtab;
Elf_Rel *reltab;
+ char *strtab;
};
static struct section *secs;
+static const char *sec_name(unsigned shndx)
+{
+ const char *sec_strtab;
+ const char *name = "<noname>";
+ sec_strtab = secs[shstrndx].strtab;
+
+ if (shndx < shnum)
+ name = sec_strtab + secs[shndx].shdr.sh_name;
+ else if (shndx == SHN_ABS)
+ name = "ABSOLUTE";
+ else if (shndx == SHN_COMMON)
+ name = "COMMON";
+ return name;
+}
+
+static const char *sym_name(const char *sym_strtab, Elf_Sym *sym)
+{
+ const char *name;
+
+ if (sym->st_name)
+ name = sym_strtab + sym->st_name;
+ else
+ name = sec_name(sym_index(sym));
+ return name;
+}
+
#if BYTE_ORDER == LITTLE_ENDIAN
#define le16_to_cpu(val) (val)
#define le32_to_cpu(val) (val)
@@ -105,6 +138,23 @@ static uint64_t elf64_to_cpu(uint64_t val)
#define elf_off_to_cpu(x) elf64_to_cpu(x)
#define elf_xword_to_cpu(x) elf64_to_cpu(x)
+static int sym_index(Elf_Sym *sym)
+{
+ Elf_Sym *symtab = secs[shsymtabndx].symtab;
+ Elf32_Word *xsymtab = secs[shxsymtabndx].xsymtab;
+ unsigned long offset;
+ int index;
+
+ if (sym->st_shndx != SHN_XINDEX)
+ return sym->st_shndx;
+
+ /* calculate offset of sym from head of table. */
+ offset = (unsigned long)sym - (unsigned long)symtab;
+ index = offset / sizeof(*sym);
+
+ return elf32_to_cpu(xsymtab[index]);
+}
+
static void die(char *fmt, ...)
{
va_list ap;
@@ -216,6 +266,81 @@ static void read_shdrs(FILE *fp)
}
+static void read_strtabs(FILE *fp)
+{
+ int i;
+
+ for (i = 0; i < shnum; i++) {
+ struct section *sec = &secs[i];
+
+ if (sec->shdr.sh_type != SHT_STRTAB)
+ continue;
+
+ sec->strtab = malloc(sec->shdr.sh_size);
+ if (!sec->strtab)
+ die("malloc of %" FMT " bytes for strtab failed\n", sec->shdr.sh_size);
+
+ if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0)
+ die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno));
+
+ if (fread(sec->strtab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size)
+ die("Cannot read symbol table: %s\n", strerror(errno));
+ }
+}
+
+static void read_symtabs(FILE *fp)
+{
+ int i, j;
+
+ for (i = 0; i < shnum; i++) {
+ struct section *sec = &secs[i];
+ int num_syms;
+
+ switch (sec->shdr.sh_type) {
+ case SHT_SYMTAB_SHNDX:
+ sec->xsymtab = malloc(sec->shdr.sh_size);
+ if (!sec->xsymtab)
+ die("malloc of %" FMT " bytes for xsymtab failed\n", sec->shdr.sh_size);
+
+ if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0)
+ die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno));
+
+ if (fread(sec->xsymtab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size)
+ die("Cannot read extended symbol table: %s\n", strerror(errno));
+
+ shxsymtabndx = i;
+ continue;
+
+ case SHT_SYMTAB:
+ num_syms = sec->shdr.sh_size / sizeof(Elf_Sym);
+
+ sec->symtab = malloc(sec->shdr.sh_size);
+ if (!sec->symtab)
+ die("malloc of %" FMT " bytes for symtab failed\n", sec->shdr.sh_size);
+
+ if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0)
+ die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno));
+
+ if (fread(sec->symtab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size)
+ die("Cannot read symbol table: %s\n", strerror(errno));
+
+ for (j = 0; j < num_syms; j++) {
+ Elf_Sym *sym = &sec->symtab[j];
+
+ sym->st_name = elf_word_to_cpu(sym->st_name);
+ sym->st_value = elf_addr_to_cpu(sym->st_value);
+ sym->st_size = elf_xword_to_cpu(sym->st_size);
+ sym->st_shndx = elf_half_to_cpu(sym->st_shndx);
+ }
+ shsymtabndx = i;
+ continue;
+
+ default:
+ continue;
+ }
+ }
+}
+
static void read_relocs(FILE *fp)
{
int i, j;
@@ -263,7 +388,8 @@ static void add_reloc(struct relocs *r, uint32_t offset)
r->offset[r->count++] = offset;
}
-static int do_reloc(struct section *sec, Elf_Rel *rel)
+static int do_reloc(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,
+ const char *symname)
{
unsigned int r_type = ELF64_R_TYPE(rel->r_info);
ElfW(Addr) offset = rel->r_offset;
@@ -279,6 +405,22 @@ static int do_reloc(struct section *sec, Elf_Rel *rel)
case R_390_GOTPCDBL:
case R_390_GOTOFF64:
break;
+ case R_390_32: {
+ static const char kcfipfx[] = "__kcfi_typeid_";
+
+ if (sym->st_shndx != SHN_ABS)
+ die("Unsupported relocation type: %d\n", r_type);
+ /*
+ * Symbols with __kcfi_typeid_ prefix have constant values,
+ * which do not change if bzImage is loaded at a different
+ * physical address than the address for which it has been
+ * compiled.
+ */
+ if (!strncmp(kcfipfx, symname, sizeof(kcfipfx) - 1))
+ break;
+ die("Invalid absolute R_390_32 relocation: %s\n", symname);
+ break;
+ }
case R_390_64:
add_reloc(&relocs64, offset);
break;
@@ -296,21 +438,29 @@ static void walk_relocs(void)
/* Walk through the relocations */
for (i = 0; i < shnum; i++) {
- struct section *sec_applies;
+ char *sym_strtab;
+ Elf_Sym *sh_symtab;
+ struct section *sec_applies, *sec_symtab;
int j;
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_REL_TYPE)
continue;
+ sec_symtab = sec->link;
sec_applies = &secs[sec->shdr.sh_info];
if (!(sec_applies->shdr.sh_flags & SHF_ALLOC))
continue;
+ sh_symtab = sec_symtab->symtab;
+ sym_strtab = sec_symtab->link->strtab;
+
for (j = 0; j < sec->shdr.sh_size / sizeof(Elf_Rel); j++) {
Elf_Rel *rel = &sec->reltab[j];
+ Elf_Sym *sym = &sh_symtab[ELF_R_SYM(rel->r_info)];
+ const char *symname = sym_name(sym_strtab, sym);
- do_reloc(sec, rel);
+ do_reloc(sec, rel, sym, symname);
}
}
}
@@ -349,6 +499,8 @@ static void process(FILE *fp)
{
read_ehdr(fp);
read_shdrs(fp);
+ read_strtabs(fp);
+ read_symtabs(fp);
read_relocs(fp);
emit_relocs();
}
|
| 3/2 | 2026/07/28 06:41 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 7764 output: 22 thoughts: 595 Thoughts: **Assessing the Impact of this CFI Patch** Okay, so I need to figure out if this patch introduces new functional changes to the kernel that warrant fuzzing attention. It touches quite a few files in the s390 architecture: `arch/s390/Kconfig`, some include files, and some assembly and C files related to the kernel and networking. The core of this patch seems to be enabling CFI (Control Flow Integrity) for the s390 architecture. It's selecting `ARCH_SUPPORTS_CFI` and `ARCH_USES_CFI_GENERIC_LLVM_PASS` if clang is being used. The really interesting part, from a fuzzing perspective, is the BPF JIT compiler modifications. This is definitely a reachable and functional area that's prime for fuzzing. The patch is modifying `bpf_jit_prologue`, `bpf_int_jit_compile`, and `__arch_prepare_bpf_trampoline` to emit KCFI hashes. So, we're dealing with new code generation related to CFI within the BPF JIT, making those functions key targets for fuzzing. Now, let's nail down what configurations are required. It looks like it's going to use `CONFIG_CFI`. I thought `CONFIG_CFI_CLANG` was usually the knob. I'm going to quickly double-check that this is correct, but yeah, it's `CONFIG_CFI`. The code uses `IS_ENABLED(CONFIG_CFI)` to determine if it should emit these hashes. Okay, so that's the configuration dependency. |
| 4/2 | 2026/07/28 06:42 | tool | grepper |
0mArgs:{
"Expression": "config CFI",
"PathPrefix": ""
}Results: {
"Output": "arch/Kconfig=930=config ARCH_USES_CFI_GENERIC_LLVM_PASS\n--\narch/Kconfig-936-\narch/Kconfig:937:config CFI\narch/Kconfig-938-\tbool \"Use Kernel Control Flow Integrity (kCFI)\"\n--\narch/Kconfig-952-\narch/Kconfig:953:config CFI_CLANG\narch/Kconfig-954-\tbool\n--\narch/Kconfig-958-\narch/Kconfig:959:config CFI_ICALL_NORMALIZE_INTEGERS\narch/Kconfig-960-\tbool \"Normalize CFI tags for integers\"\n--\narch/Kconfig=981=config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC\n--\narch/Kconfig-988-\narch/Kconfig:989:config CFI_PERMISSIVE\narch/Kconfig-990-\tbool \"Use CFI in permissive mode\"\n--\narch/x86/Kconfig=2293=config STRICT_SIGALTSTACK_SIZE\n--\narch/x86/Kconfig-2308-\narch/x86/Kconfig:2309:config CFI_AUTO_DEFAULT\narch/x86/Kconfig-2310-\tbool \"Attempt to use FineIBT by default at boot time\"\n"
} |
| 5/2 | 2026/07/28 06:42 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 9078 output: 32 thoughts: 43 Thoughts: Here's my thought process, as if I were analyzing this code: **Checking CFI Configuration** Alright, so `CONFIG_CFI`... that rings a bell. Pretty sure that's a legitimate configuration option, and I should be able to find it defined somewhere in the architecture-specific `Kconfig` files, probably in `arch/Kconfig`. Good practice to double-check that, but I'm pretty confident in that one. Now, hold on a second. Let me quickly scan `arch/Kconfig` to see if there's a related `config` option called `CFI_CLANG`. Might be a Clang-specific implementation or dependency that's controlled separately. Gotta consider all the potential variables, right? Gotta be thorough. |
| 6/2 | 2026/07/28 06:42 | tool | read-file |
0mArgs:{
"File": "arch/Kconfig",
"FirstLine": 930,
"LineCount": 50
}Results: {
"Contents": " 930:\tconfig ARCH_USES_CFI_GENERIC_LLVM_PASS\n 931:\t\tbool\n 932:\t\thelp\n 933:\t\t An architecture should select this option if it uses the generic\n 934:\t\t KCFIPass in LLVM to expand kCFI bundles instead of architecture-specific\n 935:\t\t lowering.\n 936:\t\n 937:\tconfig CFI\n 938:\t\tbool \"Use Kernel Control Flow Integrity (kCFI)\"\n 939:\t\tdefault CFI_CLANG\n 940:\t\tdepends on ARCH_SUPPORTS_CFI\n 941:\t\tdepends on $(cc-option,-fsanitize=kcfi)\n 942:\t\thelp\n 943:\t\t This option enables forward-edge Control Flow Integrity (CFI)\n 944:\t\t checking, where the compiler injects a runtime check to each\n 945:\t\t indirect function call to ensure the target is a valid function with\n 946:\t\t the correct static type. This restricts possible call targets and\n 947:\t\t makes it more difficult for an attacker to exploit bugs that allow\n 948:\t\t the modification of stored function pointers. More information can be\n 949:\t\t found from Clang's documentation:\n 950:\t\n 951:\t\t https://clang.llvm.org/docs/ControlFlowIntegrity.html\n 952:\t\n 953:\tconfig CFI_CLANG\n 954:\t\tbool\n 955:\t\ttransitional\n 956:\t\thelp\n 957:\t\t Transitional config for CFI_CLANG to CFI migration.\n 958:\t\n 959:\tconfig CFI_ICALL_NORMALIZE_INTEGERS\n 960:\t\tbool \"Normalize CFI tags for integers\"\n 961:\t\tdepends on CFI\n 962:\t\tdepends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS\n 963:\t\thelp\n 964:\t\t This option normalizes the CFI tags for integer types so that all\n 965:\t\t integer types of the same size and signedness receive the same CFI\n 966:\t\t tag.\n 967:\t\n 968:\t\t The option is separate from CONFIG_RUST because it affects the ABI.\n 969:\t\t When working with build systems that care about the ABI, it is\n 970:\t\t convenient to be able to turn on this flag first, before Rust is\n 971:\t\t turned on.\n 972:\t\n 973:\t\t This option is necessary for using CFI with Rust. If unsure, say N.\n 974:\t\n 975:\tconfig HAVE_CFI_ICALL_NORMALIZE_INTEGERS\n 976:\t\tdef_bool y\n 977:\t\tdepends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers)\n 978:\t\t# With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826\n 979:\t\tdepends on CLANG_VERSION \u003e= 190103 || (!GCOV_KERNEL \u0026\u0026 !KASAN_GENERIC \u0026\u0026 !KASAN_SW_TAGS)\n"
} |
| 7/2 | 2026/07/28 06:42 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 10165 output: 45 thoughts: 73 Thoughts: Okay, here's my breakdown of what's going through my mind as I approach this: **Analyzing Kernel Configuration Requirements for BPF JIT Compilation on s390 Architecture** Alright, I see we're dealing with kernel configuration options here. First thought: `CONFIG_CFI` - that's *the* configuration option. But hold on, the code path that's grabbed my attention, specifically `arch/s390/net/bpf_jit_comp.c`, suggests another critical piece is needed. I need to make sure `CONFIG_BPF_JIT` is enabled as well, or we won't get far. Right, so, the next step is clearly to dive into `arch/s390/net/bpf_jit_comp.c` itself. I need to take a look at the functions defined within that file to see exactly how these configuration options are being used and how they interrelate within the BPF JIT compilation process for the s390 architecture. This will show us how to verify or configure the necessary settings. |
| 8/2 | 2026/07/28 06:42 | tool | grepper |
0mArgs:{
"Expression": "bpf_int_jit_compile",
"PathPrefix": "arch/s390/net/bpf_jit_comp.c"
}Results: {
"Output": "arch/s390/net/bpf_jit_comp.c=2314=static struct bpf_binary_header *bpf_jit_alloc(struct bpf_jit *jit,\n--\narch/s390/net/bpf_jit_comp.c-2355- */\narch/s390/net/bpf_jit_comp.c:2356:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *fp)\narch/s390/net/bpf_jit_comp.c-2357-{\n"
} |
| 9/2 | 2026/07/28 06:42 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 10684 output: 47 thoughts: 16 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience and written in the first person: **Diving into `__arch_prepare_bpf_trampoline`** Okay, time to dig into this `__arch_prepare_bpf_trampoline` function. Right, so this is where the architecture-specific setup for BPF trampolines is happening. I need to understand what this code is doing at a fundamental level. I'm assuming we're dealing with the details of JIT compilation, probably involving some kind of code generation. I'll need to check the assembly output to verify. First, I should probably identify which architectures this applies to. Is this a common routine or something specific to certain instruction sets? Let's trace how it's being called, figure out the calling conventions and any preconditions. What's it expecting as input? Memory address, registers, specific data structures? Any potential for alignment issues or cache-line effects? I'll also check for any inline assembly, that always grabs my attention. I'll be looking for the critical parts: instruction patching, setting up the trampoline environment, and the actual jump to the BPF program. Are there any security considerations here? Any checks for valid BPF code or potential vulnerabilities? Any potential for side-channel attacks during this setup? Finally, let's see how it plays with things like speculative execution. The goal is a fast, secure, and predictable path into the BPF program. I need to confirm that this function achieves these goals. Let's see if the code comments are descriptive or if I need to disassemble and analyze for myself. |
| 10/2 | 2026/07/28 06:42 | tool | grepper |
0mArgs:{
"Expression": "__arch_prepare_bpf_trampoline",
"PathPrefix": "arch/s390/net/bpf_jit_comp.c"
}Results: {
"Output": "arch/s390/net/bpf_jit_comp.c=2650=static int alloc_stack(struct bpf_tramp_jit *tjit, size_t size)\n--\narch/s390/net/bpf_jit_comp.c-2667-\narch/s390/net/bpf_jit_comp.c:2668:static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,\narch/s390/net/bpf_jit_comp.c-2669-\t\t\t\t\t struct bpf_tramp_jit *tjit,\n--\narch/s390/net/bpf_jit_comp.c=2986=int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\n--\narch/s390/net/bpf_jit_comp.c-2994-\narch/s390/net/bpf_jit_comp.c:2995:\tret = __arch_prepare_bpf_trampoline(\u0026im, \u0026tjit, m, flags,\narch/s390/net/bpf_jit_comp.c-2996-\t\t\t\t\t tnodes, orig_call);\n--\narch/s390/net/bpf_jit_comp.c=3001=int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image,\n--\narch/s390/net/bpf_jit_comp.c-3010-\tmemset(\u0026tjit, 0, sizeof(tjit));\narch/s390/net/bpf_jit_comp.c:3011:\tret = __arch_prepare_bpf_trampoline(im, \u0026tjit, m, flags,\narch/s390/net/bpf_jit_comp.c-3012-\t\t\t\t\t tnodes, func_addr);\n--\narch/s390/net/bpf_jit_comp.c-3024-\ttjit.common.prg_buf = image;\narch/s390/net/bpf_jit_comp.c:3025:\tret = __arch_prepare_bpf_trampoline(im, \u0026tjit, m, flags,\narch/s390/net/bpf_jit_comp.c-3026-\t\t\t\t\t tnodes, func_addr);\n"
} |
| 11/2 | 2026/07/28 06:42 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 11717 output: 36 thoughts: 222 Thoughts: **My Initial Thoughts on BPF JIT Compilation and Trampolines** Okay, so I'm looking at the entry points for BPF JIT and trampolines. It seems `arch_prepare_bpf_trampoline` and `bpf_int_jit_compile` are the crucial functions to focus on. Right, right, `bpf_int_jit_compile` is specifically for the JIT compilation process, and `arch_prepare_bpf_trampoline` handles the trampoline setup. Now, let me just quickly confirm if either of these functions are declared as static. Ah, nope, neither `bpf_int_jit_compile` nor `arch_prepare_bpf_trampoline` are static. And while I'm at it, `arch_bpf_trampoline_size` isn't static either. Now, let's switch gears a bit, I need to check the configuration requirements for BPF JIT support on s390. `CONFIG_BPF_JIT` is obviously a must-have. And, if I'm understanding correctly, `CONFIG_CFI` is crucial for the CFI features. Let's dig into `arch/s390/Kconfig` to see if `ARCH_SUPPORTS_CFI` is defined. |
| 12/2 | 2026/07/28 06:42 | tool | grepper |
0mArgs:{
"Expression": "ARCH_SUPPORTS_CFI",
"PathPrefix": "arch/s390/Kconfig"
}Results: {
"Output": "arch/s390/Kconfig=75=config S390\n--\narch/s390/Kconfig-146-\tselect ARCH_SUPPORTS_ATOMIC_RMW\narch/s390/Kconfig:147:\tselect ARCH_SUPPORTS_CFI\narch/s390/Kconfig-148-\tselect ARCH_SUPPORTS_DEBUG_PAGEALLOC\n"
} |
| 13/2 | 2026/07/28 06:42 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 12366 output: 26 thoughts: 29 Thoughts: Okay, here's my take on those thoughts, framed as an expert's internal monologue: **Checking CFI and the BPF JIT** Alright, the build config's allowing `CONFIG_CFI` to be selected, which is good. That gives us some potential compile-time checks and security hardening. But, since I'm already in this part of the configuration space, let's just make absolutely sure we're handling the BPF JIT correctly. Specifically, is `CONFIG_BPF_JIT` also required in this build? There's likely some interaction or dependency to keep in mind, and I need to evaluate the implications of their interplay. It's time to dig into the details to verify the configuration. |
| 14/2 | 2026/07/28 06:42 | tool | grepper |
0mArgs:{
"Expression": "config BPF_JIT",
"PathPrefix": ""
}Results: {
"Output": "kernel/bpf/Kconfig=27=config BPF_SYSCALL\n--\nkernel/bpf/Kconfig-41-\nkernel/bpf/Kconfig:42:config BPF_JIT\nkernel/bpf/Kconfig-43-\tbool \"Enable BPF Just In Time compiler\"\n--\nkernel/bpf/Kconfig-57-\nkernel/bpf/Kconfig:58:config BPF_JIT_ALWAYS_ON\nkernel/bpf/Kconfig-59-\tbool \"Permanently enable BPF JIT and remove BPF interpreter\"\n--\nkernel/bpf/Kconfig-68-\nkernel/bpf/Kconfig:69:config BPF_JIT_DEFAULT_ON\nkernel/bpf/Kconfig-70-\tdef_bool ARCH_WANT_DEFAULT_BPF_JIT || BPF_JIT_ALWAYS_ON\n"
} |
| 15/2 | 2026/07/28 06:42 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 12802 output: 139 thoughts: 905 Thoughts: **My Analysis of s390 kCFI Implementation** Okay, so I'm looking at implementing CFI (Control Flow Integrity) specifically for the s390 architecture, alongside the BPF JIT compiler (`BPF_JIT`). I need to zero in on the relevant code for fuzzing. My first thought was to examine `arch/s390/tools/relocs.c`, but that's a host tool, not kernel code, so it's not relevant for runtime fuzzing. I then checked the assembly files `arch/s390/kernel/mcount.S` and `arch/s390/kernel/text_amode31.S`. I see the `SYM_FUNC_START` macro is being updated to `SYM_TYPED_FUNC_START` to enable CFI, which is likely where the CFI-specific changes are. The primary functional changes for fuzzing seem to be in `arch/s390/net/bpf_jit_comp.c`. That directory sounds promising. Specifically, I'm focusing on the `bpf_int_jit_compile` and `arch_prepare_bpf_trampoline` functions. They're both standard BPF JIT and trampoline entry points, which are good candidates. I wanted to verify that these functions are indeed the right ones, and based on their names, I'm comfortable that they are. Next, I looked for dependencies on `CONFIG_FUNCTION_GRAPH_TRACER` within `arch/s390/kernel/mcount.S`, where the code uses the typed function start, but that's just adding the CFI type hashes to the function, so it's not a primary target. I've determined that `CFI` and `BPF_JIT` are the relevant configs and `bpf_int_jit_compile` and `arch_prepare_bpf_trampoline` are the relevant symbols to focus on. Then I realized a potential issue: `bpf_int_jit_compile` is very common for BPF JIT. Is it a hot-path? No, it is called when a BPF program is loaded, which is control-path, and so is `arch_prepare_bpf_trampoline`. I double-checked `arch/Kconfig` to confirm that `CFI` is the main configuration. I can confirm it's the primary config as `CFI_CLANG` defaults to `CFI`. The patch implements kCFI for s390, modifying the BPF JIT compiler to emit KCFI hashes and updating assembly functions to use typed function macros. The BPF JIT changes occur when BPF programs are loaded or trampolines are attached. So, here's my strategy: * Configs: `CFI`, `BPF_JIT`. * Symbols: `bpf_int_jit_compile`, `arch_prepare_bpf_trampoline`. While `bpf_int_jit_compile` *is* already fuzzed by syzkaller, focusing on it with `CFI` enabled will specifically test the new KCFI emission logic on s390. I can call `set-results`. |
| 16/2 | 2026/07/28 06:42 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"CFI",
"BPF_JIT"
],
"FocusSymbols": [
"bpf_int_jit_compile",
"arch_prepare_bpf_trampoline"
],
"Reasoning": "The patch implements Kernel Control Flow Integrity (kCFI) support for the s390 architecture. It modifies the BPF JIT compiler to emit KCFI hashes for BPF programs and trampolines, and updates assembly functions to use typed function macros. The BPF JIT changes are reachable and functional when BPF programs are loaded or trampolines are attached.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"CFI",
"BPF_JIT"
],
"FocusSymbols": [
"bpf_int_jit_compile",
"arch_prepare_bpf_trampoline"
],
"Reasoning": "The patch implements Kernel Control Flow Integrity (kCFI) support for the s390 architecture. It modifies the BPF JIT compiler to emit KCFI hashes for BPF programs and trampolines, and updates assembly functions to use typed function macros. The BPF JIT changes are reachable and functional when BPF programs are loaded or trampolines are attached.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|