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

kernel-6.1: cherry-pick fix for creating kprobes using unqualified names #3699

Conversation

markusboehme
Copy link
Member

Issue number:

Closes #3691

Description of changes: Commit b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols") in the upstream kernel introduced a regression where kprobes cannot be created on functions residing in loadable modules if the probe location is identified by an unqualified function name.

The faulty commit was backported e.g. to kernel 6.1.60. The backported fix is on track to be released in kernel 6.1.71. Cherry-pick the fix until 6.1.71 is released and our upstream catches up to it.

While the faulty commit was backported to the 5.15 series as well, the backport has not hit our upstream yet. There is nothing to be done for our other kernel packages (but to be vigilant about not picking up a release with the faulty backport in the near future).

Testing done: On the host:

bash-5.2# cd /sys/kernel/debug/tracing/
bash-5.2# echo 'p nf_nat_packet' >kprobe_events 
bash-5.2# cat kprobe_events
p:kprobes/p_nf_nat_packet_0 nf_nat_packet

The probe has been successfully created even though the name is unqualified and the probed function resides in a loadable module. Creating the kprobe (line 2) previously failed during symbol lookup (see #3691).

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Commit b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols")
in the upstream kernel introduced a regression where kprobes cannot be
created on functions residing in loadable modules if the probe location
is identified by an unqualified function name.

The faulty commit was backported e.g. to kernel 6.1.60. The backported
fix is on track to be released in kernel 6.1.71. Cherry-pick the fix
until 6.1.71 is released and our upstream catches up to it.

While the faulty commit was backported to the 5.15 series as well, the
backport has not hit our upstream yet. There is nothing to be done for
our other kernel packages (but to be vigilant about not picking up a
release with the faulty backport in the near future).

Signed-off-by: Markus Boehme <markubo@amazon.com>
@markusboehme markusboehme requested review from foersleo and cbgbt January 5, 2024 14:26
Copy link
Contributor

@cbgbt cbgbt left a comment

Choose a reason for hiding this comment

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

Nice work!

@markusboehme markusboehme merged commit 147a019 into bottlerocket-os:develop Jan 5, 2024
46 checks passed
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.

datadog-agent system-probe in CrashLoopBackoff
4 participants