Skip to content

Commit 09303e9

Browse files
authored
Update RUSTSEC-0000-0000.md
Clarification
1 parent ece1d78 commit 09303e9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

crates/openssl-probe/RUSTSEC-0000-0000.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@ patched = [">= 0.1.6"]
2525

2626
`openssl-probe` offers non-`unsafe` methods that call `std::env::set_var`, which may be called
2727
in a multithreaded environment, and potentially clash with environment access on other threads.
28-
29-
When these methods are called while other threads are active and accessing the environment, it
28+
In pure Rust code, concurrent read and write access to the environment is actually safe due to a lock
29+
taken in the platform implementations of the environment accessors (the documentation does not
30+
state this, and it's possible it _could_ change in the future). Libraries using other runtimes
31+
(including Python, those written in pure C and others) do not make use of these internal Rust
32+
environment locks, however, and instead use their own locks, or unprotected raw access to `libc`'s
33+
`getenv`, `setenv`, or even worse, `char** environ`.
34+
35+
When these methods in `openssl-probe` (or that matter, any other pure Rust code calling `std::env::set_env`)
36+
are called while other threads are active and accessing the environment, it
3037
may cause other threads to access dangling environment pointers in the cases where the underlying
3138
environment data is moved or resized in response to an additional environment variable being
3239
added, or a variable's contents being enlarged.

0 commit comments

Comments
 (0)