Merged
Conversation
This was
linked to
issues
Jan 31, 2026
On certain devices (specifically observed on Android 12, arm32), the previous method of transferring the mount namespace failed with: `open mount namespace path [/proc/xxx/fd/y] failed with 13: Permission denied`. This commit refactors the namespace transfer mechanism to use direct File Descriptor passing via Unix domain sockets (SCM_RIGHTS). Changes: - Replaced the protocol: The daemon now sends a status byte followed immediately by the FD using `send_fd`, rather than sending the PID and raw FD integer. - The client no longer constructs a `/proc/...` string or calls `open()`. It receives the FD directly and passes it to `setns()`. - Added a status byte check to the protocol to prevent stream desynchronization when the namespace is not cached.
Needed on Android 12, kernel 3.4.113
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On some device (Android 12, arm 32 bit), the mount namespace transfer could fail due to permission denial.
We should thus implement a fallback mechanism of namespace transfer.