Commit 99992b1
bpf: Save pruning point states in oracle
This patch saves information on the verifier states, at each pruning
point, into bpf_insn_aux_data, for use by the BPF oracle. The verifier
is already saving states into explored_states for state pruning, but we
can't reuse it for the oracle.
For state pruning, we only save a subset of all states at each pruning
point. Specifically, we will only save a new state if we've seen at
least 8 instructions and 2 BPF_JMPs since we last saved a state. For the
oracle, we will use the saved information to ensure that concrete values
match at least one verifier state. If we are missing states, we will
have false positives.
This patch therefore saves information on verifier states at every
pruning point, regardless of existing heuristics. A later patch will
limit this behavior to CONFIG_BPF_ORACLE.
At the moment, the oracle only saves information on the type and ranges
(in case of scalars) of registers. No information is kept for stack
slots. More checks can be added later.
Signed-off-by: Paul Chaignon <[email protected]>1 parent 6ba2fc1 commit 99992b1
File tree
4 files changed
+103
-7
lines changed- include/linux
- kernel/bpf
4 files changed
+103
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
488 | 512 | | |
489 | 513 | | |
490 | 514 | | |
| |||
551 | 575 | | |
552 | 576 | | |
553 | 577 | | |
| 578 | + | |
554 | 579 | | |
555 | 580 | | |
556 | 581 | | |
| |||
1060 | 1085 | | |
1061 | 1086 | | |
1062 | 1087 | | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1063 | 1093 | | |
1064 | 1094 | | |
1065 | 1095 | | |
1066 | 1096 | | |
1067 | 1097 | | |
| 1098 | + | |
| 1099 | + | |
1068 | 1100 | | |
1069 | 1101 | | |
1070 | 1102 | | |
| |||
1087 | 1119 | | |
1088 | 1120 | | |
1089 | 1121 | | |
| 1122 | + | |
| 1123 | + | |
1090 | 1124 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| |||
11398 | 11398 | | |
11399 | 11399 | | |
11400 | 11400 | | |
11401 | | - | |
11402 | | - | |
11403 | | - | |
11404 | | - | |
11405 | | - | |
11406 | 11401 | | |
11407 | 11402 | | |
11408 | 11403 | | |
| |||
20508 | 20503 | | |
20509 | 20504 | | |
20510 | 20505 | | |
| 20506 | + | |
| 20507 | + | |
| 20508 | + | |
| 20509 | + | |
20511 | 20510 | | |
20512 | 20511 | | |
20513 | 20512 | | |
| |||
0 commit comments