Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make /proc writable, but not /proc/sys and /proc/sysrq-trigger #5903

Merged
merged 1 commit into from May 19, 2014

Conversation

alexlarsson
Copy link
Contributor

Some applications want to write to /proc. For instance:

docker run -it centos groupadd foo

Gives: groupadd: failure while writing changes to /etc/group

And strace reveals why:

open("/proc/self/task/13/attr/fscreate", O_RDWR) = -1 EROFS (Read-only file system)

I've looked at what other systems do, and systemd-nspawn makes /proc read-write
and /proc/sys readonly, while lxc allows "proc:mixed" which does the same,
plus it makes /proc/sysrq-trigger also readonly.

The later seems like a prudent idea, so we follows lxc proc:mixed.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson alexl@redhat.com (github: alexlarsson)

@crosbymichael
Copy link
Contributor

@alexlarsson what about irq

@crosbymichael crosbymichael added this to the 1.0 milestone May 19, 2014
@crosbymichael
Copy link
Contributor

Do we know of a few existing issues that this fixes?

@alexlarsson
Copy link
Contributor Author

I know about the above problem only, but that was reported pretty quickly to the redhat bugzilla, so i'm sure more things will show up.

@alexlarsson
Copy link
Contributor Author

@crosbymichael irq looks iffy enought that we should probably also make that readonly

@crosbymichael
Copy link
Contributor

@alexlarsson ok, can you update for irq?

Some applications want to write to /proc. For instance:

docker run -it centos groupadd foo

Gives: groupadd: failure while writing changes to /etc/group

And strace reveals why:

open("/proc/self/task/13/attr/fscreate", O_RDWR) = -1 EROFS (Read-only file system)

I've looked at what other systems do, and systemd-nspawn makes /proc read-write
and /proc/sys readonly, while lxc allows "proc:mixed" which does the same,
plus it makes /proc/sysrq-trigger also readonly.

The later seems like a prudent idea, so we follows lxc proc:mixed.
Additionally we make /proc/irq and /proc/bus, as these seem to let
you control various hardware things.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
@alexlarsson
Copy link
Contributor Author

@crosbymichael Added /proc/bus and /proc/irq too.

@crosbymichael
Copy link
Contributor

LGTM

ping @vmarmol

@vmarmol
Copy link
Contributor

vmarmol commented May 19, 2014

LGTM

vmarmol added a commit that referenced this pull request May 19, 2014
Make /proc writable, but not /proc/sys and /proc/sysrq-trigger
@vmarmol vmarmol merged commit 30bd2bb into moby:master May 19, 2014
@alexlarsson alexlarsson deleted the writable-proc branch May 20, 2014 06:58
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.

None yet

3 participants