summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-07-23 06:15:38 -0400
committerAlexei Starovoitov <ast@kernel.org>2019-07-23 17:12:37 -0400
commitbe69483bf4f3abaaca5d5ba460dbb50239463552 (patch)
tree1aaff1884ece785915c25780bd7d2f5666c5e941 /tools
parent06a22d897d82f12776d44dbf0850f5895469cb2a (diff)
selftests/bpf: add another gso_segs access
Use BPF_REG_1 for source and destination of gso_segs read, to exercise "bpf: fix access to skb_shared_info->gso_segs" fix. Signed-off-by: Eric Dumazet <edumazet@google.com> Suggested-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/verifier/ctx_skb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/verifier/ctx_skb.c b/tools/testing/selftests/bpf/verifier/ctx_skb.c
index b0fda2877119..d438193804b2 100644
--- a/tools/testing/selftests/bpf/verifier/ctx_skb.c
+++ b/tools/testing/selftests/bpf/verifier/ctx_skb.c
@@ -975,6 +975,17 @@
975 .prog_type = BPF_PROG_TYPE_CGROUP_SKB, 975 .prog_type = BPF_PROG_TYPE_CGROUP_SKB,
976}, 976},
977{ 977{
978 "read gso_segs from CGROUP_SKB",
979 .insns = {
980 BPF_LDX_MEM(BPF_W, BPF_REG_1, BPF_REG_1,
981 offsetof(struct __sk_buff, gso_segs)),
982 BPF_MOV64_IMM(BPF_REG_0, 0),
983 BPF_EXIT_INSN(),
984 },
985 .result = ACCEPT,
986 .prog_type = BPF_PROG_TYPE_CGROUP_SKB,
987},
988{
978 "write gso_segs from CGROUP_SKB", 989 "write gso_segs from CGROUP_SKB",
979 .insns = { 990 .insns = {
980 BPF_MOV64_IMM(BPF_REG_0, 0), 991 BPF_MOV64_IMM(BPF_REG_0, 0),