• Andrey Ignatov's avatar
    selftests/bpf: Test BPF_CGROUP_SYSCTL · 1f5fa9ab
    Andrey Ignatov authored
    Add unit test for BPF_PROG_TYPE_CGROUP_SYSCTL program type.
    
    Test that program can allow/deny access.
    Test both valid and invalid accesses to ctx->write.
    
    Example of output:
      # ./test_sysctl
      Test case: sysctl wrong attach_type .. [PASS]
      Test case: sysctl:read allow all .. [PASS]
      Test case: sysctl:read deny all .. [PASS]
      Test case: ctx:write sysctl:read read ok .. [PASS]
      Test case: ctx:write sysctl:write read ok .. [PASS]
      Test case: ctx:write sysctl:read write reject .. [PASS]
      Summary: 6 PASSED, 0 FAILED
    Signed-off-by: default avatarAndrey Ignatov <rdna@fb.com>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    1f5fa9ab
Makefile 7.81 KB