Commit 402aae5
committed
Fix "BPF program too large" error in kernel release 6.4 and greater
Fixes #1880, which
contains more details, but the summary is that this commit and greater
prevent our code to load.
```
Author: Eduard Zingerman <eddyz87@gmail.com>
Date: Tue Jun 13 18:38:23 2023 +0300
bpf: Verify scalar ids mapping in regsafe() using check_ids()
```
I am not super sure of all the effects of that commit above, but it
seems that perhaps the verifier is accounting for more execution paths,
increasing the number of instructions that's analysing, making it go
over the threshold.
This is remediated by reducing the number of instructions we have per
program. Before we packed as many iterations of the main loop as we
could, which now we have to reduce.
A possible side-effect is that for very large stacks we'll have to run
more tail-calls, which while they are cheap, they aren't zero-cost.
There might be some other performance implications, but we need to make
this change for newer kernels, so let's benchmark this later on, but I
don't expect the performance impact to be huge.
Test Plan
=========
Compiled a custom kernel 6.4.7 off 4e382c2b468348d6208e5a18dbf1591a18170889 [0]
and run our cpu tests without any issues, while before we were seeing
a failure.
[0]: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.4.7
Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>1 parent 6ae314e commit 402aae5
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments