Commit 3d562d3
bpf: Check global subprog exception paths
Global subprogs are verified independently and are not descended into
when their callers are symbolically executed. This means a caller can
hold references or locks across a global subprog call that may throw,
while the verifier only checks the non-exceptional return path at the
call site.
Record whether a subprog might throw in the CFG summary pass, alongside
the existing might_sleep and packet-data-changing summaries, and
propagate that effect through reachable callees.
When a global subprog is marked as possibly throwing, push the normal
continuation and validate the exceptional path immediately at the call
site, avoiding a synthetic exception state and associated special case
in the pruning checks.
Fixes: f18b03f ("bpf: Implement BPF exceptions")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20260517075530.3461166-2-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent a828abb commit 3d562d3
3 files changed
Lines changed: 31 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
| 732 | + | |
732 | 733 | | |
733 | 734 | | |
734 | 735 | | |
| |||
1308 | 1309 | | |
1309 | 1310 | | |
1310 | 1311 | | |
| 1312 | + | |
1311 | 1313 | | |
1312 | 1314 | | |
1313 | 1315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
71 | | - | |
| 79 | + | |
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
| |||
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
| 89 | + | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
| |||
509 | 518 | | |
510 | 519 | | |
511 | 520 | | |
| 521 | + | |
| 522 | + | |
512 | 523 | | |
513 | 524 | | |
514 | 525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
446 | 445 | | |
447 | 446 | | |
448 | 447 | | |
| |||
5405 | 5404 | | |
5406 | 5405 | | |
5407 | 5406 | | |
5408 | | - | |
| 5407 | + | |
5409 | 5408 | | |
5410 | 5409 | | |
5411 | 5410 | | |
| |||
9499 | 9498 | | |
9500 | 9499 | | |
9501 | 9500 | | |
| 9501 | + | |
| 9502 | + | |
| 9503 | + | |
9502 | 9504 | | |
9503 | 9505 | | |
9504 | 9506 | | |
| |||
9552 | 9554 | | |
9553 | 9555 | | |
9554 | 9556 | | |
| 9557 | + | |
| 9558 | + | |
| 9559 | + | |
| 9560 | + | |
| 9561 | + | |
| 9562 | + | |
| 9563 | + | |
| 9564 | + | |
| 9565 | + | |
| 9566 | + | |
| 9567 | + | |
9555 | 9568 | | |
9556 | 9569 | | |
9557 | 9570 | | |
| |||
11782 | 11795 | | |
11783 | 11796 | | |
11784 | 11797 | | |
11785 | | - | |
| 11798 | + | |
11786 | 11799 | | |
11787 | 11800 | | |
11788 | 11801 | | |
| |||
12972 | 12985 | | |
12973 | 12986 | | |
12974 | 12987 | | |
12975 | | - | |
12976 | | - | |
12977 | 12988 | | |
12978 | 12989 | | |
12979 | 12990 | | |
| |||
13354 | 13365 | | |
13355 | 13366 | | |
13356 | 13367 | | |
13357 | | - | |
| 13368 | + | |
13358 | 13369 | | |
13359 | 13370 | | |
13360 | 13371 | | |
| |||
0 commit comments