-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix_stdio_permissions: only change owner/permissions on ttys #4486
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
base: main
Are you sure you want to change the base?
Conversation
This avoids changing permissions on files passed in as shell redirections, e.g. `lxc-attach [...] < FILE`. Fixes: lxc#4484 Signed-off-by: Antonio Terceiro <terceiro@debian.org>
This pull request didn't trigger Jenkins as its author isn't in the allow list. An organization member must perform one of the following:
Those commands are simple Github comments of the format: "jenkins: COMMAND" |
jenkins: ok to test |
Testsuite passed |
Hi @terceiro, thanks for your patch! I'm trying to figure out a story behind the original change #3344. Unfortunately, there is no reproducer or any additional info in #3344 to figure out what was the use case. At the same time, Let's ask Christian's (@brauner) opinion on this story in general. |
|
From the reproducer @terceiro pasted it looks like the |
A bit of debug is giving me: after alloc_attach_context ctx->setup_ns_uid = -1 ctx->target_ns_uid = -1 Doh! It just occurred to me I was wrong in my previous comment: my 4.0.12 test was with |
("previous comment" being the one in the related issue) |
So on the one hand, if root in the container is root on the host, then we shouldn't need to chown for the container to be able to read/write the contents. But, the container might have sensitive info which through some convoluted manipulation of a system using lxc, allow an unprivileged user to arrange to exfiltrate data. My biggest worry with what we're currently doing would be if it were possible for a container to create a root-owned executable file, but we prevent that by chmoding (unless the chmod can fail, in which case perhaps we should work harder to undo our chown?). So finally there could be the inconvenience for an unprivileged sudo-capable user who gets their file owned by root this way. So right now my recommendation would be to not merge this pr, and close the issue as wontfix. |
This avoids changing permissions on files passed in as shell redirections, e.g.
lxc-attach [...] < FILE
.Fixes: #4484