summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/verifier/basic_stx_ldx.c
blob: 7a0aab3f2cd2dd015971a801b99e8664e1512712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
	"invalid src register in STX",
	.insns = {
	BPF_STX_MEM(BPF_B, BPF_REG_10, -1, -1),
	BPF_EXIT_INSN(),
	},
	.errstr = "R15 is invalid",
	.result = REJECT,
},
{
	"invalid dst register in STX",
	.insns = {
	BPF_STX_MEM(BPF_B, 14, BPF_REG_10, -1),
	BPF_EXIT_INSN(),
	},
	.errstr = "R14 is invalid",
	.result = REJECT,
},
{
	"invalid dst register in ST",
	.insns = {
	BPF_ST_MEM(BPF_B, 14, -1, -1),
	BPF_EXIT_INSN(),
	},
	.errstr = "R14 is invalid",
	.result = REJECT,
},
{
	"invalid src register in LDX",
	.insns = {
	BPF_LDX_MEM(BPF_B, BPF_REG_0, 12, 0),
	BPF_EXIT_INSN(),
	},
	.errstr = "R12 is invalid",
	.result = REJECT,
},
{
	"invalid dst register in LDX",
	.insns = {
	BPF_LDX_MEM(BPF_B, 11, BPF_REG_1, 0),
	BPF_EXIT_INSN(),
	},
	.errstr = "R11 is invalid",
	.result = REJECT,
},