Skip to content

bpf: Add seccomp program type

Hengqi Chen bpf 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6bpf: Introduce BPF_PROG_TYPE_SECCOMPinclude/linux/bpf_types.h include/uapi/linux/bpf.h kernel/seccomp.c +2 more+62 -06 replies
2/6bpf: Add test_run support for seccomp program typeinclude/linux/bpf.h kernel/seccomp.c net/bpf/test_run.c+31 -01 reply
3/6seccomp: Refactor filter copy/create for reusekernel/seccomp.c+35 -150 replies
4/6seccomp: Support attaching BPF_PROG_TYPE_SECCOMP progsinclude/linux/seccomp.h include/uapi/linux/seccomp.h kernel/seccomp.c+39 -30 replies
5/6selftests/bpf: Add seccomp verifier teststools/testing/selftests/bpf/prog_tests/verifier.c tools/testing/selftests/bpf/progs/verifier_seccomp.c+156 -00 replies
6/6selftests/bpf: Test BPF_PROG_TYPE_SECCOMPtools/include/uapi/linux/bpf.h tools/include/uapi/linux/seccomp.h tools/testing/selftests/bpf/prog_tests/seccomp.c +1 more+67 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH bpf-next 0/6] bpf: Add seccomp program type

This patchset introduces seccomp program type which can be used to attach to the existing seccomp framework.

The motivation is to enable sharing of seccomp filter through bpf prog fd and bpffs. With this in place, we can eliminate a hot path of JITing cBPF program (seccomp filter) where we apply the same seccomp filter to thousands of micro VMs on a bare metal instance.

This also allows us to write seccomp filter in an intuitive way, see selftests for reference.

Hengqi Chen (6):
bpf: Introduce BPF_PROG_TYPE_SECCOMP
bpf: Add test_run support for seccomp program type
seccomp: Refactor filter copy/create for reuse
seccomp: Support attaching BPF_PROG_TYPE_SECCOMP progs selftests/bpf: Add seccomp verifier tests selftests/bpf: Test BPF_PROG_TYPE_SECCOMP

 include/linux/bpf.h                           |   3 +
 include/linux/bpf_types.h                     |   4 +
 include/linux/seccomp.h                       |   3 +-
 include/uapi/linux/bpf.h                      |   1 +
 include/uapi/linux/seccomp.h                  |   2 +
 kernel/seccomp.c                              | 142 ++++++++++++++--
 net/bpf/test_run.c                            |  27 +++
 tools/include/uapi/linux/bpf.h                |   1 +
 tools/include/uapi/linux/seccomp.h            |   2 +
 tools/lib/bpf/libbpf.c                        |   2 +
 tools/lib/bpf/libbpf_probes.c                 |   1 +
 .../selftests/bpf/prog_tests/seccomp.c        |  40 +++++
 .../selftests/bpf/prog_tests/verifier.c       |   2 +
 .../selftests/bpf/progs/test_seccomp.c        |  24 +++
 .../selftests/bpf/progs/verifier_seccomp.c    | 154 ++++++++++++++++++
 15 files changed, 390 insertions(+), 18 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/seccomp.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_seccomp.c
 create mode 100644 tools/testing/selftests/bpf/progs/verifier_seccomp.c
Signature · 1 line
2.34.1