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

podman: use overlayfs for temporary files if rootless #2507

Closed
tobwen opened this issue Mar 3, 2019 · 12 comments
Closed

podman: use overlayfs for temporary files if rootless #2507

tobwen opened this issue Mar 3, 2019 · 12 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. rootless

Comments

@tobwen
Copy link
Contributor

tobwen commented Mar 3, 2019

/kind feature
Description
When being rootless, all the PID and other stuff gets stored in /tmp/ (EDIT, removed: and is readable from any user on the system). Wouldn't it be possible to use fuse-overlayfs to write it on the current user's space only where available? Since tmpfs is used, it might be compatible?

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 3, 2019
@rhatdan
Copy link
Member

rhatdan commented Mar 4, 2019

The pid and other stuff should be written to /run not to /tmp.

@mheon
Copy link
Member

mheon commented Mar 4, 2019

@rhatdan I think we fall back to /tmp if /run/user doesn't exist, then further to making a dir in the user's home directory if we can't used /tmp

@rhatdan
Copy link
Member

rhatdan commented Mar 4, 2019

Well the directory we create in /tmp should have permissions 0700

@tobwen
Copy link
Contributor Author

tobwen commented Mar 4, 2019

@rhatdan As a normal user, you can neither write to /run/user/ nor to /var/run/user/

That also confuses me when reading the man page:

Storage state directory where all state information is stored (default: "/var/run/containers/storage" for UID 0, "/var/run/user/$UID/run" for
       other users).  Default state dir is configured in /etc/containers/storage.conf.

Actually, that won't work.

@mheon
Copy link
Member

mheon commented Mar 4, 2019

@tobwen /run/user/$UID should be created by systemd as a per-user temporary directory on login, with the guarantee that it's destroyed on user logout, which is desirable for cleaning some of our temporary files. On systems without systemd, we can fall back to just making a directory in /tmp.

@tobwen
Copy link
Contributor Author

tobwen commented Mar 4, 2019

@mheon Maybe Debian hasn't this systemd-feature enabled (like many others). My /run/user/$UID is empty (Debian Stable). Let me check what happened on Ubuntu.

Edit: Update for Ubuntu 16.0.4 LTS: has /run/user/0 only (I've got serveral users, like one for podman). Also, like on Debian, all of those are root & read only.

Addition: I think, you can't use the user's home directory, since tmpfs is needed for some actions.

@mheon mheon added the rootless label Mar 4, 2019
@giuseppe
Copy link
Member

giuseppe commented Mar 4, 2019

we use /tmp as a fallback when /run/user/$UID is not usable and the directory is created with mode 0700.

If the /tmp fallback is not usable for any reason (e.g. the directory is owned by another user), then we try with the home directory.

We prefer /run and /tmp as they are not persistent.

Are you sure that another user can really read what is stored under /tmp?

@tobwen
Copy link
Contributor Author

tobwen commented Mar 4, 2019

@giuseppe I've just rechecked it, you're right. I cannot access it from another user. Sorry, maybe I had a sudo included in my previous tests.

So all we have to do is to update the manfile like this:
/run/user/$UID i > /tmp > $home

Thanks for your explanation. Shall I close this feature request?

@giuseppe
Copy link
Member

giuseppe commented Mar 4, 2019

yes let's close it :-)

Thanks for checking it out

@giuseppe giuseppe closed this as completed Mar 4, 2019
@rhatdan
Copy link
Member

rhatdan commented Mar 4, 2019

Excellent @giuseppe Glad to see we are secure by default.

@rhatdan
Copy link
Member

rhatdan commented Mar 4, 2019

@tobwen Where are you getting podman for Debian? Is it available in the default installer?
Which version of podman are you getting?

@tobwen
Copy link
Contributor Author

tobwen commented Mar 4, 2019

@rhatdan I'm building it for myself in Debian 9 from GIT. Complete rootless process, only building and installation of fuse3 needs root (I've backported it from Debian 10 without a problem). But you don't need OverlayFS to run podman,

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. rootless
Projects
None yet
Development

No branches or pull requests

5 participants