Skip to content

1.7 backports#4980

Merged
kkourt merged 7 commits into
v1.7from
pr/backport/v1.7-backports-20260511
May 11, 2026
Merged

1.7 backports#4980
kkourt merged 7 commits into
v1.7from
pr/backport/v1.7-backports-20260511

Conversation

olsajiri and others added 7 commits May 11, 2026 08:45
[ upstream commit 017ff05 ]

Currently we break the resolve loop earlier than it's needed,
which might cause premature end of the resolve scan, let's
remove that.

Let's instead store the last error based on the largest resolved
depth and use this error as the final one in case of error.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
[ upstream commit 4a45a9c ]

To simplify the code a bit before following changes.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
[ upstream commit bca819f ]

Keeping the functionality and hoping to make it bit simpler.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
[ upstream commit f688229 ]

Making sure we get expected errors from ResolveBTFPath.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
[ upstream commit 54268ba ]

When unstacking a nested BTF union or anonymous struct, we fail to store the
position of the union/struct itself, only capturing the final element.
This leads to incorrect offset resolution.

To fix this, we introduce an accumulator mechanism that accumulates the
union/anonymous struct offset only when the member.name matches the expected
attribute.

Signed-off-by: Tristan d'Audibert <tdaudibe@isovalent.com>
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
[ upstream commit 531dfe3 ]

Attribute resolution for unions/anonymous struct has been broken since the Resolve
algorithm's introduction. This commit aligns with the new logic by
implementing the same accumulator mechanism, ensuring identical return
values.

Signed-off-by: Tristan d'Audibert <tdaudibe@isovalent.com>
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
[ upstream commit 91de8f4 ]

Improve the messages so that the error is more understandable.

Basic types are types that we support without resolve or are the
terminal type when doing resolve. They are the types that users
specify as an arg's type within the policy.

For dereference issues that happen during resolve, we report the depth,
or the index of the resolve configuration where the dereference failed.
This change subtracts one from the status value that is reported from
the bpf program because status 0 signifies the non-error case.

Signed-off-by: Andy Strohman <astrohma@isovalent.com>
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
@kkourt kkourt requested a review from a team as a code owner May 11, 2026 06:48
@kkourt kkourt requested review from FedeDP and removed request for a team May 11, 2026 06:48
@kkourt kkourt merged commit 5da4b73 into v1.7 May 11, 2026
48 of 49 checks passed
@kkourt kkourt deleted the pr/backport/v1.7-backports-20260511 branch May 11, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants