Skip to content

Validate whether process belongs to the container's NetNS - #70

Open
naoki9911 wants to merge 1 commit into
rootless-containers:masterfrom
naoki9911:nested-netns
Open

naoki9911 wants to merge 1 commit into
rootless-containers:masterfrom
naoki9911:nested-netns

Conversation

@naoki9911

Copy link
Copy Markdown
Collaborator

bypass4netns handles all sockets in the container NetNS.
However, in the nested NetNS environment, it wrongly bypasses sockets in the nested NetNS.
It causes the following issues.
#65
#66

This patch makes bypass4netns ignore any sockets created in non-container NetNS including nested ones.

ignores any sockets created in non-container NetNS including nested one.

Signed-off-by: Naoki MATSUMOTO <naoki@pibvt.net>
@AkihiroSuda

Copy link
Copy Markdown
Member

Thank you, but this still does not seem to fix:

I also wonder if this PR disables the entire acceleration for connect(2)?

@AkihiroSuda

Copy link
Copy Markdown
Member

For #65, this seems to work as a workaround

@naoki9911

naoki9911 commented Apr 8, 2024

Copy link
Copy Markdown
Collaborator Author

this still does not seem to fix

Thanks, the issue seems to stem from other reasons.
I'm going to investigate this issue with Usernetes environment.

this PR disables the entire acceleration for connect(2)?

Yes, this disables entire acceleration including connect(2) and bind(2) with processes in nested NetNS.
Enabling acceleration in nested NetNS can cause unexpected communication, and it actually allows processes to communicate with external endpoints without creating veth or configuring IP masquerade in nested NetNS.
We need to consider whether this behavior is acceptable or not.

@AkihiroSuda

Copy link
Copy Markdown
Member

At least connect() to the Internet should still be accelerated even with nested netns.
--ignore-bind (#68) with ignore-list seems to work.
Let me know if we can safely merge #68.

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.

2 participants