-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] New DMZ solution to defeat CVE-2019-5736 #4450
Comments
I'm not sure that a separated The overlayfs approach (which it seems I suggested doing in the commit message when I wrote this protection in 0a8e411 😅) has basically no performance or memory overhead (based on my performance testing in #4448, it has <1% overhead over doing no copying at all and that might just be noise) and solves the most common case. It also has the benefit of giving us page cache sharing, which none of the copy-based solutions can. Conceptually, having (Also |
I played with the separate Overlay approach indeed looks very promising since most of the systems where runc is used have overlayfs. The only catch is it requires a relatively new kernel v5.1, released in May 2019, meaning some very old distros might not have the syscalls needed (fsopen/fsmount); but even Ubuntu 18.04 has kernel 5.15 (in HWE), and RHEL8 kernel has needed syscalls backported. |
IMHO now that we have the |
Agree! |
@cyphar not really related, but I'm also thinking about dropping cmd/contrib/memfd-bind. While not as complicated and limited as dmz, it is still complicated (to setup and maintain wrt upgrades) and limited (non-root users are out). OTOH it's harmless (but kind of useless now). |
I'm of two minds about that. Using it completely removes any potential overhead from It really sucks that we can't bind-mount the memfd itself (even |
OK, this is a valid argument for keeping memfd-bind -- while not very useful now, it could be improved to become more useful. I guess we can keep it for now and either improve or remove in time for v1.3 release. |
Because of CVE-2019-5736, we have to take some actions to prevent runc binary in the host
could be modified from the container, we had many solutions for these years, for example:
bindfd
,memfd
,otmpfile
,os tmpfile
,Embedded dmz
andoverlay
. Most of then can workfor most of times, but in practice, there were many issues for these solutions. So we should find
some new possible solutions.
For
Embedded dmz
solution, we embed a small binary file to start the real container process,but it may cause some issues(#4518), especially the capability behavior change issue(#4125). So
we make this solution as a
opt-in
solution. Consider we have moved the binary clone codefrom
runc init
torunc parent process
(#3987), so the memory usage of binary clone will notbe included in container's memory cgroup accounting. We can embed a big binary file in runc,
and copy it to memfd, then use it to start
runc init
process.The whole steps should like this:
runc init
tocontrib/cmd
and it could be compiled as a separate binary file, for examplename it as
runc-dmz
;runc-dmz
to runc binary;runc-dmz
file;runc-dmz
binary data to memfd;runc-dmz init
.I think the size of
runc-dmz
should be smaller thanrunc
, and we can read it to memory paralleled,so it would help to reduce the start time of the container, and will fix the issue #4449.
The text was updated successfully, but these errors were encountered: