Skip to content

[master] forward-port security fixes from 20.10.9 - #42907

Merged
thaJeztah merged 2 commits into
moby:masterfrom
thaJeztah:master_forward_port_security_fixes
Oct 14, 2021
Merged

thaJeztah merged 2 commits into
moby:masterfrom
thaJeztah:master_forward_port_security_fixes

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

This cherry-picks the security fixes from the v20.10.9 release:

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

cpuguy83 and others added 2 commits October 5, 2021 09:57
Do not use 0701 perms.
0701 dir perms allows anyone to traverse the docker dir.
It happens to allow any user to execute, as an example, suid binaries
from image rootfs dirs because it allows traversal AND critically
container users need to be able to do execute things.

0701 on lower directories also happens to allow any user to modify
     things in, for instance, the overlay upper dir which neccessarily
     has 0755 permissions.

This changes to use 0710 which allows users in the group to traverse.
In userns mode the UID owner is (real) root and the GID is the remapped
root's GID.

This prevents anyone but the remapped root to traverse our directories
(which is required for userns with runc).

Signed-off-by: Brian Goff <[email protected]>
(cherry picked from commit ef7237442147441a7cadcda0600be1186d81ac73)
Signed-off-by: Brian Goff <[email protected]>
(cherry picked from commit 93ac040)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
If chroot is used with a special root directory then create
destination directory within chroot. This works automatically
already due to extractor creating parent paths and is only
used currently with cp where parent paths are actually required
and error will be shown to user before reaching this point.

Signed-off-by: Tonis Tiigi <[email protected]>
(cherry picked from commit 52d285184068998c22632bfb869f6294b5613a58)
Signed-off-by: Brian Goff <[email protected]>
(cherry picked from commit 80f1169)
Signed-off-by: Sebastiaan van Stijn <[email protected]>

@samuelkarp samuelkarp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@samuelkarp

Copy link
Copy Markdown
Member

Test failures are #42892 and #42917

@thaJeztah
thaJeztah merged commit ba16293 into moby:master Oct 14, 2021
@thaJeztah
thaJeztah deleted the master_forward_port_security_fixes branch October 14, 2021 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants