path/filepath: EvalSymlinks tries recursively resolving magic link /proc/1/root
causing infinite symlink resolutions
#73572
Labels
BugReport
Issues describing a possible bug in the Go implementation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go version go1.24.2 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Inside a container, privileged with host's PID namespace, I symlinked
/var/tmp
to/proc/1/root/var/tmp
. I wrote a small script to resolve the symlinkWhat did you see happen?
The above script fails with
It tires to resolve
/proc/1/root
which does point to container's/
when resolved in userspace, but it's actually resolved via the kernel when traversed.What did you expect to see?
Expected to not have it infinitely traverse the symlinks.
Shell utilities like
ls
andcd
understand this and resolve this appropriately.Here is a very simple reproducing example
Build the above script and name it
symlink
, then in the same directoryThe text was updated successfully, but these errors were encountered: