Commit f405718
libbpf: move arena globals to the end of the arena
Arena globals are currently placed at the beginning of the arena
by libbpf. This is convenient, but prevents users from reserving
guard pages in the beginning of the arena to identify NULL pointer
dereferences. Adjust the load logic to place the globals at the
end of the arena instead.
Also modify bpftool to set the arena pointer in the program's BPF
skeleton to point to the globals. Users now call bpf_map__initial_value()
to find the beginning of the arena mapping and use the arena pointer
in the skeleton to determine which part of the mapping holds the
arena globals and which part is free.
Suggested-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Emil Tsalapatis <[email protected]>1 parent 6032de3 commit f405718
File tree
2 files changed
+24
-7
lines changed- tools
- lib/bpf
- testing/selftests/bpf/progs
2 files changed
+24
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
| 760 | + | |
760 | 761 | | |
761 | 762 | | |
762 | 763 | | |
| |||
2991 | 2992 | | |
2992 | 2993 | | |
2993 | 2994 | | |
| 2995 | + | |
2994 | 2996 | | |
2995 | 2997 | | |
2996 | 2998 | | |
2997 | | - | |
| 2999 | + | |
2998 | 3000 | | |
2999 | 3001 | | |
3000 | 3002 | | |
| |||
3006 | 3008 | | |
3007 | 3009 | | |
3008 | 3010 | | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
3009 | 3014 | | |
3010 | 3015 | | |
3011 | 3016 | | |
| |||
4663 | 4668 | | |
4664 | 4669 | | |
4665 | 4670 | | |
4666 | | - | |
| 4671 | + | |
4667 | 4672 | | |
4668 | 4673 | | |
4669 | 4674 | | |
| |||
5624 | 5629 | | |
5625 | 5630 | | |
5626 | 5631 | | |
5627 | | - | |
| 5632 | + | |
| 5633 | + | |
5628 | 5634 | | |
5629 | 5635 | | |
5630 | 5636 | | |
| |||
14383 | 14389 | | |
14384 | 14390 | | |
14385 | 14391 | | |
| 14392 | + | |
14386 | 14393 | | |
14387 | 14394 | | |
14388 | 14395 | | |
| |||
14398 | 14405 | | |
14399 | 14406 | | |
14400 | 14407 | | |
14401 | | - | |
| 14408 | + | |
| 14409 | + | |
| 14410 | + | |
| 14411 | + | |
| 14412 | + | |
14402 | 14413 | | |
14403 | 14414 | | |
14404 | 14415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
| 38 | + | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
0 commit comments