Skip to contentSkip to conversation

bpf: Fix BPF_PROG_ASSOC_STRUCT_OPS last field check

PATCH Applied Thiébaud Weksteen 4 participants 4 messages Jun 18 – Jun 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

Fixes b5709f6d26d6 ("bpf: Support associating BPF program with struct_ops")
---
 kernel/bpf/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/syscall.c +1 -1
index 630d530782fe..eb52ba57ffd5 100644
@@ -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.flags
 
 static int prog_assoc_struct_ops(union bpf_attr *attr)
 {
Signature · 1 line
2.54.0.1189.g8c84645362-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Thiébaud Weksteen

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.

Fixes b5709f6d26d6 ("bpf: Support associating BPF program with struct_ops")

---

You need to indicate which tree the patch should go to [1]. bpf tree in this case since this is a fix.

[1] https://docs.kernel.org/bpf/bpf_devel_QA.html#q-how-do-i-indicate-which-tree-bpf-vs-bpf-next-my-patch-should-be-applied-to

reviewer Acked-by on v1 1/1
#2 lore raw
In reply to Thiébaud Weksteen
Quoted 6 lines · Thiébaud Weksteen

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.

Fixes b5709f6d26d6 ("bpf: Support associating BPF program with struct_ops")

I think the target should be bpf tree ([PATCH bpf] ...).

#3 lore raw
In reply to Thiébaud Weksteen
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_ops was added, BPF_PROG_ASSOC_STRUCT_OPS_LAST_FIELD referenced prog_fd instead of the actual last field, flags.

Fixes b5709f6d26d6 ("bpf: Support associating BPF program with struct_ops")

[...]

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