Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be69483b authored by Eric Dumazet's avatar Eric Dumazet Committed by Alexei Starovoitov
Browse files

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: default avatarEric Dumazet <edumazet@google.com>
Suggested-by: default avatarStanislav Fomichev <sdf@google.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 06a22d89
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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 = {