opencontainers / opencontainers/runc

CVE-2019-5736 mitigation (cloned_binary) vs systemd

Open
#3,341 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
13.5k
Forks
2.3k
Avg merge
2d 8h
Merged PRs (30d)
30

Description

Since the mitigation for CVE-2019-5736 was amended with /proc/self/exe read-only bind mount in https://github.com/opencontainers/runc/pull/1984, every runc start/run/exec causes a mount and unmount event.
Those are picked up by systemd to create/remove a mount unit. This can be seen in system journal:

journalctl --follow
Jan 18 15:22:04 kir-rhat systemd[1]: run-runc-xx4-runc.Ho2X6M.mount: Deactivated successfully.

(for some reason, only the unmount is shown when the default log level is used).

First, this creates a load on the system -- systemd re-reads mountinfo on every event (maybe it is fixed in later versions to rate-limit the reading).

Second, with older systemd and some setups, due to a bug in systemd (fixed in 2018 by https://github.com/systemd/systemd/pull/10980, but not backported to certain distros), this eventually results in systemd unit table reaching its maximum size. Once this happens, systemd is not able to start or stop any more units, which is A Very Bad Thing.

I understand that this is a systemd (rather than runc) issue, but perhaps we can work around it in some way?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the /proc/self/exe read-only bind mount used during runc start, run, and exec, while following the system journal with journalctl --follow. Reproduce the mount and unmount events with systemd and determine whether runc can avoid the reported unit churn; done means a validated workaround or a clearly documented reason it cannot be provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
infrastructure, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.