bpf: Fix BPF_PROG_ASSOC_STRUCT_OPS last field check
PATCH 1/1 bpf: Fix BPF_PROG_ASSOC_STRUCT_OPS last field check
When struct prog_assoc_struct_ops was added, BPF_PROG_ASSOC_STRUCT_OPS_LAST_FIELD referenced prog_fd instead of the actual last field, flags.
--- kernel/bpf/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/syscall.c +1 -1
@@ -6189,7 +6189,7 @@ static int prog_stream_read(union bpf_attr *attr)return ret; } -#define BPF_PROG_ASSOC_STRUCT_OPS_LAST_FIELD prog_assoc_struct_ops.prog_fd +#define BPF_PROG_ASSOC_STRUCT_OPS_LAST_FIELD prog_assoc_struct_ops.flagsstatic int prog_assoc_struct_ops (union bpf_attr *attr) {
Signature · 1 line
2.54.0.1189.g8c84645362-goog
Quoted 7 lines · Thiébaud Weksteen
When struct
prog_assoc_struct_opswas added,BPF_PROG_ASSOC_STRUCT_OPS_LAST_FIELDreferencedprog_fdinstead of the actual last field, flags.Fixes b5709f6d26d6 ("bpf: Support associating BPF program with struct_ops")Signed-off-by Thiébaud Weksteen <[email protected]>---
You need to indicate which tree the patch should go to [1]. bpf tree in this case since this is a fix.
Quoted 6 lines · Thiébaud Weksteen
When struct
prog_assoc_struct_opswas added,BPF_PROG_ASSOC_STRUCT_OPS_LAST_FIELDreferencedprog_fdinstead of the actual last field, flags.Fixes b5709f6d26d6 ("bpf: Support associating BPF program with struct_ops")Signed-off-by Thiébaud Weksteen <[email protected]>
I think the target should be bpf tree ([PATCH bpf] ...).
This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <[email protected]>:
Quoted 8 lines · On Thu, 18 Jun 2026 14:09:33 +1000 you wrote:
When struct
prog_assoc_struct_opswas added,BPF_PROG_ASSOC_STRUCT_OPS_LAST_FIELDreferencedprog_fdinstead of the actual last field, flags.Fixes b5709f6d26d6 ("bpf: Support associating BPF program with struct_ops")Signed-off-by Thiébaud Weksteen <[email protected]>[...]
Here is the summary with links:
- bpf: Fix BPF_PROG_ASSOC_STRUCT_OPS last field check
https://git.kernel.org/bpf/bpf/c/8405c4626460
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html