Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/gadgets: Fixes trace bind for kernel 6.6 and younger. #2545

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

eiffel-fl
Copy link
Member

In kernel 6.6, the bitfields in struct inet_sock where moved to a dedicated flag [1, 2, 3, 4].
To adapt to this change, a CO-RE solution was proposed in iovisor/bcc for bindsnoop 5.
This is a good solution, as it will work on kernel backporting the patches.

This commit adapts the bindsnoop solution to Inspektor Gadget.

@eiffel-fl eiffel-fl linked an issue Feb 27, 2024 that may be closed by this pull request
In kernel 6.6, the bitfields in struct inet_sock where moved to a dedicated flag
[1, 2, 3, 4].
To adapt to this change, a CO-RE solution was proposed in iovisor/bcc for
bindsnoop [5].
This is a good solution, as it will work on kernel backporting the patches.

This commit adapts the bindsnoop solution to Inspektor Gadget.

Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
[1]: https://lore.kernel.org/all/20230816081547.1272409-1-edumazet@google.com/
[2]: torvalds/linux@3f7e753206bb
[3]: torvalds/linux@ca571e2eb7eb
[4]: torvalds/linux@4bd0623f04ee
[5]: iovisor/bcc@a55b5a0c920f
Copy link
Member

@mauriciovasquezbernal mauriciovasquezbernal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix.

(Are you going to fix the u8 vs u16 issue upstream too? I can do it otherwise if you want).

@eiffel-fl
Copy link
Member Author

LGTM, thanks for the fix.

Thank you for the review!

(Are you going to fix the u8 vs u16 issue upstream too? I can do it otherwise if you want).

What do you mean by u8 vs u16? This problem does not exist upstream as they do not use macros:
iovisor/bcc@a55b5a0

@mauriciovasquezbernal
Copy link
Member

What do you mean by u8 vs u16? This problem does not exist upstream as they do not use macros:
iovisor/bcc@a55b5a0

Ah, I thought they also have this issue. Nothing to be done then.

@eiffel-fl eiffel-fl merged commit 812a86d into main Mar 11, 2024
59 checks passed
@eiffel-fl eiffel-fl deleted the francis/trace-bind-6.6 branch March 11, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

trace bind broken on kernel v6.6+
2 participants