Skip to content

Commit

Permalink
selftests/bpf: add another gso_segs access
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and Alexei Starovoitov committed Jul 23, 2019
1 parent 06a22d8 commit be69483
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/testing/selftests/bpf/verifier/ctx_skb.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,17 @@
.result = ACCEPT,
.prog_type = BPF_PROG_TYPE_CGROUP_SKB,
},
{
"read gso_segs from CGROUP_SKB",
.insns = {
BPF_LDX_MEM(BPF_W, BPF_REG_1, BPF_REG_1,
offsetof(struct __sk_buff, gso_segs)),
BPF_MOV64_IMM(BPF_REG_0, 0),
BPF_EXIT_INSN(),
},
.result = ACCEPT,
.prog_type = BPF_PROG_TYPE_CGROUP_SKB,
},
{
"write gso_segs from CGROUP_SKB",
.insns = {
Expand Down

0 comments on commit be69483

Please sign in to comment.