Skip to content

Memory unsafety: data races in darwin.c  #106

@tmfink

Description

@tmfink

I've found the following data races in darwin.c:

  1. The static unsigned long long size is a mutable global that is read/modified without any synchronization.
    • static unsigned long long size = 0;
    • 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.
  2. static int skipvfs is mutable global that is racily initizialized in makevfslist().
    • static int skipvfs;
    • disk_info() is a public Rust function that can be directly called from safe Rust code

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