fix CVE-2019-5736 by using as less memory as possible #1987
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.
I'm a code fan of opencontainers/runc project.
And my business is
Online Judge (OJ)
, which is based on docker.To ensure fairness of the OJ examination, we need to use memory limit with 4m, 5m, or 10m.
So, I need to fix
CVE-2019-5736
by using as less memory as possible.I open this PR to figure out my solution by using code, because my English is very poor.
My solution is to copy a new runc binary file with a random name before we start to run
runc init
command. And delete it afterrunc init
started.If there is a problem, please point out and discuss it.
Thanks.
Signed-off-by: Lifubang lifubang@acmcoder.com