Skip to content

fix CVE-2019-5736 by using as less memory as possible#1987

Closed
lifubang wants to merge 1 commit intoopencontainers:masterfrom
lifubang:CVE-2019-5736
Closed

fix CVE-2019-5736 by using as less memory as possible#1987
lifubang wants to merge 1 commit intoopencontainers:masterfrom
lifubang:CVE-2019-5736

Conversation

@lifubang
Copy link
Copy Markdown
Member

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 after runc init started.

If there is a problem, please point out and discuss it.
Thanks.

Signed-off-by: Lifubang lifubang@acmcoder.com

Signed-off-by: Lifubang <lifubang@acmcoder.com>
Signed-off-by: lifubang <lifubang@acmcoder.com>
return "", err
}
id := uuid.New()
temp := fmt.Sprintf("/tmp/runc.%s", id)
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.

If we're going to do it this way, I would want to use memfd_create because using /tmp won't always work and memfd_create is a fool-proof way of doing it. But ultimately I could just rewrite #1984 entirely to not use C code.

@cyphar
Copy link
Copy Markdown
Member

cyphar commented Feb 26, 2019

#1984 now makes this no longer relevant -- since by default we try doing a read-only bind-mount which takes up no memory or storage (which is better than this approach).

@cyphar cyphar closed this Feb 26, 2019
@lifubang lifubang deleted the CVE-2019-5736 branch May 28, 2020 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants