diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2017-12-01 05:25:11 -0500 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2017-12-01 05:25:11 -0500 |
commit | 554b36bffbfba7fc38d1b2b1848f5b88ed853baf (patch) | |
tree | fb72eabc6915ecece7843ce258b2266d9dfd61d3 /tools | |
parent | 51de082570e5374d4578cb159738485ddb0fddfe (diff) | |
parent | 6a28b446b7d2d5455080d5b772c50b99859d6cf5 (diff) |
Merge branch 'bpf-verifier-misc-improvements'
Alexei Starovoitov says:
====================
Small set of verifier improvements and cleanups which is
necessary for bigger patch set of bpf-to-bpf calls coming later.
See individual patches for details.
Tested on x86 and arm64 hw.
====================
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/test_align.c | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/tools/testing/selftests/bpf/test_align.c b/tools/testing/selftests/bpf/test_align.c index 8591c89c0828..fe916d29e166 100644 --- a/tools/testing/selftests/bpf/test_align.c +++ b/tools/testing/selftests/bpf/test_align.c | |||
@@ -64,11 +64,11 @@ static struct bpf_align_test tests[] = { | |||
64 | .matches = { | 64 | .matches = { |
65 | {1, "R1=ctx(id=0,off=0,imm=0)"}, | 65 | {1, "R1=ctx(id=0,off=0,imm=0)"}, |
66 | {1, "R10=fp0"}, | 66 | {1, "R10=fp0"}, |
67 | {1, "R3=inv2"}, | 67 | {1, "R3_w=inv2"}, |
68 | {2, "R3=inv4"}, | 68 | {2, "R3_w=inv4"}, |
69 | {3, "R3=inv8"}, | 69 | {3, "R3_w=inv8"}, |
70 | {4, "R3=inv16"}, | 70 | {4, "R3_w=inv16"}, |
71 | {5, "R3=inv32"}, | 71 | {5, "R3_w=inv32"}, |
72 | }, | 72 | }, |
73 | }, | 73 | }, |
74 | { | 74 | { |
@@ -92,17 +92,17 @@ static struct bpf_align_test tests[] = { | |||
92 | .matches = { | 92 | .matches = { |
93 | {1, "R1=ctx(id=0,off=0,imm=0)"}, | 93 | {1, "R1=ctx(id=0,off=0,imm=0)"}, |
94 | {1, "R10=fp0"}, | 94 | {1, "R10=fp0"}, |
95 | {1, "R3=inv1"}, | 95 | {1, "R3_w=inv1"}, |
96 | {2, "R3=inv2"}, | 96 | {2, "R3_w=inv2"}, |
97 | {3, "R3=inv4"}, | 97 | {3, "R3_w=inv4"}, |
98 | {4, "R3=inv8"}, | 98 | {4, "R3_w=inv8"}, |
99 | {5, "R3=inv16"}, | 99 | {5, "R3_w=inv16"}, |
100 | {6, "R3=inv1"}, | 100 | {6, "R3_w=inv1"}, |
101 | {7, "R4=inv32"}, | 101 | {7, "R4_w=inv32"}, |
102 | {8, "R4=inv16"}, | 102 | {8, "R4_w=inv16"}, |
103 | {9, "R4=inv8"}, | 103 | {9, "R4_w=inv8"}, |
104 | {10, "R4=inv4"}, | 104 | {10, "R4_w=inv4"}, |
105 | {11, "R4=inv2"}, | 105 | {11, "R4_w=inv2"}, |
106 | }, | 106 | }, |
107 | }, | 107 | }, |
108 | { | 108 | { |
@@ -121,12 +121,12 @@ static struct bpf_align_test tests[] = { | |||
121 | .matches = { | 121 | .matches = { |
122 | {1, "R1=ctx(id=0,off=0,imm=0)"}, | 122 | {1, "R1=ctx(id=0,off=0,imm=0)"}, |
123 | {1, "R10=fp0"}, | 123 | {1, "R10=fp0"}, |
124 | {1, "R3=inv4"}, | 124 | {1, "R3_w=inv4"}, |
125 | {2, "R3=inv8"}, | 125 | {2, "R3_w=inv8"}, |
126 | {3, "R3=inv10"}, | 126 | {3, "R3_w=inv10"}, |
127 | {4, "R4=inv8"}, | 127 | {4, "R4_w=inv8"}, |
128 | {5, "R4=inv12"}, | 128 | {5, "R4_w=inv12"}, |
129 | {6, "R4=inv14"}, | 129 | {6, "R4_w=inv14"}, |
130 | }, | 130 | }, |
131 | }, | 131 | }, |
132 | { | 132 | { |
@@ -143,10 +143,10 @@ static struct bpf_align_test tests[] = { | |||
143 | .matches = { | 143 | .matches = { |
144 | {1, "R1=ctx(id=0,off=0,imm=0)"}, | 144 | {1, "R1=ctx(id=0,off=0,imm=0)"}, |
145 | {1, "R10=fp0"}, | 145 | {1, "R10=fp0"}, |
146 | {1, "R3=inv7"}, | 146 | {1, "R3_w=inv7"}, |
147 | {2, "R3=inv7"}, | 147 | {2, "R3_w=inv7"}, |
148 | {3, "R3=inv14"}, | 148 | {3, "R3_w=inv14"}, |
149 | {4, "R3=inv56"}, | 149 | {4, "R3_w=inv56"}, |
150 | }, | 150 | }, |
151 | }, | 151 | }, |
152 | 152 | ||
@@ -185,18 +185,18 @@ static struct bpf_align_test tests[] = { | |||
185 | .prog_type = BPF_PROG_TYPE_SCHED_CLS, | 185 | .prog_type = BPF_PROG_TYPE_SCHED_CLS, |
186 | .matches = { | 186 | .matches = { |
187 | {7, "R0=pkt(id=0,off=8,r=8,imm=0)"}, | 187 | {7, "R0=pkt(id=0,off=8,r=8,imm=0)"}, |
188 | {7, "R3=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, | 188 | {7, "R3_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, |
189 | {8, "R3=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"}, | 189 | {8, "R3_w=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"}, |
190 | {9, "R3=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 190 | {9, "R3_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
191 | {10, "R3=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"}, | 191 | {10, "R3_w=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"}, |
192 | {11, "R3=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"}, | 192 | {11, "R3_w=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"}, |
193 | {18, "R3=pkt_end(id=0,off=0,imm=0)"}, | 193 | {18, "R3=pkt_end(id=0,off=0,imm=0)"}, |
194 | {18, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, | 194 | {18, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, |
195 | {19, "R4=inv(id=0,umax_value=8160,var_off=(0x0; 0x1fe0))"}, | 195 | {19, "R4_w=inv(id=0,umax_value=8160,var_off=(0x0; 0x1fe0))"}, |
196 | {20, "R4=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"}, | 196 | {20, "R4_w=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"}, |
197 | {21, "R4=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"}, | 197 | {21, "R4_w=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"}, |
198 | {22, "R4=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 198 | {22, "R4_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
199 | {23, "R4=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"}, | 199 | {23, "R4_w=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"}, |
200 | }, | 200 | }, |
201 | }, | 201 | }, |
202 | { | 202 | { |
@@ -217,16 +217,16 @@ static struct bpf_align_test tests[] = { | |||
217 | }, | 217 | }, |
218 | .prog_type = BPF_PROG_TYPE_SCHED_CLS, | 218 | .prog_type = BPF_PROG_TYPE_SCHED_CLS, |
219 | .matches = { | 219 | .matches = { |
220 | {7, "R3=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, | 220 | {7, "R3_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, |
221 | {8, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, | 221 | {8, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, |
222 | {9, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, | 222 | {9, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, |
223 | {10, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, | 223 | {10, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, |
224 | {11, "R4=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"}, | 224 | {11, "R4_w=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"}, |
225 | {12, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, | 225 | {12, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, |
226 | {13, "R4=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 226 | {13, "R4_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
227 | {14, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, | 227 | {14, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, |
228 | {15, "R4=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"}, | 228 | {15, "R4_w=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"}, |
229 | {16, "R4=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"}, | 229 | {16, "R4_w=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"}, |
230 | }, | 230 | }, |
231 | }, | 231 | }, |
232 | { | 232 | { |
@@ -257,14 +257,14 @@ static struct bpf_align_test tests[] = { | |||
257 | }, | 257 | }, |
258 | .prog_type = BPF_PROG_TYPE_SCHED_CLS, | 258 | .prog_type = BPF_PROG_TYPE_SCHED_CLS, |
259 | .matches = { | 259 | .matches = { |
260 | {4, "R5=pkt(id=0,off=0,r=0,imm=0)"}, | 260 | {4, "R5_w=pkt(id=0,off=0,r=0,imm=0)"}, |
261 | {5, "R5=pkt(id=0,off=14,r=0,imm=0)"}, | 261 | {5, "R5_w=pkt(id=0,off=14,r=0,imm=0)"}, |
262 | {6, "R4=pkt(id=0,off=14,r=0,imm=0)"}, | 262 | {6, "R4_w=pkt(id=0,off=14,r=0,imm=0)"}, |
263 | {10, "R2=pkt(id=0,off=0,r=18,imm=0)"}, | 263 | {10, "R2=pkt(id=0,off=0,r=18,imm=0)"}, |
264 | {10, "R5=pkt(id=0,off=14,r=18,imm=0)"}, | 264 | {10, "R5=pkt(id=0,off=14,r=18,imm=0)"}, |
265 | {10, "R4=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, | 265 | {10, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"}, |
266 | {14, "R4=inv(id=0,umax_value=65535,var_off=(0x0; 0xffff))"}, | 266 | {14, "R4_w=inv(id=0,umax_value=65535,var_off=(0x0; 0xffff))"}, |
267 | {15, "R4=inv(id=0,umax_value=65535,var_off=(0x0; 0xffff))"}, | 267 | {15, "R4_w=inv(id=0,umax_value=65535,var_off=(0x0; 0xffff))"}, |
268 | }, | 268 | }, |
269 | }, | 269 | }, |
270 | { | 270 | { |
@@ -320,11 +320,11 @@ static struct bpf_align_test tests[] = { | |||
320 | * alignment of 4. | 320 | * alignment of 4. |
321 | */ | 321 | */ |
322 | {8, "R2=pkt(id=0,off=0,r=8,imm=0)"}, | 322 | {8, "R2=pkt(id=0,off=0,r=8,imm=0)"}, |
323 | {8, "R6=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 323 | {8, "R6_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
324 | /* Offset is added to packet pointer R5, resulting in | 324 | /* Offset is added to packet pointer R5, resulting in |
325 | * known fixed offset, and variable offset from R6. | 325 | * known fixed offset, and variable offset from R6. |
326 | */ | 326 | */ |
327 | {11, "R5=pkt(id=1,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 327 | {11, "R5_w=pkt(id=1,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
328 | /* At the time the word size load is performed from R5, | 328 | /* At the time the word size load is performed from R5, |
329 | * it's total offset is NET_IP_ALIGN + reg->off (0) + | 329 | * it's total offset is NET_IP_ALIGN + reg->off (0) + |
330 | * reg->aux_off (14) which is 16. Then the variable | 330 | * reg->aux_off (14) which is 16. Then the variable |
@@ -336,11 +336,11 @@ static struct bpf_align_test tests[] = { | |||
336 | /* Variable offset is added to R5 packet pointer, | 336 | /* Variable offset is added to R5 packet pointer, |
337 | * resulting in auxiliary alignment of 4. | 337 | * resulting in auxiliary alignment of 4. |
338 | */ | 338 | */ |
339 | {18, "R5=pkt(id=2,off=0,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 339 | {18, "R5_w=pkt(id=2,off=0,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
340 | /* Constant offset is added to R5, resulting in | 340 | /* Constant offset is added to R5, resulting in |
341 | * reg->off of 14. | 341 | * reg->off of 14. |
342 | */ | 342 | */ |
343 | {19, "R5=pkt(id=2,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 343 | {19, "R5_w=pkt(id=2,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
344 | /* At the time the word size load is performed from R5, | 344 | /* At the time the word size load is performed from R5, |
345 | * its total fixed offset is NET_IP_ALIGN + reg->off | 345 | * its total fixed offset is NET_IP_ALIGN + reg->off |
346 | * (14) which is 16. Then the variable offset is 4-byte | 346 | * (14) which is 16. Then the variable offset is 4-byte |
@@ -352,18 +352,18 @@ static struct bpf_align_test tests[] = { | |||
352 | /* Constant offset is added to R5 packet pointer, | 352 | /* Constant offset is added to R5 packet pointer, |
353 | * resulting in reg->off value of 14. | 353 | * resulting in reg->off value of 14. |
354 | */ | 354 | */ |
355 | {26, "R5=pkt(id=0,off=14,r=8"}, | 355 | {26, "R5_w=pkt(id=0,off=14,r=8"}, |
356 | /* Variable offset is added to R5, resulting in a | 356 | /* Variable offset is added to R5, resulting in a |
357 | * variable offset of (4n). | 357 | * variable offset of (4n). |
358 | */ | 358 | */ |
359 | {27, "R5=pkt(id=3,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 359 | {27, "R5_w=pkt(id=3,off=14,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
360 | /* Constant is added to R5 again, setting reg->off to 18. */ | 360 | /* Constant is added to R5 again, setting reg->off to 18. */ |
361 | {28, "R5=pkt(id=3,off=18,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 361 | {28, "R5_w=pkt(id=3,off=18,r=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
362 | /* And once more we add a variable; resulting var_off | 362 | /* And once more we add a variable; resulting var_off |
363 | * is still (4n), fixed offset is not changed. | 363 | * is still (4n), fixed offset is not changed. |
364 | * Also, we create a new reg->id. | 364 | * Also, we create a new reg->id. |
365 | */ | 365 | */ |
366 | {29, "R5=pkt(id=4,off=18,r=0,umax_value=2040,var_off=(0x0; 0x7fc))"}, | 366 | {29, "R5_w=pkt(id=4,off=18,r=0,umax_value=2040,var_off=(0x0; 0x7fc))"}, |
367 | /* At the time the word size load is performed from R5, | 367 | /* At the time the word size load is performed from R5, |
368 | * its total fixed offset is NET_IP_ALIGN + reg->off (18) | 368 | * its total fixed offset is NET_IP_ALIGN + reg->off (18) |
369 | * which is 20. Then the variable offset is (4n), so | 369 | * which is 20. Then the variable offset is (4n), so |
@@ -410,11 +410,11 @@ static struct bpf_align_test tests[] = { | |||
410 | * alignment of 4. | 410 | * alignment of 4. |
411 | */ | 411 | */ |
412 | {8, "R2=pkt(id=0,off=0,r=8,imm=0)"}, | 412 | {8, "R2=pkt(id=0,off=0,r=8,imm=0)"}, |
413 | {8, "R6=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 413 | {8, "R6_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
414 | /* Adding 14 makes R6 be (4n+2) */ | 414 | /* Adding 14 makes R6 be (4n+2) */ |
415 | {9, "R6=inv(id=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, | 415 | {9, "R6_w=inv(id=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, |
416 | /* Packet pointer has (4n+2) offset */ | 416 | /* Packet pointer has (4n+2) offset */ |
417 | {11, "R5=pkt(id=1,off=0,r=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, | 417 | {11, "R5_w=pkt(id=1,off=0,r=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, |
418 | {13, "R4=pkt(id=1,off=4,r=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, | 418 | {13, "R4=pkt(id=1,off=4,r=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, |
419 | /* At the time the word size load is performed from R5, | 419 | /* At the time the word size load is performed from R5, |
420 | * its total fixed offset is NET_IP_ALIGN + reg->off (0) | 420 | * its total fixed offset is NET_IP_ALIGN + reg->off (0) |
@@ -426,11 +426,11 @@ static struct bpf_align_test tests[] = { | |||
426 | /* Newly read value in R6 was shifted left by 2, so has | 426 | /* Newly read value in R6 was shifted left by 2, so has |
427 | * known alignment of 4. | 427 | * known alignment of 4. |
428 | */ | 428 | */ |
429 | {18, "R6=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 429 | {18, "R6_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
430 | /* Added (4n) to packet pointer's (4n+2) var_off, giving | 430 | /* Added (4n) to packet pointer's (4n+2) var_off, giving |
431 | * another (4n+2). | 431 | * another (4n+2). |
432 | */ | 432 | */ |
433 | {19, "R5=pkt(id=2,off=0,r=0,umin_value=14,umax_value=2054,var_off=(0x2; 0xffc))"}, | 433 | {19, "R5_w=pkt(id=2,off=0,r=0,umin_value=14,umax_value=2054,var_off=(0x2; 0xffc))"}, |
434 | {21, "R4=pkt(id=2,off=4,r=0,umin_value=14,umax_value=2054,var_off=(0x2; 0xffc))"}, | 434 | {21, "R4=pkt(id=2,off=4,r=0,umin_value=14,umax_value=2054,var_off=(0x2; 0xffc))"}, |
435 | /* At the time the word size load is performed from R5, | 435 | /* At the time the word size load is performed from R5, |
436 | * its total fixed offset is NET_IP_ALIGN + reg->off (0) | 436 | * its total fixed offset is NET_IP_ALIGN + reg->off (0) |
@@ -473,11 +473,11 @@ static struct bpf_align_test tests[] = { | |||
473 | .prog_type = BPF_PROG_TYPE_SCHED_CLS, | 473 | .prog_type = BPF_PROG_TYPE_SCHED_CLS, |
474 | .result = REJECT, | 474 | .result = REJECT, |
475 | .matches = { | 475 | .matches = { |
476 | {4, "R5=pkt(id=0,off=0,r=0,imm=0)"}, | 476 | {4, "R5_w=pkt(id=0,off=0,r=0,imm=0)"}, |
477 | /* ptr & 0x40 == either 0 or 0x40 */ | 477 | /* ptr & 0x40 == either 0 or 0x40 */ |
478 | {5, "R5=inv(id=0,umax_value=64,var_off=(0x0; 0x40))"}, | 478 | {5, "R5_w=inv(id=0,umax_value=64,var_off=(0x0; 0x40))"}, |
479 | /* ptr << 2 == unknown, (4n) */ | 479 | /* ptr << 2 == unknown, (4n) */ |
480 | {7, "R5=inv(id=0,smax_value=9223372036854775804,umax_value=18446744073709551612,var_off=(0x0; 0xfffffffffffffffc))"}, | 480 | {7, "R5_w=inv(id=0,smax_value=9223372036854775804,umax_value=18446744073709551612,var_off=(0x0; 0xfffffffffffffffc))"}, |
481 | /* (4n) + 14 == (4n+2). We blow our bounds, because | 481 | /* (4n) + 14 == (4n+2). We blow our bounds, because |
482 | * the add could overflow. | 482 | * the add could overflow. |
483 | */ | 483 | */ |
@@ -485,7 +485,7 @@ static struct bpf_align_test tests[] = { | |||
485 | /* Checked s>=0 */ | 485 | /* Checked s>=0 */ |
486 | {10, "R5=inv(id=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"}, | 486 | {10, "R5=inv(id=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"}, |
487 | /* packet pointer + nonnegative (4n+2) */ | 487 | /* packet pointer + nonnegative (4n+2) */ |
488 | {12, "R6=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"}, | 488 | {12, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"}, |
489 | {14, "R4=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"}, | 489 | {14, "R4=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc))"}, |
490 | /* NET_IP_ALIGN + (4n+2) == (4n), alignment is fine. | 490 | /* NET_IP_ALIGN + (4n+2) == (4n), alignment is fine. |
491 | * We checked the bounds, but it might have been able | 491 | * We checked the bounds, but it might have been able |
@@ -530,11 +530,11 @@ static struct bpf_align_test tests[] = { | |||
530 | * alignment of 4. | 530 | * alignment of 4. |
531 | */ | 531 | */ |
532 | {7, "R2=pkt(id=0,off=0,r=8,imm=0)"}, | 532 | {7, "R2=pkt(id=0,off=0,r=8,imm=0)"}, |
533 | {9, "R6=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 533 | {9, "R6_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
534 | /* Adding 14 makes R6 be (4n+2) */ | 534 | /* Adding 14 makes R6 be (4n+2) */ |
535 | {10, "R6=inv(id=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, | 535 | {10, "R6_w=inv(id=0,umin_value=14,umax_value=1034,var_off=(0x2; 0x7fc))"}, |
536 | /* New unknown value in R7 is (4n) */ | 536 | /* New unknown value in R7 is (4n) */ |
537 | {11, "R7=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, | 537 | {11, "R7_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"}, |
538 | /* Subtracting it from R6 blows our unsigned bounds */ | 538 | /* Subtracting it from R6 blows our unsigned bounds */ |
539 | {12, "R6=inv(id=0,smin_value=-1006,smax_value=1034,var_off=(0x2; 0xfffffffffffffffc))"}, | 539 | {12, "R6=inv(id=0,smin_value=-1006,smax_value=1034,var_off=(0x2; 0xfffffffffffffffc))"}, |
540 | /* Checked s>= 0 */ | 540 | /* Checked s>= 0 */ |
@@ -583,15 +583,15 @@ static struct bpf_align_test tests[] = { | |||
583 | * alignment of 4. | 583 | * alignment of 4. |
584 | */ | 584 | */ |
585 | {7, "R2=pkt(id=0,off=0,r=8,imm=0)"}, | 585 | {7, "R2=pkt(id=0,off=0,r=8,imm=0)"}, |
586 | {10, "R6=inv(id=0,umax_value=60,var_off=(0x0; 0x3c))"}, | 586 | {10, "R6_w=inv(id=0,umax_value=60,var_off=(0x0; 0x3c))"}, |
587 | /* Adding 14 makes R6 be (4n+2) */ | 587 | /* Adding 14 makes R6 be (4n+2) */ |
588 | {11, "R6=inv(id=0,umin_value=14,umax_value=74,var_off=(0x2; 0x7c))"}, | 588 | {11, "R6_w=inv(id=0,umin_value=14,umax_value=74,var_off=(0x2; 0x7c))"}, |
589 | /* Subtracting from packet pointer overflows ubounds */ | 589 | /* Subtracting from packet pointer overflows ubounds */ |
590 | {13, "R5=pkt(id=1,off=0,r=8,umin_value=18446744073709551542,umax_value=18446744073709551602,var_off=(0xffffffffffffff82; 0x7c))"}, | 590 | {13, "R5_w=pkt(id=1,off=0,r=8,umin_value=18446744073709551542,umax_value=18446744073709551602,var_off=(0xffffffffffffff82; 0x7c))"}, |
591 | /* New unknown value in R7 is (4n), >= 76 */ | 591 | /* New unknown value in R7 is (4n), >= 76 */ |
592 | {15, "R7=inv(id=0,umin_value=76,umax_value=1096,var_off=(0x0; 0x7fc))"}, | 592 | {15, "R7_w=inv(id=0,umin_value=76,umax_value=1096,var_off=(0x0; 0x7fc))"}, |
593 | /* Adding it to packet pointer gives nice bounds again */ | 593 | /* Adding it to packet pointer gives nice bounds again */ |
594 | {16, "R5=pkt(id=2,off=0,r=0,umin_value=2,umax_value=1082,var_off=(0x2; 0x7fc))"}, | 594 | {16, "R5_w=pkt(id=2,off=0,r=0,umin_value=2,umax_value=1082,var_off=(0x2; 0x7fc))"}, |
595 | /* At the time the word size load is performed from R5, | 595 | /* At the time the word size load is performed from R5, |
596 | * its total fixed offset is NET_IP_ALIGN + reg->off (0) | 596 | * its total fixed offset is NET_IP_ALIGN + reg->off (0) |
597 | * which is 2. Then the variable offset is (4n+2), so | 597 | * which is 2. Then the variable offset is (4n+2), so |