Skip to content

Soundness issue with std::env::remove_var and other env manipulation in libsystemd #306

@mbuesch

Description

@mbuesch

As described in the documentation, std::env::remove_var will become unsafe in a future version of Rust.

Even today the use of std::env::remove_var is unsound in multithreaded programs and can cause UB. In addition to that, env manipulation from non-Rust libs (libssytemd) can cause UB in Rust.

See the rust-lang/rust#27970 for more information.

I think this is a problem for rust-systemd, because threads can be accessing the environment, while rust-systemd calls remove_var or calls into libsystemd which changes the env.

What do you think?
Thanks for your opinions :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions