-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Security issue on Linux Workstation with multiple accounts: cross-account artifact creation #12264
Comments
And the reason is in the systemd: there is long discussion but it looks like XDG_CONFIG_HOME, XDG_DATA_HOME, etc. are not set automatically, at least at the beginning of user's GUI session startup by systemd. It is not set synchronously. The user's systemd configuration lacks of targets, except the default. I hope that everything that needs complete configuration presence can wait for systemd-pamd or systemd-homed service but see RedHatBugsilla - Homed issue.. |
What change would be required to make that happen? |
Please, please, please ! check pam-xdg-support packaging with Podman. This package had problems in Ubuntu and fresh bugzilla record in the RedHat pam-xdg-support. After upgrade to Fedora 35 Podman stopped to work completely: podman container create ead53a357190 --name p1Error: error creating container storage: error creating read-write layer with ID "c9c6e70a9ff7b767112c06faed0771559462e86b81ba60eb6a5bbb50ff52598a": stat /home/pavelsosin/.local/share/containers/storage/btrfs/subvolumes/e024d689dd363dbb6b24865e899a380420e15a8d8b78ed2e160f517528148cd2: no such file or directory I can't find it for Fedora35 |
This looks like a GNOME/systemd bug to me rather than a Podman bug. Also note that "OCI artifacts" are something different (see https://github.com/opencontainers/artifacts). |
@vrothberg Maybe. I asked to check packaging Podman with systemd version for Fedora35. The environment of Systemd manager looks incomplete and incorrect: Some XDG variables are missed, some are not updated when I switch between users via GNOME, i.e. re-execute systemd-daemon. It is not like su - .another user. HOME and XDG variables are set into environment every systemd-user run. Some environment-related issues of pam xdg helper where reported for Ubuntu/rootless Docker too when root and non-root users are switched. After manual execution of systemctl --user daemon-reexec the environment looks inconsistent. But this is expected because daemon-reload makes environment volatile. |
Indeed, in the Workstation I can have 1 Terminal application running with several tabs connected to the different sessions of different users. su -p helps to navigate between sessions and tabs. su is out of the sync with systemd-logind! Then, I'm userid 100 but my XDG_RUNTIME_DIR is /run/user/1001/. This is exactly as in Windows. Since sessions are controlled by systemd the User object looks more reliable: |
@vrothberg Please, help in systemd-homed - Selinux integration is needed! According to the audit log operations on the home area including read access are blocked by Selinux and corresponding entries are written into the audit.log. Usage of $HOME in the storage.conf means that all artifacts are written into the home area. The similar issue is mentioned twice: in Fedora project tests results and Podman troubleshooting The possible solution can be either moving Podman artifact storage outside of User's home area (???) or re-labeling of the Podman storage after home area mounting (???). Is it relevant: |
Please open a dedicated issue for
|
the idmapped mount itself should not be a problem. I guess the session is still running in the host namespace so there are no user namespaces involved? Does it work if you run |
@giuseppe Unfortunately, it fails itself with multiple errors like |
I found something very similar in the CentOS forum: SELinux prevents access to the external drive. Maybe, "SELinux-man" can advise something better? If Podman storage volume is mountable btrfs volume it can be treated as "external drive". |
Open a separate issue. This issue is way too confusing . |
@rhatdan really sorry for personal appeal but it looks like that something conceptually wrong in Podman running on the Fedora Workstation with GNOME 4: I expect that Podman process a child of bash that is a child of session's process that is a child of systemd ID 1 process inherits its capabilities and restrictions configured by Systemd configuration Systemd.exec conf -> Capabilities, Security. The process capabilities can and should be very restricted in the GNOME session. This is indeed very confusing, so I'm closing this issue and will open discussion instead but could some body from the Podman team can look and document how to configure systemd or create the correct drop-in configuration for Linux workstations? |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Podman randomly creates BTRFS subvolumes representing OCI artifacts on the Fedora 34 workstation with multiple accounts when accounts are frequently switched. Accounts that were never used for running Podman get btrfs subvolumes when another account creates/runs containers.
Steps to reproduce the issue:
Describe the results you received:
Podman info returns
ERRO[0000] stat /home/<old user ..... storage.conf" : permission denied butI found unexpected content in the "Podman storage"
Describe the results you expected:
It must be empty if account's owner never used Podman
Additional information you deem important (e.g. issue happens only occasionally):
Happens occasionally
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes/No
Additional environment details (AWS, VirtualBox, physical, etc.):
I found that unlike USER environment variable, HOME environment variable doesn't follow immediately after user's switch. I saw somewhere in the systemd documentation that it is the normal systemd behavior. When GNOME Terminal is invoked it inherits the current value.
The GNOME GUI session is managed by systemd - HOME may be not 100% synchronized.
Systemd itself demands to keep Unit's environment block as slim as possible for every unit including systemd-user-session that fills initial systemd manager environment.
Systemd itself never uses environment variables for the service configuration providing % placeholders instead. For the "private" configuration conf files in the .d directories and merged with the "default" configuration are used - they are static and independent from the dynamically built environment blocks.
User-specific configurations can be generated from template. This is systemd mechanism that drives Workstation.
The text was updated successfully, but these errors were encountered: