-
Notifications
You must be signed in to change notification settings - Fork 882
stage1/kvm/lkvm: chown files and dirs on creation #3485
Conversation
Even though a uid/gid pair are passed over the protocol, they were not being used for chmod'ing files or dirs being created. This surfaced inside /tmp with the S_ISVTX 'sticky' bit set, where all files ended up being owned by root. Fix it by chmod'ing after creation. Fixes rkt#2576 As a side effect, it also seems to solve the remaining problems with 'apt-get update' in lkvm, so also: Fixes rkt#1917
@lucab PTAL |
LGTM. @grahamwhaley it looks like kvmtool recently received some 9p fixes. Any chance we can upstream this sticky-fix and perhaps re-sync with latest master? |
(I restarted the jenkins build that got stuck, but should be just a flake) |
@lucab Yep, i saw lkvm had a few fixes (security as well iirc), and have on my list to bump the tag we currently clone from. |
@grahamwhaley I'll check how to provide you access to Jenkins in case of flakes. Just for the build logs, however, the public anonymous vhost should be enough: https://jenkins-rkt-public.prod.coreos.systems/job/rkt-github-ci/. (The first URL in the list points there, but unfortunately it is not possible to fine-tweak Jenkins for each build-status entry) |
Ah. OK, some more history has come to light... It looks like I won't be submitting this patch in this form at least upstream. I'll have a think about this... |
And, for more completeness, this is handled through |
build is green, and the PR is reviewed. Tentatively setting to current milestone, /cc @lucab |
For rkt usecase, I think it is fine to ship with this patch. We always end up in the uid=0 case, and changing permissions on stage2-rootfs shouldn't be an issue (path is unreachable for normal users). |
(Bad timing on our side, I'm deferring this to next release to have some room for discussion/followup). |
Having discussed with @lucab , I believe we are all happy with this functionality being re-introduced for rkt/kvm/lkvm, and we are pretty sure these patches will not go back upstream to lkvm. Given the slow movement of the lkvm codebase, the risk of carrying these patches in rkt causing us major rebase issues in the future is very low. Thus, I believe the agreement is we will merge this PR. |
@grahamwhaley yes, thanks for summing this up. LGTM. |
Big up @grahamwhaley |
Honor the uid/gid values when creating files and directories
Fixes #2576
As a side effect, it also seems to solve the remaining problems with
'apt-get update' in lkvm, so also:
Fixes #1917