Skip to content

vfs: Overlay copy-up has three independent data-corruption bugs #2582

Description

@baszalmstra

All in overlay_fs.rs::copy_to_upper, all untested, all hit by ordinary pip install/mv on a conda env:

  • Symlinks are copied up as empty regular files — only Directory is special-cased; a symlink's content_source returns ENOENT, falls to read (returns vec![] for symlinks), and fs::write creates a 0-byte file that permanently shadows the link. Conda envs are full of libfoo.so → libfoo.so.1.
  • Directory rename loses lower children — the upper_path.exists() early-return fires before the directory-recursion check, so a partially-materialized dir isn't recursed; renaming it drops any lower-only children, then a whiteout hides the originals.
  • Exec bit dropped on copy-upfs::write creates 0644 with no permission copy, so chmod/mv/truncate on bin/python yields a non-executable copy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions