]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bpf: Fix BPF_PROG_ASSOC_STRUCT_OPS last field check
authorThiébaud Weksteen <tweek@google.com>
Thu, 18 Jun 2026 04:09:33 +0000 (14:09 +1000)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 22 Jun 2026 01:09:07 +0000 (18:09 -0700)
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")
Signed-off-by: Thiébaud Weksteen <tweek@google.com>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20260618040934.4113938-1-tweek@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/syscall.c

index b44106c8ea750048575c8f4ec644e61309acb2da..6db306d23b479fda606813fb6598a8f61a0ce504 100644 (file)
@@ -6308,7 +6308,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)
 {