Bug 1472410 - /dev is mounted as a tmpfs and should be limited in size the same way that /dev/shm is.
/dev is mounted as a tmpfs and should be limited in size the same way that /...
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Antonio Murdaca
: Extras
Depends On:
  Show dependency treegraph
Reported: 2017-07-18 12:20 EDT by Daniel Walsh
Modified: 2017-07-18 15:43 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
This patch might fix the issue. (461 bytes, patch)
2017-07-18 15:06 EDT, Daniel Walsh
no flags Details | Diff

  None (edit)
Description Daniel Walsh 2017-07-18 12:20:27 EDT
There is a potential Denial of Service attack from a container against the host by using up 50% of available memory from writing to /dev.
Comment 1 Daniel Walsh 2017-07-18 12:22:01 EDT
Also needs to be fixed in Fedora.
Comment 3 Daniel Walsh 2017-07-18 15:04:20 EDT
This is really under docker.  But I am not sure it is real important.  Since /tmp size is controlled by memory cgroup, this would only allow a user to use 50% of available memory in his container.  If the admin does not set any memory limit on a container the processes inside could use 100% or memory.
Comment 4 Daniel Walsh 2017-07-18 15:06 EDT
Created attachment 1300623 [details]
This patch might fix the issue.
Comment 5 Mrunal Patel 2017-07-18 15:09:21 EDT
Yeah, that should work. Do we want to make it configurable though like the --shm-size flag in docker?
Comment 6 Daniel Walsh 2017-07-18 15:17:17 EDT
I don't think it would ever grow to that big of a size unless the user is doing something very wrong, the only things that should be in /dev are devicenodes.
Comment 7 Vivek Goyal 2017-07-18 15:43:18 EDT
Giving a container with a tmpfs limited with size makes sense.

Note You need to log in before you can comment on or make changes to this bug.