|
6 | 6 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1),
|
7 | 7 | BPF_EXIT_INSN(),
|
8 | 8 | },
|
9 |
| - .result = REJECT, |
| 9 | + .errstr_unpriv = "R0 tried to sub from different maps, paths, or prohibited types", |
10 | 10 | .errstr = "R0 tried to subtract pointer from scalar",
|
| 11 | + .result = REJECT, |
11 | 12 | },
|
12 | 13 | {
|
13 | 14 | "check deducing bounds from const, 2",
|
|
20 | 21 | BPF_ALU64_REG(BPF_SUB, BPF_REG_1, BPF_REG_0),
|
21 | 22 | BPF_EXIT_INSN(),
|
22 | 23 | },
|
| 24 | + .errstr_unpriv = "R1 tried to sub from different maps, paths, or prohibited types", |
| 25 | + .result_unpriv = REJECT, |
23 | 26 | .result = ACCEPT,
|
24 | 27 | .retval = 1,
|
25 | 28 | },
|
|
31 | 34 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1),
|
32 | 35 | BPF_EXIT_INSN(),
|
33 | 36 | },
|
34 |
| - .result = REJECT, |
| 37 | + .errstr_unpriv = "R0 tried to sub from different maps, paths, or prohibited types", |
35 | 38 | .errstr = "R0 tried to subtract pointer from scalar",
|
| 39 | + .result = REJECT, |
36 | 40 | },
|
37 | 41 | {
|
38 | 42 | "check deducing bounds from const, 4",
|
|
45 | 49 | BPF_ALU64_REG(BPF_SUB, BPF_REG_1, BPF_REG_0),
|
46 | 50 | BPF_EXIT_INSN(),
|
47 | 51 | },
|
| 52 | + .errstr_unpriv = "R1 tried to sub from different maps, paths, or prohibited types", |
| 53 | + .result_unpriv = REJECT, |
48 | 54 | .result = ACCEPT,
|
49 | 55 | },
|
50 | 56 | {
|
|
55 | 61 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1),
|
56 | 62 | BPF_EXIT_INSN(),
|
57 | 63 | },
|
58 |
| - .result = REJECT, |
| 64 | + .errstr_unpriv = "R0 tried to sub from different maps, paths, or prohibited types", |
59 | 65 | .errstr = "R0 tried to subtract pointer from scalar",
|
| 66 | + .result = REJECT, |
60 | 67 | },
|
61 | 68 | {
|
62 | 69 | "check deducing bounds from const, 6",
|
|
67 | 74 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1),
|
68 | 75 | BPF_EXIT_INSN(),
|
69 | 76 | },
|
70 |
| - .result = REJECT, |
| 77 | + .errstr_unpriv = "R0 tried to sub from different maps, paths, or prohibited types", |
71 | 78 | .errstr = "R0 tried to subtract pointer from scalar",
|
| 79 | + .result = REJECT, |
72 | 80 | },
|
73 | 81 | {
|
74 | 82 | "check deducing bounds from const, 7",
|
|
80 | 88 | offsetof(struct __sk_buff, mark)),
|
81 | 89 | BPF_EXIT_INSN(),
|
82 | 90 | },
|
83 |
| - .result = REJECT, |
| 91 | + .errstr_unpriv = "R1 tried to sub from different maps, paths, or prohibited types", |
84 | 92 | .errstr = "dereference of modified ctx ptr",
|
| 93 | + .result = REJECT, |
85 | 94 | .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS,
|
86 | 95 | },
|
87 | 96 | {
|
|
94 | 103 | offsetof(struct __sk_buff, mark)),
|
95 | 104 | BPF_EXIT_INSN(),
|
96 | 105 | },
|
97 |
| - .result = REJECT, |
| 106 | + .errstr_unpriv = "R1 tried to add from different maps, paths, or prohibited types", |
98 | 107 | .errstr = "dereference of modified ctx ptr",
|
| 108 | + .result = REJECT, |
99 | 109 | .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS,
|
100 | 110 | },
|
101 | 111 | {
|
|
106 | 116 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1),
|
107 | 117 | BPF_EXIT_INSN(),
|
108 | 118 | },
|
109 |
| - .result = REJECT, |
| 119 | + .errstr_unpriv = "R0 tried to sub from different maps, paths, or prohibited types", |
110 | 120 | .errstr = "R0 tried to subtract pointer from scalar",
|
| 121 | + .result = REJECT, |
111 | 122 | },
|
112 | 123 | {
|
113 | 124 | "check deducing bounds from const, 10",
|
|
119 | 130 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1),
|
120 | 131 | BPF_EXIT_INSN(),
|
121 | 132 | },
|
122 |
| - .result = REJECT, |
123 | 133 | .errstr = "math between ctx pointer and register with unbounded min value is not allowed",
|
| 134 | + .result = REJECT, |
124 | 135 | },
|
0 commit comments