| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/06 12:19 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "All kernel modifications in this patch series are located in arch/riscv/ (RISC-V BPF JIT implementation), which is specific to RISC-V and unreachable on the target architecture (amd64). The remaining changes are in tools/testing/selftests/ (userspace selftests). Consequently, no reachable kernel code is modified for amd64.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/06 12:19 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 573a362958d56c8df0075eaabb1ef4f81d5be0cb\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sun Sep 6 12:19:56 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/arch/riscv/net/bpf_jit.h b/arch/riscv/net/bpf_jit.h\nindex 419b9d795f2a7..5c4f53060c918 100644\n--- a/arch/riscv/net/bpf_jit.h\n+++ b/arch/riscv/net/bpf_jit.h\n@@ -12,6 +12,9 @@\n #include \u003clinux/bpf.h\u003e\n #include \u003clinux/filter.h\u003e\n \n+#define RV_MAX_REG_ARGS\t\t8\n+#define RV_EXTRA_STK_ARGS\t(RV_MAX_REG_ARGS - MAX_BPF_FUNC_REG_ARGS)\n+\n /* verify runtime detection extension status */\n #define rv_ext_enabled(ext) \\\n \t(IS_ENABLED(CONFIG_RISCV_ISA_##ext) \u0026\u0026 riscv_has_extension_likely(RISCV_ISA_EXT_##ext))\n@@ -82,6 +85,7 @@ struct rv_jit_context {\n \tunsigned long flags;\n \tint stack_size;\n \tint tcc_offset;\n+\tint stack_arg_sz;\n \tu64 arena_vm_start;\n \tu64 user_vm_start;\n };\ndiff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c\nindex e7378be171a9f..7f84447a31ffd 100644\n--- a/arch/riscv/net/bpf_jit_comp64.c\n+++ b/arch/riscv/net/bpf_jit_comp64.c\n@@ -15,7 +15,6 @@\n #include \u003casm/percpu.h\u003e\n #include \"bpf_jit.h\"\n \n-#define RV_MAX_REG_ARGS 8\n #define RV_FENTRY_NINSNS 2\n #define RV_FENTRY_NBYTES (RV_FENTRY_NINSNS * 4)\n /* imm that allows emit_imm to emit max count insns */\n@@ -23,11 +22,11 @@\n /* fentry and TCC init insns will be skipped on tailcall */\n #define RV_TAILCALL_OFFSET ((RV_FENTRY_NINSNS + 1) * 4)\n \n-#define RV_REG_TCC RV_REG_A6\n+#define RV_REG_TCC RV_REG_T5\n #define RV_REG_ARENA RV_REG_S7 /* For storing arena_vm_start */\n \n static const int regmap[] = {\n-\t[BPF_REG_0] =\tRV_REG_A5,\n+\t[BPF_REG_0] =\tRV_REG_T6,\n \t[BPF_REG_1] =\tRV_REG_A0,\n \t[BPF_REG_2] =\tRV_REG_A1,\n \t[BPF_REG_3] =\tRV_REG_A2,\n@@ -47,13 +46,13 @@ static const int pt_regmap[] = {\n \t[RV_REG_A2] = offsetof(struct pt_regs, a2),\n \t[RV_REG_A3] = offsetof(struct pt_regs, a3),\n \t[RV_REG_A4] = offsetof(struct pt_regs, a4),\n-\t[RV_REG_A5] = offsetof(struct pt_regs, a5),\n \t[RV_REG_S1] = offsetof(struct pt_regs, s1),\n \t[RV_REG_S2] = offsetof(struct pt_regs, s2),\n \t[RV_REG_S3] = offsetof(struct pt_regs, s3),\n \t[RV_REG_S4] = offsetof(struct pt_regs, s4),\n \t[RV_REG_S5] = offsetof(struct pt_regs, s5),\n \t[RV_REG_T0] = offsetof(struct pt_regs, t0),\n+\t[RV_REG_T6] = offsetof(struct pt_regs, t6),\n };\n \n enum {\n@@ -239,7 +238,7 @@ static void __build_epilogue(bool is_tail_call, struct rv_jit_context *ctx)\n \temit_addi(RV_REG_SP, RV_REG_SP, stack_adjust, ctx);\n \t/* Set return value. */\n \tif (!is_tail_call)\n-\t\temit_addiw(RV_REG_A0, RV_REG_A5, 0, ctx);\n+\t\temit_addiw(RV_REG_A0, regmap[BPF_REG_0], 0, ctx);\n \temit_jalr(RV_REG_ZERO, is_tail_call ? RV_REG_T3 : RV_REG_RA,\n \t\t is_tail_call ? RV_TAILCALL_OFFSET : 0, ctx);\n }\n@@ -498,6 +497,18 @@ static void emit_ldx(u8 rd, s16 off, u8 rs, u8 size, bool sign_ext,\n \tctx-\u003eex_jmp_off = ctx-\u003eninsns;\n }\n \n+static void emit_stack_arg_ldx(u8 rd, s16 off, struct rv_jit_context *ctx)\n+{\n+\tint idx = off / 8 - 1;\n+\n+\tif (idx \u003c RV_EXTRA_STK_ARGS) {\n+\t\temit_mv(rd, RV_REG_A5 + idx, ctx);\n+\t\treturn;\n+\t}\n+\n+\temit_ldx_insn(rd, (idx - RV_EXTRA_STK_ARGS) * 8, RV_REG_FP, BPF_DW, false, ctx);\n+}\n+\n static void emit_st(u8 rd, s16 off, s32 imm, u8 size, struct rv_jit_context *ctx)\n {\n \temit_imm(RV_REG_T1, imm, ctx);\n@@ -515,6 +526,19 @@ static void emit_st(u8 rd, s16 off, s32 imm, u8 size, struct rv_jit_context *ctx\n \tctx-\u003eex_jmp_off = ctx-\u003eninsns;\n }\n \n+static void emit_stack_arg_st(s16 off, s32 imm, struct rv_jit_context *ctx)\n+{\n+\tint idx = -off / 8 - 1;\n+\n+\tif (idx \u003c RV_EXTRA_STK_ARGS) {\n+\t\temit_imm(RV_REG_A5 + idx, imm, ctx);\n+\t\treturn;\n+\t}\n+\n+\temit_imm(RV_REG_T1, imm, ctx);\n+\temit_stx_insn(RV_REG_SP, (idx - RV_EXTRA_STK_ARGS) * 8, RV_REG_T1, BPF_DW, ctx);\n+}\n+\n static void emit_stx(u8 rd, s16 off, u8 rs, u8 size, struct rv_jit_context *ctx)\n {\n \tif (is_12b_int(off)) {\n@@ -531,6 +555,18 @@ static void emit_stx(u8 rd, s16 off, u8 rs, u8 size, struct rv_jit_context *ctx)\n \tctx-\u003eex_jmp_off = ctx-\u003eninsns;\n }\n \n+static void emit_stack_arg_stx(s16 off, u8 rs, struct rv_jit_context *ctx)\n+{\n+\tint idx = -off / 8 - 1;\n+\n+\tif (idx \u003c RV_EXTRA_STK_ARGS) {\n+\t\temit_mv(RV_REG_A5 + idx, rs, ctx);\n+\t\treturn;\n+\t}\n+\n+\temit_stx_insn(RV_REG_SP, (idx - RV_EXTRA_STK_ARGS) * 8, rs, BPF_DW, ctx);\n+}\n+\n static int emit_atomic_ld_st(u8 rd, u8 rs, const struct bpf_insn *insn,\n \t\t\t struct rv_jit_context *ctx)\n {\n@@ -1075,7 +1111,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,\n \n \tsave_ret = flags \u0026 (BPF_TRAMP_F_CALL_ORIG | BPF_TRAMP_F_RET_FENTRY_RET);\n \tif (save_ret)\n-\t\tstack_size += 16; /* Save both A5 (BPF R0) and A0 */\n+\t\tstack_size += 16; /* Save both RV_REG_T6 (BPF R0) and RV_REG_A0 */\n \tretval_off = stack_size;\n \n \tstack_size += nr_arg_slots * 8;\n@@ -1824,11 +1860,21 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,\n \t\t\t\treturn -EINVAL;\n \n \t\t\tfor (idx = 0; idx \u003c fm-\u003enr_args; idx++) {\n-\t\t\t\tu8 reg = bpf_to_rv_reg(BPF_REG_1 + idx, ctx);\n \t\t\t\tbool sign = fm-\u003earg_flags[idx] \u0026 BTF_FMODEL_SIGNED_ARG;\n-\n-\t\t\t\tif (sign_extend(reg, reg, fm-\u003earg_size[idx], sign, ctx))\n-\t\t\t\t\treturn -EINVAL;\n+\t\t\t\tu8 arg_sz = fm-\u003earg_size[idx];\n+\n+\t\t\t\tif (arg_sz == 8 || (arg_sz != 4 \u0026\u0026 !sign))\n+\t\t\t\t\tcontinue;\n+\n+\t\t\t\tif (idx \u003c RV_MAX_REG_ARGS) {\n+\t\t\t\t\tif (sign_extend(RV_REG_A0 + idx, RV_REG_A0 + idx, arg_sz, sign, ctx))\n+\t\t\t\t\t\treturn -EINVAL;\n+\t\t\t\t} else {\n+\t\t\t\t\temit_ld(RV_REG_T1, (idx - RV_MAX_REG_ARGS) * 8, RV_REG_SP, ctx);\n+\t\t\t\t\tif (sign_extend(RV_REG_T1, RV_REG_T1, arg_sz, sign, ctx))\n+\t\t\t\t\t\treturn -EINVAL;\n+\t\t\t\t\temit_sd(RV_REG_SP, (idx - RV_MAX_REG_ARGS) * 8, RV_REG_T1, ctx);\n+\t\t\t\t}\n \t\t\t}\n \t\t}\n \n@@ -1927,7 +1973,10 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,\n \t\t\trs = RV_REG_T2;\n \t\t}\n \n-\t\temit_ldx(rd, off, rs, BPF_SIZE(code), sign_ext, ctx);\n+\t\tif (is_stack_arg_ldx(insn))\n+\t\t\temit_stack_arg_ldx(rd, off, ctx);\n+\t\telse\n+\t\t\temit_ldx(rd, off, rs, BPF_SIZE(code), sign_ext, ctx);\n \n \t\tret = add_exception_handler(insn, rd, ctx);\n \t\tif (ret)\n@@ -1957,7 +2006,10 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,\n \t\t\trd = RV_REG_T3;\n \t\t}\n \n-\t\temit_st(rd, off, imm, BPF_SIZE(code), ctx);\n+\t\tif (is_stack_arg_st(insn))\n+\t\t\temit_stack_arg_st(off, imm, ctx);\n+\t\telse\n+\t\t\temit_st(rd, off, imm, BPF_SIZE(code), ctx);\n \n \t\tret = add_exception_handler(insn, REG_DONT_CLEAR_MARKER, ctx);\n \t\tif (ret)\n@@ -1979,7 +2031,10 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,\n \t\t\trd = RV_REG_T2;\n \t\t}\n \n-\t\temit_stx(rd, off, rs, BPF_SIZE(code), ctx);\n+\t\tif (is_stack_arg_stx(insn))\n+\t\t\temit_stack_arg_stx(off, rs, ctx);\n+\t\telse\n+\t\t\temit_stx(rd, off, rs, BPF_SIZE(code), ctx);\n \n \t\tret = add_exception_handler(insn, REG_DONT_CLEAR_MARKER, ctx);\n \t\tif (ret)\n@@ -2029,9 +2084,9 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,\n \n void bpf_jit_build_prologue(struct rv_jit_context *ctx, bool is_subprog)\n {\n-\tint i, stack_adjust = 0, store_offset, bpf_stack_adjust;\n+\tint i, stack_adjust = 0, store_offset, bpf_stack_adjust = ctx-\u003estack_arg_sz;\n \n-\tbpf_stack_adjust = round_up(ctx-\u003eprog-\u003eaux-\u003estack_depth, STACK_ALIGN);\n+\tbpf_stack_adjust += round_up(ctx-\u003eprog-\u003eaux-\u003estack_depth, STACK_ALIGN);\n \tif (bpf_stack_adjust)\n \t\tmark_fp(ctx);\n \n@@ -2190,3 +2245,8 @@ bool bpf_jit_supports_timed_may_goto(void)\n {\n \treturn true;\n }\n+\n+bool bpf_jit_supports_stack_args(void)\n+{\n+\treturn true;\n+}\ndiff --git a/arch/riscv/net/bpf_jit_core.c b/arch/riscv/net/bpf_jit_core.c\nindex cbfcd287ea166..2fb0b4e198b94 100644\n--- a/arch/riscv/net/bpf_jit_core.c\n+++ b/arch/riscv/net/bpf_jit_core.c\n@@ -48,6 +48,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr\n \tint pass = 0, prev_ninsns = 0, i;\n \tstruct rv_jit_data *jit_data;\n \tstruct rv_jit_context *ctx;\n+\tu16 stack_arg_cnt;\n \n \tif (!prog-\u003ejit_requested)\n \t\treturn prog;\n@@ -71,6 +72,12 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr\n \n \tctx-\u003earena_vm_start = bpf_arena_get_kern_vm_start(prog-\u003eaux-\u003earena);\n \tctx-\u003euser_vm_start = bpf_arena_get_user_vm_start(prog-\u003eaux-\u003earena);\n+\n+\tstack_arg_cnt = bpf_out_stack_arg_cnt(env, prog);\n+\t/* First 3 stack args in regs, rest on stack */\n+\tctx-\u003estack_arg_sz = stack_arg_cnt \u003e RV_EXTRA_STK_ARGS ?\n+\t\t\t round_up((stack_arg_cnt - RV_EXTRA_STK_ARGS) * 8, STACK_ALIGN) : 0;\n+\n \tctx-\u003eprog = prog;\n \tctx-\u003eoffset = kvzalloc_objs(int, prog-\u003elen);\n \tif (!ctx-\u003eoffset)\ndiff --git a/arch/riscv/net/bpf_timed_may_goto.S b/arch/riscv/net/bpf_timed_may_goto.S\nindex 02c637d874205..fcf850f244c90 100644\n--- a/arch/riscv/net/bpf_timed_may_goto.S\n+++ b/arch/riscv/net/bpf_timed_may_goto.S\n@@ -10,7 +10,7 @@\n *\t- output: updated count in BPF_REG_AX (t0)\n *\n * Calls bpf_check_timed_may_goto(ptr) with the standard RISC-V ABI, where\n- * ptr = BPF_REG_FP (s5) + BPF_REG_AX (t0). BPF R0-R5 (a5, a0-a4) are saved\n+ * ptr = BPF_REG_FP (s5) + BPF_REG_AX (t0). BPF R0-R5 (t6, a0-a4) are saved\n * across the call; BPF_REG_FP (s5) is callee-saved and needs no saving.\n */\n \n@@ -20,8 +20,8 @@ SYM_FUNC_START(arch_bpf_timed_may_goto)\n \tREG_S\ts0, 6*SZREG(sp)\n \taddi\ts0, sp, 8*SZREG\n \n-\t/* Save BPF registers R0-R5 (a5, a0-a4) */\n-\tREG_S\ta5, 5*SZREG(sp)\n+\t/* Save BPF registers R0-R5 (t6, a0-a4) */\n+\tREG_S\tt6, 5*SZREG(sp)\n \tREG_S\ta0, 4*SZREG(sp)\n \tREG_S\ta1, 3*SZREG(sp)\n \tREG_S\ta2, 2*SZREG(sp)\n@@ -38,7 +38,7 @@ SYM_FUNC_START(arch_bpf_timed_may_goto)\n \tREG_L\ta2, 2*SZREG(sp)\n \tREG_L\ta1, 3*SZREG(sp)\n \tREG_L\ta0, 4*SZREG(sp)\n-\tREG_L\ta5, 5*SZREG(sp)\n+\tREG_L\tt6, 5*SZREG(sp)\n \n \tREG_L\ts0, 6*SZREG(sp)\n \tREG_L\tra, 7*SZREG(sp)\ndiff --git a/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c b/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c\nindex 8d38aafe66a28..ab12397a9b52a 100644\n--- a/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c\n+++ b/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c\n@@ -4,7 +4,8 @@\n #include \u003cbpf/bpf_helpers.h\u003e\n #include \"../test_kmods/bpf_testmod_kfunc.h\"\n \n-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) \u0026\u0026 \\\n+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \\\n+\t(defined(__TARGET_ARCH_riscv) \u0026\u0026 __riscv_xlen == 64)) \u0026\u0026 \\\n \tdefined(__BPF_FEATURE_STACK_ARGUMENT)\n \n long subprog_call_mem_kfunc(long a, long b, long c, long d, long e, long size)\ndiff --git a/tools/testing/selftests/bpf/progs/btf__verifier_stack_arg_order.c b/tools/testing/selftests/bpf/progs/btf__verifier_stack_arg_order.c\nindex 99bc115f8380a..a980a3a399d3f 100644\n--- a/tools/testing/selftests/bpf/progs/btf__verifier_stack_arg_order.c\n+++ b/tools/testing/selftests/bpf/progs/btf__verifier_stack_arg_order.c\n@@ -3,7 +3,8 @@\n #include \u003cvmlinux.h\u003e\n #include \u003cbpf/bpf_helpers.h\u003e\n \n-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) \u0026\u0026 \\\n+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \\\n+\t(defined(__TARGET_ARCH_riscv) \u0026\u0026 __riscv_xlen == 64)) \u0026\u0026 \\\n \tdefined(__BPF_FEATURE_STACK_ARGUMENT)\n \n int subprog_bad_order_6args(int a, int b, int c, int d, int e, int f)\ndiff --git a/tools/testing/selftests/bpf/progs/stack_arg.c b/tools/testing/selftests/bpf/progs/stack_arg.c\nindex 944e3bb603e7e..3e9ed37c57bb9 100644\n--- a/tools/testing/selftests/bpf/progs/stack_arg.c\n+++ b/tools/testing/selftests/bpf/progs/stack_arg.c\n@@ -21,7 +21,8 @@ struct {\n \n int timer_result;\n \n-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) \u0026\u0026 \\\n+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \\\n+\t(defined(__TARGET_ARCH_riscv) \u0026\u0026 __riscv_xlen == 64)) \u0026\u0026 \\\n \tdefined(__BPF_FEATURE_STACK_ARGUMENT)\n \n const volatile bool has_stack_arg = true;\ndiff --git a/tools/testing/selftests/bpf/progs/stack_arg_kfunc.c b/tools/testing/selftests/bpf/progs/stack_arg_kfunc.c\nindex 345f2da2e361b..b6b1a8aa7f44a 100644\n--- a/tools/testing/selftests/bpf/progs/stack_arg_kfunc.c\n+++ b/tools/testing/selftests/bpf/progs/stack_arg_kfunc.c\n@@ -6,7 +6,8 @@\n #include \"bpf_kfuncs.h\"\n #include \"../test_kmods/bpf_testmod_kfunc.h\"\n \n-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) \u0026\u0026 \\\n+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \\\n+\t(defined(__TARGET_ARCH_riscv) \u0026\u0026 __riscv_xlen == 64)) \u0026\u0026 \\\n \tdefined(__BPF_FEATURE_STACK_ARGUMENT)\n \n const volatile bool has_stack_arg = true;\ndiff --git a/tools/testing/selftests/bpf/progs/stack_arg_precision.c b/tools/testing/selftests/bpf/progs/stack_arg_precision.c\nindex ce0301a41fa94..7baa9c1c8e31e 100644\n--- a/tools/testing/selftests/bpf/progs/stack_arg_precision.c\n+++ b/tools/testing/selftests/bpf/progs/stack_arg_precision.c\n@@ -6,7 +6,8 @@\n #include \"../test_kmods/bpf_testmod_kfunc.h\"\n #include \"bpf_misc.h\"\n \n-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) \u0026\u0026 \\\n+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \\\n+\t(defined(__TARGET_ARCH_riscv) \u0026\u0026 __riscv_xlen == 64)) \u0026\u0026 \\\n \tdefined(__BPF_FEATURE_STACK_ARGUMENT)\n \n /* Force kfunc extern BTF generation for inline asm call below.\ndiff --git a/tools/testing/selftests/bpf/progs/verifier_jit_inline.c b/tools/testing/selftests/bpf/progs/verifier_jit_inline.c\nindex 02e562f56f9d3..5b92da2ab75cf 100644\n--- a/tools/testing/selftests/bpf/progs/verifier_jit_inline.c\n+++ b/tools/testing/selftests/bpf/progs/verifier_jit_inline.c\n@@ -11,7 +11,7 @@ __jited(\"\taddq\t%gs:{{.*}}, %rax\")\n __arch_arm64\n __jited(\"\tmrs\tx8, SP_EL0\")\n __arch_riscv64\n-__jited(\"\tmv\ta5, tp\")\n+__jited(\"\tmv\tt6, tp\")\n __arch_loongarch\n __jited(\"\tmove\t$a5, $tp\")\n int inline_bpf_get_current_task(void)\ndiff --git a/tools/testing/selftests/bpf/progs/verifier_ldsx.c b/tools/testing/selftests/bpf/progs/verifier_ldsx.c\nindex 7e25e1b8cd0b7..49e8cd4bb4f99 100644\n--- a/tools/testing/selftests/bpf/progs/verifier_ldsx.c\n+++ b/tools/testing/selftests/bpf/progs/verifier_ldsx.c\n@@ -289,11 +289,11 @@ __jited(\"ldrsh\tx22, [x11, #0x18]\")\n __jited(\"add\tx11, x0, x28\")\n __jited(\"ldrsb\tx22, [x11, #0x20]\")\n __arch_riscv64\n-__jited(\"add\tt2, a5, s7\")\n+__jited(\"add\tt2, t6, s7\")\n __jited(\"lw\ts3, 0x10(t2)\")\n-__jited(\"add\tt2, a5, s7\")\n+__jited(\"add\tt2, t6, s7\")\n __jited(\"lh\ts3, 0x18(t2)\")\n-__jited(\"add\tt2, a5, s7\")\n+__jited(\"add\tt2, t6, s7\")\n __jited(\"lb\ts3, 0x20(t2)\")\n __jited(\"add\tt2, a0, s7\")\n __jited(\"lw\ts4, 0x10(t2)\")\ndiff --git a/tools/testing/selftests/bpf/progs/verifier_stack_arg.c b/tools/testing/selftests/bpf/progs/verifier_stack_arg.c\nindex 51d22faf4559f..f6a4a6aa0e617 100644\n--- a/tools/testing/selftests/bpf/progs/verifier_stack_arg.c\n+++ b/tools/testing/selftests/bpf/progs/verifier_stack_arg.c\n@@ -12,7 +12,8 @@ struct {\n \t__type(value, long long);\n } map_hash_8b SEC(\".maps\");\n \n-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) \u0026\u0026 \\\n+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \\\n+\t(defined(__TARGET_ARCH_riscv) \u0026\u0026 __riscv_xlen == 64)) \u0026\u0026 \\\n \tdefined(__BPF_FEATURE_STACK_ARGUMENT)\n \n __noinline __used\ndiff --git a/tools/testing/selftests/bpf/progs/verifier_stack_arg_order.c b/tools/testing/selftests/bpf/progs/verifier_stack_arg_order.c\nindex 8e4325273b3d8..57f22691744ad 100644\n--- a/tools/testing/selftests/bpf/progs/verifier_stack_arg_order.c\n+++ b/tools/testing/selftests/bpf/progs/verifier_stack_arg_order.c\n@@ -5,7 +5,8 @@\n #include \u003cbpf/bpf_helpers.h\u003e\n #include \"bpf_misc.h\"\n \n-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) \u0026\u0026 \\\n+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \\\n+\t(defined(__TARGET_ARCH_riscv) \u0026\u0026 __riscv_xlen == 64)) \u0026\u0026 \\\n \tdefined(__BPF_FEATURE_STACK_ARGUMENT)\n \n __noinline __used __naked\n"
} |
| 2/1 | 2026/09/06 12:19 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "All kernel modifications in this patch series are located in arch/riscv/ (RISC-V BPF JIT implementation), which is specific to RISC-V and unreachable on the target architecture (amd64). The remaining changes are in tools/testing/selftests/ (userspace selftests). Consequently, no reachable kernel code is modified for amd64.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 573a362958d56c8df0075eaabb1ef4f81d5be0cb
Author: syz-cluster <triage@syzkaller.com>
Date: Sun Sep 6 12:19:56 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/riscv/net/bpf_jit.h b/arch/riscv/net/bpf_jit.h
index 419b9d795f2a7..5c4f53060c918 100644
--- a/arch/riscv/net/bpf_jit.h
+++ b/arch/riscv/net/bpf_jit.h
@@ -12,6 +12,9 @@
#include <linux/bpf.h>
#include <linux/filter.h>
+#define RV_MAX_REG_ARGS 8
+#define RV_EXTRA_STK_ARGS (RV_MAX_REG_ARGS - MAX_BPF_FUNC_REG_ARGS)
+
/* verify runtime detection extension status */
#define rv_ext_enabled(ext) \
(IS_ENABLED(CONFIG_RISCV_ISA_##ext) && riscv_has_extension_likely(RISCV_ISA_EXT_##ext))
@@ -82,6 +85,7 @@ struct rv_jit_context {
unsigned long flags;
int stack_size;
int tcc_offset;
+ int stack_arg_sz;
u64 arena_vm_start;
u64 user_vm_start;
};
diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c
index e7378be171a9f..7f84447a31ffd 100644
--- a/arch/riscv/net/bpf_jit_comp64.c
+++ b/arch/riscv/net/bpf_jit_comp64.c
@@ -15,7 +15,6 @@
#include <asm/percpu.h>
#include "bpf_jit.h"
-#define RV_MAX_REG_ARGS 8
#define RV_FENTRY_NINSNS 2
#define RV_FENTRY_NBYTES (RV_FENTRY_NINSNS * 4)
/* imm that allows emit_imm to emit max count insns */
@@ -23,11 +22,11 @@
/* fentry and TCC init insns will be skipped on tailcall */
#define RV_TAILCALL_OFFSET ((RV_FENTRY_NINSNS + 1) * 4)
-#define RV_REG_TCC RV_REG_A6
+#define RV_REG_TCC RV_REG_T5
#define RV_REG_ARENA RV_REG_S7 /* For storing arena_vm_start */
static const int regmap[] = {
- [BPF_REG_0] = RV_REG_A5,
+ [BPF_REG_0] = RV_REG_T6,
[BPF_REG_1] = RV_REG_A0,
[BPF_REG_2] = RV_REG_A1,
[BPF_REG_3] = RV_REG_A2,
@@ -47,13 +46,13 @@ static const int pt_regmap[] = {
[RV_REG_A2] = offsetof(struct pt_regs, a2),
[RV_REG_A3] = offsetof(struct pt_regs, a3),
[RV_REG_A4] = offsetof(struct pt_regs, a4),
- [RV_REG_A5] = offsetof(struct pt_regs, a5),
[RV_REG_S1] = offsetof(struct pt_regs, s1),
[RV_REG_S2] = offsetof(struct pt_regs, s2),
[RV_REG_S3] = offsetof(struct pt_regs, s3),
[RV_REG_S4] = offsetof(struct pt_regs, s4),
[RV_REG_S5] = offsetof(struct pt_regs, s5),
[RV_REG_T0] = offsetof(struct pt_regs, t0),
+ [RV_REG_T6] = offsetof(struct pt_regs, t6),
};
enum {
@@ -239,7 +238,7 @@ static void __build_epilogue(bool is_tail_call, struct rv_jit_context *ctx)
emit_addi(RV_REG_SP, RV_REG_SP, stack_adjust, ctx);
/* Set return value. */
if (!is_tail_call)
- emit_addiw(RV_REG_A0, RV_REG_A5, 0, ctx);
+ emit_addiw(RV_REG_A0, regmap[BPF_REG_0], 0, ctx);
emit_jalr(RV_REG_ZERO, is_tail_call ? RV_REG_T3 : RV_REG_RA,
is_tail_call ? RV_TAILCALL_OFFSET : 0, ctx);
}
@@ -498,6 +497,18 @@ static void emit_ldx(u8 rd, s16 off, u8 rs, u8 size, bool sign_ext,
ctx->ex_jmp_off = ctx->ninsns;
}
+static void emit_stack_arg_ldx(u8 rd, s16 off, struct rv_jit_context *ctx)
+{
+ int idx = off / 8 - 1;
+
+ if (idx < RV_EXTRA_STK_ARGS) {
+ emit_mv(rd, RV_REG_A5 + idx, ctx);
+ return;
+ }
+
+ emit_ldx_insn(rd, (idx - RV_EXTRA_STK_ARGS) * 8, RV_REG_FP, BPF_DW, false, ctx);
+}
+
static void emit_st(u8 rd, s16 off, s32 imm, u8 size, struct rv_jit_context *ctx)
{
emit_imm(RV_REG_T1, imm, ctx);
@@ -515,6 +526,19 @@ static void emit_st(u8 rd, s16 off, s32 imm, u8 size, struct rv_jit_context *ctx
ctx->ex_jmp_off = ctx->ninsns;
}
+static void emit_stack_arg_st(s16 off, s32 imm, struct rv_jit_context *ctx)
+{
+ int idx = -off / 8 - 1;
+
+ if (idx < RV_EXTRA_STK_ARGS) {
+ emit_imm(RV_REG_A5 + idx, imm, ctx);
+ return;
+ }
+
+ emit_imm(RV_REG_T1, imm, ctx);
+ emit_stx_insn(RV_REG_SP, (idx - RV_EXTRA_STK_ARGS) * 8, RV_REG_T1, BPF_DW, ctx);
+}
+
static void emit_stx(u8 rd, s16 off, u8 rs, u8 size, struct rv_jit_context *ctx)
{
if (is_12b_int(off)) {
@@ -531,6 +555,18 @@ static void emit_stx(u8 rd, s16 off, u8 rs, u8 size, struct rv_jit_context *ctx)
ctx->ex_jmp_off = ctx->ninsns;
}
+static void emit_stack_arg_stx(s16 off, u8 rs, struct rv_jit_context *ctx)
+{
+ int idx = -off / 8 - 1;
+
+ if (idx < RV_EXTRA_STK_ARGS) {
+ emit_mv(RV_REG_A5 + idx, rs, ctx);
+ return;
+ }
+
+ emit_stx_insn(RV_REG_SP, (idx - RV_EXTRA_STK_ARGS) * 8, rs, BPF_DW, ctx);
+}
+
static int emit_atomic_ld_st(u8 rd, u8 rs, const struct bpf_insn *insn,
struct rv_jit_context *ctx)
{
@@ -1075,7 +1111,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
save_ret = flags & (BPF_TRAMP_F_CALL_ORIG | BPF_TRAMP_F_RET_FENTRY_RET);
if (save_ret)
- stack_size += 16; /* Save both A5 (BPF R0) and A0 */
+ stack_size += 16; /* Save both RV_REG_T6 (BPF R0) and RV_REG_A0 */
retval_off = stack_size;
stack_size += nr_arg_slots * 8;
@@ -1824,11 +1860,21 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
return -EINVAL;
for (idx = 0; idx < fm->nr_args; idx++) {
- u8 reg = bpf_to_rv_reg(BPF_REG_1 + idx, ctx);
bool sign = fm->arg_flags[idx] & BTF_FMODEL_SIGNED_ARG;
-
- if (sign_extend(reg, reg, fm->arg_size[idx], sign, ctx))
- return -EINVAL;
+ u8 arg_sz = fm->arg_size[idx];
+
+ if (arg_sz == 8 || (arg_sz != 4 && !sign))
+ continue;
+
+ if (idx < RV_MAX_REG_ARGS) {
+ if (sign_extend(RV_REG_A0 + idx, RV_REG_A0 + idx, arg_sz, sign, ctx))
+ return -EINVAL;
+ } else {
+ emit_ld(RV_REG_T1, (idx - RV_MAX_REG_ARGS) * 8, RV_REG_SP, ctx);
+ if (sign_extend(RV_REG_T1, RV_REG_T1, arg_sz, sign, ctx))
+ return -EINVAL;
+ emit_sd(RV_REG_SP, (idx - RV_MAX_REG_ARGS) * 8, RV_REG_T1, ctx);
+ }
}
}
@@ -1927,7 +1973,10 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
rs = RV_REG_T2;
}
- emit_ldx(rd, off, rs, BPF_SIZE(code), sign_ext, ctx);
+ if (is_stack_arg_ldx(insn))
+ emit_stack_arg_ldx(rd, off, ctx);
+ else
+ emit_ldx(rd, off, rs, BPF_SIZE(code), sign_ext, ctx);
ret = add_exception_handler(insn, rd, ctx);
if (ret)
@@ -1957,7 +2006,10 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
rd = RV_REG_T3;
}
- emit_st(rd, off, imm, BPF_SIZE(code), ctx);
+ if (is_stack_arg_st(insn))
+ emit_stack_arg_st(off, imm, ctx);
+ else
+ emit_st(rd, off, imm, BPF_SIZE(code), ctx);
ret = add_exception_handler(insn, REG_DONT_CLEAR_MARKER, ctx);
if (ret)
@@ -1979,7 +2031,10 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
rd = RV_REG_T2;
}
- emit_stx(rd, off, rs, BPF_SIZE(code), ctx);
+ if (is_stack_arg_stx(insn))
+ emit_stack_arg_stx(off, rs, ctx);
+ else
+ emit_stx(rd, off, rs, BPF_SIZE(code), ctx);
ret = add_exception_handler(insn, REG_DONT_CLEAR_MARKER, ctx);
if (ret)
@@ -2029,9 +2084,9 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
void bpf_jit_build_prologue(struct rv_jit_context *ctx, bool is_subprog)
{
- int i, stack_adjust = 0, store_offset, bpf_stack_adjust;
+ int i, stack_adjust = 0, store_offset, bpf_stack_adjust = ctx->stack_arg_sz;
- bpf_stack_adjust = round_up(ctx->prog->aux->stack_depth, STACK_ALIGN);
+ bpf_stack_adjust += round_up(ctx->prog->aux->stack_depth, STACK_ALIGN);
if (bpf_stack_adjust)
mark_fp(ctx);
@@ -2190,3 +2245,8 @@ bool bpf_jit_supports_timed_may_goto(void)
{
return true;
}
+
+bool bpf_jit_supports_stack_args(void)
+{
+ return true;
+}
diff --git a/arch/riscv/net/bpf_jit_core.c b/arch/riscv/net/bpf_jit_core.c
index cbfcd287ea166..2fb0b4e198b94 100644
--- a/arch/riscv/net/bpf_jit_core.c
+++ b/arch/riscv/net/bpf_jit_core.c
@@ -48,6 +48,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
int pass = 0, prev_ninsns = 0, i;
struct rv_jit_data *jit_data;
struct rv_jit_context *ctx;
+ u16 stack_arg_cnt;
if (!prog->jit_requested)
return prog;
@@ -71,6 +72,12 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
ctx->arena_vm_start = bpf_arena_get_kern_vm_start(prog->aux->arena);
ctx->user_vm_start = bpf_arena_get_user_vm_start(prog->aux->arena);
+
+ stack_arg_cnt = bpf_out_stack_arg_cnt(env, prog);
+ /* First 3 stack args in regs, rest on stack */
+ ctx->stack_arg_sz = stack_arg_cnt > RV_EXTRA_STK_ARGS ?
+ round_up((stack_arg_cnt - RV_EXTRA_STK_ARGS) * 8, STACK_ALIGN) : 0;
+
ctx->prog = prog;
ctx->offset = kvzalloc_objs(int, prog->len);
if (!ctx->offset)
diff --git a/arch/riscv/net/bpf_timed_may_goto.S b/arch/riscv/net/bpf_timed_may_goto.S
index 02c637d874205..fcf850f244c90 100644
--- a/arch/riscv/net/bpf_timed_may_goto.S
+++ b/arch/riscv/net/bpf_timed_may_goto.S
@@ -10,7 +10,7 @@
* - output: updated count in BPF_REG_AX (t0)
*
* Calls bpf_check_timed_may_goto(ptr) with the standard RISC-V ABI, where
- * ptr = BPF_REG_FP (s5) + BPF_REG_AX (t0). BPF R0-R5 (a5, a0-a4) are saved
+ * ptr = BPF_REG_FP (s5) + BPF_REG_AX (t0). BPF R0-R5 (t6, a0-a4) are saved
* across the call; BPF_REG_FP (s5) is callee-saved and needs no saving.
*/
@@ -20,8 +20,8 @@ SYM_FUNC_START(arch_bpf_timed_may_goto)
REG_S s0, 6*SZREG(sp)
addi s0, sp, 8*SZREG
- /* Save BPF registers R0-R5 (a5, a0-a4) */
- REG_S a5, 5*SZREG(sp)
+ /* Save BPF registers R0-R5 (t6, a0-a4) */
+ REG_S t6, 5*SZREG(sp)
REG_S a0, 4*SZREG(sp)
REG_S a1, 3*SZREG(sp)
REG_S a2, 2*SZREG(sp)
@@ -38,7 +38,7 @@ SYM_FUNC_START(arch_bpf_timed_may_goto)
REG_L a2, 2*SZREG(sp)
REG_L a1, 3*SZREG(sp)
REG_L a0, 4*SZREG(sp)
- REG_L a5, 5*SZREG(sp)
+ REG_L t6, 5*SZREG(sp)
REG_L s0, 6*SZREG(sp)
REG_L ra, 7*SZREG(sp)
diff --git a/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c b/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c
index 8d38aafe66a28..ab12397a9b52a 100644
--- a/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c
+++ b/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c
@@ -4,7 +4,8 @@
#include <bpf/bpf_helpers.h>
#include "../test_kmods/bpf_testmod_kfunc.h"
-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && \
+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \
+ (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) && \
defined(__BPF_FEATURE_STACK_ARGUMENT)
long subprog_call_mem_kfunc(long a, long b, long c, long d, long e, long size)
diff --git a/tools/testing/selftests/bpf/progs/btf__verifier_stack_arg_order.c b/tools/testing/selftests/bpf/progs/btf__verifier_stack_arg_order.c
index 99bc115f8380a..a980a3a399d3f 100644
--- a/tools/testing/selftests/bpf/progs/btf__verifier_stack_arg_order.c
+++ b/tools/testing/selftests/bpf/progs/btf__verifier_stack_arg_order.c
@@ -3,7 +3,8 @@
#include <vmlinux.h>
#include <bpf/bpf_helpers.h>
-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && \
+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \
+ (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) && \
defined(__BPF_FEATURE_STACK_ARGUMENT)
int subprog_bad_order_6args(int a, int b, int c, int d, int e, int f)
diff --git a/tools/testing/selftests/bpf/progs/stack_arg.c b/tools/testing/selftests/bpf/progs/stack_arg.c
index 944e3bb603e7e..3e9ed37c57bb9 100644
--- a/tools/testing/selftests/bpf/progs/stack_arg.c
+++ b/tools/testing/selftests/bpf/progs/stack_arg.c
@@ -21,7 +21,8 @@ struct {
int timer_result;
-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && \
+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \
+ (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) && \
defined(__BPF_FEATURE_STACK_ARGUMENT)
const volatile bool has_stack_arg = true;
diff --git a/tools/testing/selftests/bpf/progs/stack_arg_kfunc.c b/tools/testing/selftests/bpf/progs/stack_arg_kfunc.c
index 345f2da2e361b..b6b1a8aa7f44a 100644
--- a/tools/testing/selftests/bpf/progs/stack_arg_kfunc.c
+++ b/tools/testing/selftests/bpf/progs/stack_arg_kfunc.c
@@ -6,7 +6,8 @@
#include "bpf_kfuncs.h"
#include "../test_kmods/bpf_testmod_kfunc.h"
-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && \
+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \
+ (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) && \
defined(__BPF_FEATURE_STACK_ARGUMENT)
const volatile bool has_stack_arg = true;
diff --git a/tools/testing/selftests/bpf/progs/stack_arg_precision.c b/tools/testing/selftests/bpf/progs/stack_arg_precision.c
index ce0301a41fa94..7baa9c1c8e31e 100644
--- a/tools/testing/selftests/bpf/progs/stack_arg_precision.c
+++ b/tools/testing/selftests/bpf/progs/stack_arg_precision.c
@@ -6,7 +6,8 @@
#include "../test_kmods/bpf_testmod_kfunc.h"
#include "bpf_misc.h"
-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && \
+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \
+ (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) && \
defined(__BPF_FEATURE_STACK_ARGUMENT)
/* Force kfunc extern BTF generation for inline asm call below.
diff --git a/tools/testing/selftests/bpf/progs/verifier_jit_inline.c b/tools/testing/selftests/bpf/progs/verifier_jit_inline.c
index 02e562f56f9d3..5b92da2ab75cf 100644
--- a/tools/testing/selftests/bpf/progs/verifier_jit_inline.c
+++ b/tools/testing/selftests/bpf/progs/verifier_jit_inline.c
@@ -11,7 +11,7 @@ __jited(" addq %gs:{{.*}}, %rax")
__arch_arm64
__jited(" mrs x8, SP_EL0")
__arch_riscv64
-__jited(" mv a5, tp")
+__jited(" mv t6, tp")
__arch_loongarch
__jited(" move $a5, $tp")
int inline_bpf_get_current_task(void)
diff --git a/tools/testing/selftests/bpf/progs/verifier_ldsx.c b/tools/testing/selftests/bpf/progs/verifier_ldsx.c
index 7e25e1b8cd0b7..49e8cd4bb4f99 100644
--- a/tools/testing/selftests/bpf/progs/verifier_ldsx.c
+++ b/tools/testing/selftests/bpf/progs/verifier_ldsx.c
@@ -289,11 +289,11 @@ __jited("ldrsh x22, [x11, #0x18]")
__jited("add x11, x0, x28")
__jited("ldrsb x22, [x11, #0x20]")
__arch_riscv64
-__jited("add t2, a5, s7")
+__jited("add t2, t6, s7")
__jited("lw s3, 0x10(t2)")
-__jited("add t2, a5, s7")
+__jited("add t2, t6, s7")
__jited("lh s3, 0x18(t2)")
-__jited("add t2, a5, s7")
+__jited("add t2, t6, s7")
__jited("lb s3, 0x20(t2)")
__jited("add t2, a0, s7")
__jited("lw s4, 0x10(t2)")
diff --git a/tools/testing/selftests/bpf/progs/verifier_stack_arg.c b/tools/testing/selftests/bpf/progs/verifier_stack_arg.c
index 51d22faf4559f..f6a4a6aa0e617 100644
--- a/tools/testing/selftests/bpf/progs/verifier_stack_arg.c
+++ b/tools/testing/selftests/bpf/progs/verifier_stack_arg.c
@@ -12,7 +12,8 @@ struct {
__type(value, long long);
} map_hash_8b SEC(".maps");
-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && \
+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \
+ (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) && \
defined(__BPF_FEATURE_STACK_ARGUMENT)
__noinline __used
diff --git a/tools/testing/selftests/bpf/progs/verifier_stack_arg_order.c b/tools/testing/selftests/bpf/progs/verifier_stack_arg_order.c
index 8e4325273b3d8..57f22691744ad 100644
--- a/tools/testing/selftests/bpf/progs/verifier_stack_arg_order.c
+++ b/tools/testing/selftests/bpf/progs/verifier_stack_arg_order.c
@@ -5,7 +5,8 @@
#include <bpf/bpf_helpers.h>
#include "bpf_misc.h"
-#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && \
+#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \
+ (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) && \
defined(__BPF_FEATURE_STACK_ARGUMENT)
__noinline __used __naked
|
| 3/2 | 2026/09/06 12:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 10020 output: 109 thoughts: 1065 Thoughts: **Analysis of the Code Modification for Fuzzing Eligibility** Okay, let's break this down. The target architecture is `amd64`, so that's the key. First, a careful inspection of the diff reveals modifications across several files. It looks like we have changes in both kernel and userspace components. All of the kernel code changes fall within `arch/riscv/`, which is architecture specific, specifically for the RISC-V 64-bit architecture. The userspace modifications are grouped within `tools/testing/selftests/`. Now, we need to apply the negative criteria. The instructions specify a scenario where we should return `WorthFuzzing=false`. Section 2 outlines the conditions. Basically, we need to determine if all modifications fall into one or more of these categories: non-kernel and non-executable changes, Structurally unreachable hardware, or Unreachable execution paths. Given the prompt's target, I see a clear match. All the C/ASM kernel code is contained within `arch/riscv/`, making it exclusive to the RISC-V architecture. This code is inherently unreachable on `amd64`. Then, all other modifications exist within `tools/`, which is considered user-space selftests. Based on this, all modified code is either specific to a non-target architecture or in `tools/`, fitting the criteria. To be absolutely sure, I've confirmed that the files listed in the diff are comprehensive: `arch/riscv/net/bpf_jit.h`, `arch/riscv/net/bpf_jit_comp64.c`, `arch/riscv/net/bpf_jit_core.c`, `arch/riscv/net/bpf_timed_may_goto.S`, and a set of files under `tools/testing/selftests/bpf/progs/`. No other files were touched. So, I'm confident in the assessment. We can confidently set `WorthFuzzing=false`. I am going to call `set-results` with the following configuration: * `WorthFuzzing=false` * `FocusSymbols=null` * `EnableConfigs=null` * `Reasoning`: "The modifications are either architecture-specific (RISC-V) and unreachable on amd64, or they reside in user-space selftests (`tools/`), satisfying the negative criteria." |
| 4/2 | 2026/09/06 12:20 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "All kernel modifications in this patch series are located in arch/riscv/ (RISC-V BPF JIT implementation), which is specific to RISC-V and unreachable on the target architecture (amd64). The remaining changes are in tools/testing/selftests/ (userspace selftests). Consequently, no reachable kernel code is modified for amd64.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "All kernel modifications in this patch series are located in arch/riscv/ (RISC-V BPF JIT implementation), which is specific to RISC-V and unreachable on the target architecture (amd64). The remaining changes are in tools/testing/selftests/ (userspace selftests). Consequently, no reachable kernel code is modified for amd64.",
"WorthFuzzing": false
} |
| 5/1 | 2026/09/06 12:20 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|