Commit 518584c
bpf: Bump maximum runtime call stack depth to 16
The BPF verifier currently limits the maximum runtime call stack to
8 frames. Larger BPF programs like sched-ext schedulers routinely
fail verification because they exceed this limit, even as they use
very little actual stack space for each frame.
Bump the maximum runtime call stack depth to 16 stack frames. Also
adjust selftests that assume the max runtime call stack depth is 8.
This patch does not change the verification time limit of 8 stack
frames. Static functions that are inlined for verification purposes
still only go 8 frames deep to avoid changing the verifier's internal
data structures used for verification. These data structures only
support holding information on up to 8 stack frames.
Global functions are each verified in isolation, so the old 8 stack
frame limit now only applies to call stacks composed entirely of
static function calls.
This patch also does not adjust the actual maximum stack size of 512.
CHANGELOG
=========
v1 -> v2 (https://lore.kernel.org/bpf/DG510ANGXEZH.BJ9EMMKHP5WT@etsalapatis.com)
- Adjust patch to only increase the runtime stack depth, leaving the
verification-time stack depth unchanged (Alexei)
Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>1 parent b0043d3 commit 518584c
File tree
3 files changed
+78
-17
lines changed- include/linux
- kernel/bpf
- tools/testing/selftests/bpf/progs
3 files changed
+78
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
| 324 | + | |
| 325 | + | |
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6660 | 6660 | | |
6661 | 6661 | | |
6662 | 6662 | | |
6663 | | - | |
| 6663 | + | |
6664 | 6664 | | |
6665 | 6665 | | |
6666 | 6666 | | |
6667 | 6667 | | |
6668 | 6668 | | |
6669 | 6669 | | |
6670 | | - | |
| 6670 | + | |
6671 | 6671 | | |
6672 | | - | |
6673 | | - | |
| 6672 | + | |
| 6673 | + | |
6674 | 6674 | | |
6675 | 6675 | | |
6676 | 6676 | | |
| |||
6724 | 6724 | | |
6725 | 6725 | | |
6726 | 6726 | | |
6727 | | - | |
| 6727 | + | |
6728 | 6728 | | |
6729 | 6729 | | |
6730 | 6730 | | |
| |||
6740 | 6740 | | |
6741 | 6741 | | |
6742 | 6742 | | |
6743 | | - | |
| 6743 | + | |
6744 | 6744 | | |
6745 | 6745 | | |
6746 | 6746 | | |
| |||
6757 | 6757 | | |
6758 | 6758 | | |
6759 | 6759 | | |
6760 | | - | |
6761 | | - | |
| 6760 | + | |
| 6761 | + | |
6762 | 6762 | | |
6763 | 6763 | | |
6764 | 6764 | | |
| |||
6786 | 6786 | | |
6787 | 6787 | | |
6788 | 6788 | | |
6789 | | - | |
| 6789 | + | |
| 6790 | + | |
| 6791 | + | |
| 6792 | + | |
| 6793 | + | |
| 6794 | + | |
| 6795 | + | |
| 6796 | + | |
| 6797 | + | |
| 6798 | + | |
| 6799 | + | |
6790 | 6800 | | |
6791 | 6801 | | |
6792 | 6802 | | |
| |||
6800 | 6810 | | |
6801 | 6811 | | |
6802 | 6812 | | |
6803 | | - | |
| 6813 | + | |
6804 | 6814 | | |
6805 | 6815 | | |
6806 | 6816 | | |
| |||
6813 | 6823 | | |
6814 | 6824 | | |
6815 | 6825 | | |
6816 | | - | |
| 6826 | + | |
6817 | 6827 | | |
6818 | 6828 | | |
6819 | 6829 | | |
6820 | | - | |
6821 | | - | |
6822 | | - | |
| 6830 | + | |
| 6831 | + | |
| 6832 | + | |
| 6833 | + | |
| 6834 | + | |
6823 | 6835 | | |
6824 | 6836 | | |
6825 | 6837 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
56 | 104 | | |
57 | | - | |
| 105 | + | |
58 | 106 | | |
59 | 107 | | |
60 | | - | |
| 108 | + | |
61 | 109 | | |
0 commit comments