-
Notifications
You must be signed in to change notification settings - Fork 253
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
lxcfs: tighten policy about write() syscall #630
Conversation
It's just dangerous to allow passthrough of write() syscall anywhere under emulated sysfs subtree. Let's forbid it. Signed-off-by: Alexander Mikhalitsyn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
@stgraber which scenarios are you thinking that enabling --allow-write-on-cgroup
may be useful for btw?
before cgroup namespace appeared, LXCFS was used to emulate cgroup tree inside the container. So it's usually safe to allow cgroup writes to a cgroup subtree from inside the container (it is something that we allow these days by default when cgroup namespace is used. "cgroup delegation" thing). We introducing this just as an extra security measure. These days this cgroup emulation code in LXCFS is almost dead. |
I actually expected a --enable-cgroup as I don't think we should show a cgroup tree at all by default, not even read only. I just don't want to throw away the code because of embedded platforms running very old kernels and because we may reuse the code to offer a cgroup1 tree on a cgroup2 host system down the line. |
Thanks. So if LXCFS on newer systems isn;t emulating cgroup tree, and writes are usually safe and allowed from inside the container, then can you help me understand the issue that requires disabling writes by default (and fixing the disabling of cpu). |
It's just empty, if you don't have cgroup-v1 on the host. |
Let me rework it a bit, then :) |
Got you, thanks! |
Yeah, but even on cgroup1 hosts, I'd prefer we default to no virtual cgroup tree unless --enable-cgroup is passed. |
8582928
to
839e0db
Compare
59da42b
to
ba9788a
Compare
During our private discussion, Stéphane proposed to add a new option --enable-cgroup to explicitly enable old cgroup emulation code It's worth mentioning that cgroup code in LXCFS is not widely used, because it was written before cgroup namespace era and not actual these days. Signed-off-by: Alexander Mikhalitsyn <[email protected]>
ebd0bfb
to
da89cdc
Compare
Hm, it looks like something is wrong with ubuntu-22.04 github runners. Let's wait a bit and once it become green we can merge. |
22fab6f
to
7b18f1a
Compare
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
7b18f1a
to
6239e4b
Compare
... and this:
|
actions/runner-images#9491 google/fuzztest@7b4f288 Signed-off-by: Alexander Mikhalitsyn <[email protected]>
41ac8b5
to
3517755
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
No description provided.