-
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
Socket truncated with long user names using default $XDG_RUNTIME_DIR #8798
Comments
Can't locate the PR, but I know we have hit this before. I believe the fix was to truncate container ID to ensure maximum length restriction was satisfied? |
Having the same problem. This also happens with short usernames (5 chars) and my |
I can also confirm that the socket was successfully created. So having longer paths isn't a problem. Instead of doing any kind of truncation logic I would suggest to simply chdir into the correct directory. Then the path becomes a fixed string ( |
Interested in opening a PR to do this? |
Sorry, my go knowledge is practically nonexistent and it would certainly take multiple iterations for me to get this right and nice while someone else with knowledge of go and probably the codebase can do it in 2 minutes. Would it have been in some other language like C or Rust - I would have opened a PR in the first place without even commenting here. |
No problem, hopefully someone from the community will pick this up. Most of Red Hat is supposed to be on PTO this week. |
Same issue here, uid is very long, socket name is over 108 chars, podman does not start. |
Changing XDG_RUNTIME_DIR does not help in our case, the data is there, but the path to the socket is not altered. |
@haircommander Is this related to the Conmon change we were discussing yesterday? |
yes most likely! |
I'm interested in taking a stab at this, is the preferred approach still changing the directory? |
I believe so. |
@mheon is this something we need to fix before 3.0? |
I think we definitely need a fix, yeah - either an updated Conmon that does
not enable this by default, a Podman patched to work with newer Conmon, or
both.
…On Sun, Jan 10, 2021 at 06:58 Daniel J Walsh ***@***.***> wrote:
@mheon <https://github.com/mheon> is this something we need to fix before
3.0?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8798 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCD4LG3TIASIM6GIAOTSZGI5JANCNFSM4VEKXKHA>
.
|
Is there an attack point for a work around? (beside running podman as root - short uid user) |
could you please try if #8933 solves the issue you are seeing? |
instead of opening directly the UNIX socket path, grab a reference to it through a O_PATH file descriptor and use the fixed size string "/proc/self/fd/%d" to open the UNIX socket. In this way it won't hit the 108 chars length limit. Closes: containers#8798 Signed-off-by: Giuseppe Scrivano <[email protected]>
The fix in podman 3 works, the bug is gone with a freshly built podman and very long uid. |
instead of opening directly the UNIX socket path, grab a reference to it through a O_PATH file descriptor and use the fixed size string "/proc/self/fd/%d" to open the UNIX socket. In this way it won't hit the 108 chars length limit. Closes: containers#8798 Signed-off-by: Giuseppe Scrivano <[email protected]> (cherry picked from commit fdbc278)
instead of opening directly the UNIX socket path, grab a reference to it through a O_PATH file descriptor and use the fixed size string "/proc/self/fd/%d" to open the UNIX socket. In this way it won't hit the 108 chars length limit. Closes: containers#8798 Signed-off-by: Giuseppe Scrivano <[email protected]> (cherry picked from commit fdbc278)
Is this going to be fix for podman 2 since it comes with RHEL 8.3? |
We discussed an async release for this, but it appeared too late in the release cycle to be worth it. RHEL 8.4 should be releasing soon with a fixed Podman. |
Is this a BUG REPORT or FEATURE REQUEST?
/kind bug
Socket truncated with long user names using default $XDG_RUNTIME_DIR
Steps to reproduce the issue:
have a long username such as
11111111
run
podman run -it ubuntu
Describe the results you received:
podman fails to attach to the running container
Describe the results you expected:
user able to attach to the container
Additional information you deem important (e.g. issue happens only occasionally):
This appears to be because of a system limit
addr.sun_path
because the socket is truncated:https://github.com/containers/podman/blob/master/libpod/oci_attach_linux.go#L187
Based on
addr.sun_path
here:podman/libpod/oci_attach_linux_cgo.go
Line 6 in b68b6f3
Is this a system setting we can change?
Also, will a truncated socket ever work after it was created? The File not found error is true, however a bit misleading because the real issue is the socket that was created exceeded system limits.
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?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Setting the
XDG_RUNTIME_DIR
to a shorter string solves the issueThe text was updated successfully, but these errors were encountered: