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

Drop in-container /proc requirement? #1734

Open
3 tasks
wking opened this issue Feb 23, 2018 · 2 comments
Open
3 tasks

Drop in-container /proc requirement? #1734

wking opened this issue Feb 23, 2018 · 2 comments

Comments

@wking
Copy link
Contributor

wking commented Feb 23, 2018

Spun off from #1726, it would be nice to not require /proc inside containers. Current blockers:

Do we need /proc for anything else? @cyphar seems to imply we do (or I'm reading him wrong). This is definitely an edge case, but I'd like to get it working.

@cyphar
Copy link
Member

cyphar commented Feb 23, 2018

So, the short version of my opinion on this is that removing the /proc requirement from inside the container would be quite cool (and it also would allow us to beef up security around malicious pid1 containers -- something that all container runtimes are lacking these days).

My comment in #1726 was a bit of a jumbled mess. The thrust of my point is that there are several theoretical security issues in runc at the moment related to /proc -- and while we can fix some of these issues, in order to fix all of them we need some extra kernel primitives we don't have at the moment.

opening the start-signal FIFO, but we can inherit a socket through from outside withough reopening.

Can you clarify what you mean here? The O_PATH and re-opening trick is necessary to protect against container escapes -- we could send it via a unix socket, but that feels more complicated. My goal would be to get openat to accept AT_EMPTY_PATH -- but this is something that I'd need to get Al Viro and Eric Biederman to accept.

closing extra file descriptors, but we can handle that before leaving the host mount namespace.

This can be done without needing /proc at all -- you can do what rpm does, where you do a fnctl(fd, F_GETFD). The downside though is that you don't know which FDs are actually mapped, so it's quite expensive to check all of them (it would be nice if there was a syscall API for this -- but I wouldn't bet on this being a popular request).

@cyphar seems to imply we do (or I'm reading him wrong).

At the moment I'd rather not detail the exact security risks we have with /proc in public -- because fixing them requires some upstream kernel work that has been quite slow-moving. However, the point of my comment was not that "we need /proc inside the container" -- its that there are several security problems that we need to resolve with /proc in the future.

This is definitely an edge case, but I'd like to get it working.

I think that the key benefit of removing the /proc requirement is not so that people can run containers without /proc mounted (such containers are pretty much useless to be honest). The benefit would be the added security you get of the runtime not having to trust the filesystem in the container (this is the one of the reasons I added TIOCGPTPEER in Linux 4.13).

@wking
Copy link
Contributor Author

wking commented Feb 23, 2018 via email

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

No branches or pull requests

2 participants