-
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
Invoking mount in privileged rootless container fails due to privileges #6735
Comments
Yes this definitely is user namespace causing it. It looks like the kernel is having issues with the multiple layers of user namespace going on. It does not see UID 0 in the second user namespace as root. According to the capsh the process does have CAP_SYS_ADMIN. |
it is a regression in 2.0. Somehow we don't set the uidmapping,gidmapping settings for the fuse-overlayfs mount. Under 1.9 I see the fuse-overlayfs mount has: While on 2.0 such options are not set. The result is that on 2.0, we have:
while on 1.9:
|
specify the mappings in the container configuration to the storage when creating the container so that the correct mappings can be configured. Regression introduced with Podman 2.0. Closes: containers#6735 Signed-off-by: Giuseppe Scrivano <[email protected]>
PR here: #6743 |
Thanks, @giuseppe |
specify the mappings in the container configuration to the storage when creating the container so that the correct mappings can be configured. Regression introduced with Podman 2.0. Closes: containers#6735 Signed-off-by: Giuseppe Scrivano <[email protected]>
- Issue containers#6735 : problem with multiple namespaces; confirms combinations of --userns=keep-id, --privileged, --user=XX - Issue containers#6829 : --userns=keep-id will add a /etc/passwd entry - Issue containers#6593 : podman exec, with --userns=keep-id, errors (test is currently skipped because issue remains live) ...and, addendum: add new helper function, remove_same_dev_warning. Some CI systems issue a warning on podman run --privileged: WARNING: The same type, major and minor should not be used for multiple devices. We already had special-case code to ignore than in the SELinux test, but now we're seeing it in the new run tests I added, so I've refactored the "ignore this warning" code and written tests for the removal code. Signed-off-by: Ed Santiago <[email protected]>
- Issue containers#6735 : problem with multiple namespaces; confirms combinations of --userns=keep-id, --privileged, --user=XX - Issue containers#6829 : --userns=keep-id will add a /etc/passwd entry - Issue containers#6593 : podman exec, with --userns=keep-id, errors (test is currently skipped because issue remains live) ...and, addendum: add new helper function, remove_same_dev_warning. Some CI systems issue a warning on podman run --privileged: WARNING: The same type, major and minor should not be used for multiple devices. We already had special-case code to ignore than in the SELinux test, but now we're seeing it in the new run tests I added, so I've refactored the "ignore this warning" code and written tests for the removal code. Signed-off-by: Ed Santiago <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Invoking
mount
in rootless container created with options--privileged
,--userns=keep-id
,--user root:root/0
fails withmount
complaining about EUID being 1000 (simply requesting to be root).Steps to reproduce the issue:
1a.
podman run -t -i --rm --privileged --userns=keep-id --user 0 fedora bash
1b.
podman run -t -i --rm --privileged --userns=keep-id --user 0 f32/fedora-toolbox bash
2.
mount --rbind /tmp /tmp/var
Describe the results you received:
In scenario 1a (
mount
fromutil-linux 2.34
):In scenario 1b (
mount
fromutil-linux 2.35.1
):Describe the results you expected:
No output and the paths should be bind-mounted.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Additional environment details (AWS, VirtualBox, physical, etc.):
Fedora Silverblue 32
The text was updated successfully, but these errors were encountered: