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

Fix duplicate /proc/<pid>/root prefix bug that formed wrong path to libssl.so files. #1740

Merged

Conversation

etep
Copy link

@etep etep commented Oct 16, 2023

Summary: Fixes a bug that prevented SSL tracing on dynamically loaded SSL libraries. When probing open ssl libs found from a pod's mapped libraries, we erroneously prefixed library paths with /proc/<pid>/root twice, i.e. such that a target library might look like this:

/proc/<pid>/root/proc/<pid>/root/<path>/some-lib.so

Normal target processes run in their own pid namespace. This meant that the second instance of <pid> in the path above would not exist in the target process namespace. Hence probing dynamic libraries using this path failed.

We also update the open-ssl test case to not use host pid namespace, i.e. such that those tests expose this bug. Previously, this bug was masked in those test cases because the test container processes ran with host pid namespace.

Related issues: #1736.

Type of change: /kind bug fix.

Test Plan: Show that tests fail when we disable use of host pid namespace in SSL test containers, see #1744.

Changelog Message:

Fixed a bug that prevented SSL tracing on dynamically linked SSL libraries. 

Signed-off-by: Pete Stevenson <jps@pixielabs.ai>
@etep etep marked this pull request as draft October 16, 2023 23:39
Pete Stevenson added 2 commits October 17, 2023 12:00
Signed-off-by: Pete Stevenson <jps@pixielabs.ai>
Signed-off-by: Pete Stevenson <jps@pixielabs.ai>
@etep etep changed the title Maybe fix libssl proc pid path issue. Fix duplicate /proc/<pid>/root prefix bug that prevented us from finding libssl.so files. Oct 17, 2023
Signed-off-by: Pete Stevenson <jps@pixielabs.ai>
@etep etep marked this pull request as ready for review October 17, 2023 21:47
@etep etep requested review from ddelnano and a team October 17, 2023 21:47
@etep etep changed the title Fix duplicate /proc/<pid>/root prefix bug that prevented us from finding libssl.so files. Fix duplicate /proc/<pid>/root prefix bug that formed wrong path to libssl.so files. Oct 17, 2023
Copy link
Member

@ddelnano ddelnano left a comment

Choose a reason for hiding this comment

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

@etep thanks for tracking this down and fixing the issue.

I think we should include a Changelog Message: in the PR explaining that a bug was fixed that prevented dynamically linked OpenSSL tracing from working. In addition to that, can you update the Title: to match the PR's.

@JamesMBartlett JamesMBartlett merged commit 1cd1ac5 into pixie-io:main Nov 2, 2023
31 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.

3 participants