It looks like this is meant to be an optimization but it is unsound since it is called directly from the public Rust function mem_info(). Multiple Rust threads could racily write to the global variable size.
static int skipvfs is mutable global that is racily initizialized in makevfslist().
I've found the following data races in
darwin.c
:static unsigned long long size
is a mutable global that is read/modified without any synchronization.mem_info()
. Multiple Rust threads could racily write to the global variablesize
.static int skipvfs
is mutable global that is racily initizialized inmakevfslist()
.disk_info()
is a public Rust function that can be directly called from safe Rust code