rootfs: handle github.com/moby/sys/mountinfo deficiency#2655
Closed
cyphar wants to merge 2 commits intoopencontainers:masterfrom
cyphar:fixup-proc-nopivot-masking
Closed
rootfs: handle github.com/moby/sys/mountinfo deficiency#2655cyphar wants to merge 2 commits intoopencontainers:masterfrom cyphar:fixup-proc-nopivot-masking
cyphar wants to merge 2 commits intoopencontainers:masterfrom
cyphar:fixup-proc-nopivot-masking
Conversation
github.com/moby/sys/mountinfo doesn't fill the Root field of mountinfo.Info when calling filter functions, meaning that the change in commit b8bf572 ("rootfs: handle nested procfs mounts for MS_MOVE") regressed the security hardening. While this is being fixed upstream in [1], just remove this info.Root optimisation because the ENOENT check is actually sufficient to fix the original issue. [1]: moby/sys#50 Reported-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
For preventing regression like #2647 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
AkihiroSuda
approved these changes
Oct 21, 2020
kolyshkin
reviewed
Oct 21, 2020
|
|
||
| runc run --no-pivot test_no_pivot | ||
| [ "$status" -eq 1 ] | ||
| [[ ${lines[*]} == *"mount: permission denied"* ]] |
Contributor
There was a problem hiding this comment.
nit:
Suggested change
| [[ ${lines[*]} == *"mount: permission denied"* ]] | |
| [[ "$output" == *"mount: permission denied"* ]] |
kolyshkin
requested changes
Oct 21, 2020
Contributor
kolyshkin
left a comment
There was a problem hiding this comment.
a nit in the test case, otherwise lgtm
Member
|
closing as suggsted in #2657 (comment) |
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.
github.com/moby/sys/mountinfo doesn't fill the Root field of
mountinfo.Info when calling filter functions, meaning that the change in
commit b8bf572 ("rootfs: handle nested procfs mounts for MS_MOVE")
regressed the security hardening.
While this is being fixed upstream in 1, just remove this info.Root
optimisation because the ENOENT check is actually sufficient to fix the
original issue.
Closes #2654
Reported-by: Akihiro Suda akihiro.suda.cz@hco.ntt.co.jp
Signed-off-by: Aleksa Sarai cyphar@cyphar.com