Conversation
Otherwise we need read permission on every path component from the root to the mount point. This isn't available if we are mounting onto the `$TMPDIR` created by `pam_tmpdir` or `pam_mktemp`, which create a root-owned directory with `a+x` but not `a+r` permission, and then a per-uid directory inside that. Fixes: c77dd38 "setup: Use O_PATH fds and disalllow symlink targest" Resolves: containers#806 Resolves: ValveSoftware/steam-runtime#855 Signed-off-by: Simon McVittie <smcv@collabora.com>
In this case it has no functional effect, because we close these fds with `cleanup_fd` before exec'ing anything (either within this function or in its only caller), but it's good to get into a habit of making all fds be close-on-exec except for the few that we specifically want to allow child processes to inherit. Signed-off-by: Simon McVittie <smcv@collabora.com>
Contributor
|
The changes look good to me, I cannot approve formally because I am not a reviewer of this PR. |
Collaborator
Author
|
I'll merge this based on my colleague @ao2's review if there's no response from other maintainers for a while. (I suspect that in practice this mainly affects the Steam Runtime, in which we use a local build of bubblewrap and have cherry-picked these changes.) |
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.
Use O_PATH when opening parent directories
Otherwise we need read permission on every path component from the root
to the mount point. This isn't available if we are mounting onto the
$TMPDIRcreated bypam_tmpdirorpam_mktemp, which create aroot-owned directory with
a+xbut nota+rpermission, and then aper-uid directory inside that.
Resolves: 0.12.0 regression?: Can't bind-mount a directory whose parent is unreadable #806
Resolves: Regression in latest SLR betas and steamrt3c Steam Client if using pam_tmpdir or pam_mktemp ValveSoftware/steam-runtime#855
Also add O_CLOEXEC while I'm changing these lines already
In this case it has no functional effect, because we close these fds
with
cleanup_fdbefore exec'ing anything (either within this functionor in its only caller), but it's good to get into a habit of making
all fds be close-on-exec except for the few that we specifically want
to allow child processes to inherit.
cc @ao2