Description
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
and overlay
. Most of then can work
for 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 code
from runc init
to runc parent process
(#3987), so the memory usage of binary clone will not
be 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:
- Move
runc init
tocontrib/cmd
and it could be compiled as a separate binary file, for example
name it asrunc-dmz
; - Embed
runc-dmz
to runc binary; - Remove the
runc-dmz
file; - Change the old dmz solution to copy
runc-dmz
binary data to memfd; - Use this memfd to start runc init, like
runc-dmz init
.
I think the size of runc-dmz
should be smaller than runc
, 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.