Skip to content

bpf: Add BPF_PROG_TYPE_CGROUP_SKB attach type enforcement in BPF_LINK_CREATE

Stanislav Fomichev bpf netdev 1 version Applied

Status from this message: This series was applied to bpf/bpf.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: Add BPF_PROG_TYPE_CGROUP_SKB attach type enforcement in BPF_LINK_CREATEkernel/bpf/syscall.c+5 -02 repliesApplied
2/3selftests/bpf: Extend sockopt tests to use BPF_LINK_CREATEtools/testing/selftests/bpf/prog_tests/sockopt.c+19 -61 replyApplied
3/3selftests/bpf: Add sockopt case to verify prog_typetools/testing/selftests/bpf/prog_tests/sockopt.c+38 -21 replyApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchEduard Zingerman
1/3A-b
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH bpf 0/3] bpf: Add BPF_PROG_TYPE_CGROUP_SKB attach type enforcement in BPF_LINK_CREATE

Syzkaller found a case where it's possible to attach cgroup_skb program to the sockopt hooks. Apparently it's currently possible to do that, but only when using BPF_LINK_CREATE API. The first patch in the series has more info on why that happens.

Stanislav Fomichev (3):
bpf: Add BPF_PROG_TYPE_CGROUP_SKB attach type enforcement in
BPF_LINK_CREATE
selftests/bpf: Extend sockopt tests to use BPF_LINK_CREATE selftests/bpf: Add sockopt case to verify prog_type

 kernel/bpf/syscall.c                          |  5 ++
 .../selftests/bpf/prog_tests/sockopt.c        | 65 ++++++++++++++++---
 2 files changed, 62 insertions(+), 8 deletions(-)
Signature · 1 line
2.44.0.769.g3c40516874-goog