]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: add tests for direct packet access from CGROUP_SKB
authorSong Liu <songliubraving@fb.com>
Fri, 19 Oct 2018 16:57:58 +0000 (09:57 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 19 Oct 2018 20:49:34 +0000 (13:49 -0700)
commit2cb494a36c98279c5c6ce8e99cf9776f15449ade
treec8a67095d219b652a8eea067188bff6c599e6881
parentb39b5f411dcfce28ff954e5d6acb2c11be3cb0ec
bpf: add tests for direct packet access from CGROUP_SKB

Tests are added to make sure CGROUP_SKB cannot access:
  tc_classid, data_meta, flow_keys

and can read and write:
  mark, prority, and cb[0-4]

and can read other fields.

To make selftest with skb->sk work, a dummy sk is added in
bpf_prog_test_run_skb().

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/bpf/test_run.c
tools/testing/selftests/bpf/test_verifier.c