Skip to content

splice usage may be incorrect if it is possible for the source to be mutated #116451

Open
@safinaskar

Description

@safinaskar

It seems std::io::copy sometimes invokes splice on Linux. Don't do this! Using splice can lead to data corruption (one user reported that his backups was damaged). Also, Linus Torvalds said that splice should not be used as general-purpose copy tool. See details here: systemd/systemd#29044 . There are situations where splice is okay, but it is not good as general-purpose copy mechanism. Use of sendfile and copy_file_range should be questioned, too. Any other use of splice in std should be audited, too

Rust version: 90f3a6f

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.O-linuxOperating system: LinuxS-blockedStatus: Blocked on something else such as an RFC or other implementation work.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions