mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00

add a function to securely mount a subpath inside a volume. We cannot trust that the subpath is safe since it is beneath a volume that could be controlled by a separate container. To avoid TOCTOU races between when we check the subpath and when the OCI runtime mounts it, we open the subpath, validate it, bind mount to a temporary directory and use it instead of the original path. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>