Use new --disable-userns bubblewrap feature when possible#5084
Merged
smcv merged 2 commits intoflatpak:mainfrom Mar 24, 2023
Merged
Use new --disable-userns bubblewrap feature when possible#5084smcv merged 2 commits intoflatpak:mainfrom
smcv merged 2 commits intoflatpak:mainfrom
Conversation
smcv
requested changes
Sep 6, 2022
d087ed2 to
b2d3cd6
Compare
531c843 to
e5c7e25
Compare
Collaborator
|
Note to self for testing uninstalled: |
smcv
added a commit
to smcv/flatpak
that referenced
this pull request
Dec 16, 2022
Our seccomp filtering necessarily adds overhead to each system call, which is undesirable for syscall-heavy workloads like graphically intensive games. This is currently incomplete. It depends on flatpak#5084, but also needs solutions to: - preventing ioctl TIOCSTI (CVE-2017-5226): at the moment this is done in a relatively crude way via bwrap --new-session - preventing access to the kernel keyring (see also flatpak#4281): at the moment this is unsolved Resolves: flatpak#4187 Signed-off-by: Simon McVittie <[email protected]>
Member
Author
|
I merged the bwrap code now, so we should try to get this in. |
Member
Author
|
Other than the rebase to a released bwrap this PR looks good to me now |
Collaborator
Great, please could you review containers/bubblewrap#545 if you have a chance? I think that one is a bwrap release blocker. |
Member
Author
|
merged that too |
smcv
added a commit
to smcv/flatpak
that referenced
this pull request
Feb 27, 2023
* Improve error message if seccomp is disabled in kernel config * Add --disable-userns option (needed for flatpak#5084) * Add --assert-userns-disabled option (needed for flatpak#5084) Signed-off-by: Simon McVittie <[email protected]>
e5c7e25 to
676f49b
Compare
676f49b to
8da10e9
Compare
smcv
approved these changes
Feb 27, 2023
Collaborator
smcv
left a comment
There was a problem hiding this comment.
I'm happy with this if other maintainers are. (@alexlarsson? @mwleeds?)
8da10e9 to
dbfbad9
Compare
smcv
added a commit
to smcv/flatpak
that referenced
this pull request
Feb 27, 2023
Our seccomp filtering necessarily adds overhead to each system call, which is undesirable for syscall-heavy workloads like graphically intensive games. This is currently incomplete. It depends on flatpak#5084, but also needs solutions to: - preventing ioctl TIOCSTI (CVE-2017-5226): at the moment this is done in a relatively crude way via bwrap --new-session - preventing access to the kernel keyring (see also flatpak#4281): at the moment this is unsolved Resolves: flatpak#4187 Signed-off-by: Simon McVittie <[email protected]>
smcv
added a commit
to smcv/flatpak
that referenced
this pull request
Mar 20, 2023
* Improve error message if seccomp is disabled in kernel config * Add --disable-userns option (needed for flatpak#5084) * Add --assert-userns-disabled option (needed for flatpak#5084) Signed-off-by: Simon McVittie <[email protected]>
smcv
added a commit
that referenced
this pull request
Mar 20, 2023
* Improve error message if seccomp is disabled in kernel config * Add --disable-userns option (needed for #5084) * Add --assert-userns-disabled option (needed for #5084) Signed-off-by: Simon McVittie <[email protected]>
dbfbad9 to
94005b1
Compare
This lets us use its new features unconditionally. Signed-off-by: Simon McVittie <[email protected]>
This feature (added in containers/bubblewrap#488) allows us to improve the guarantees of disallowing the sandbox to use recursive user namespaces (which is a security risk) compared to the existing limits that use seccomp. [smcv: Move this to flatpak_run_setup_base_argv() so it will apply equally in apply_extra_data() and `flatpak build`; make the compile-time check for a setuid bwrap into a runtime check] Co-authored-by: Simon McVittie <[email protected]> Signed-off-by: Simon McVittie <[email protected]>
94005b1 to
81a2ef8
Compare
Collaborator
|
Last chance for anyone to object to this, otherwise I'll merge after CI finishes. |
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.
[This now depends on #5325. —smcv]
build: Require bubblewrap 0.8.0
From: smcv
This lets us use its new features unconditionally.
Use new --disable-userns bubblewrap feature when possible
From: alexlarsson
This feature (added in Add an option to disable nested user namespaces by setting limit to 1 containers/bubblewrap#488)
allows us to improve the guarantees of disallowing the sandbox to use
recursive user namespaces (which is a security risk) compared to the
existing limits that use seccomp.
[smcv: Move this to flatpak_run_setup_base_argv() so it will apply
equally in apply_extra_data() and
flatpak build; make the compile-timecheck for a setuid bwrap into a runtime check]
Co-authored-by: smcv