Skip to content

Commit

Permalink
features: Fix test TestHaveProgramType/Extension in kernel >=v6.8
Browse files Browse the repository at this point in the history
In kernel v6.8, logic was added that restricts valid func info BTF for
programs that can be replaced with an BPF_PROG_TYPE_EXT program.
Before this change the parameters of the extension program had to be
the same as the original program.

Commit torvalds/linux@5eccd2db42d77e357 made
it so the verifier asserts that the BTF func info of "main" programs
must have exactly 1 parameter of a pointer type to the context struct,
even if the code doesn't use the context like in our case.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
  • Loading branch information
dylandreimerink committed Apr 26, 2024
1 parent 9c1d099 commit ebb52db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions features/prog.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ var haveProgramTypeMatrix = internal.FeatureMatrix[ebpf.ProgramType]{
Name: "a",
Type: &btf.FuncProto{
Return: &btf.Int{},
Params: []btf.FuncParam{
{Name: "ctx", Type: &btf.Pointer{Target: &btf.Struct{Name: "xdp_md"}}},
},
},
Linkage: btf.GlobalFunc,
}
Expand Down

0 comments on commit ebb52db

Please sign in to comment.