Skip to content

Representation of DSTs and fat pointers #315

Description

@danielsn

Rust allows user-defined objects to contain a single dynamically sized field, similar to how C supports flexible arrays as the final field of a struct. Although this feature is not conceptually complicated, its implementation involves many corner cases.

Likelihood:

We have repeatedly run into cases where new RMC tests failed due to unexpected corner-cases involving dynamically sized objects. We have solved all known issues, but the rate of bug discovery in this area to date suggests that there are additional latent bugs.

Mitigation:

  • The CBMC type-system has been effective in detecting issues caused by incorrectly handling dynamically sized objects.

Path to soundness:

  • Develop a detailed doc formally specifying how Rust handles dynamically sized types.
  • A full audit of the responsible code, ideally with a member of the Rust compiler team

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[C] InternalTracks some internal work. I.e.: Users should not be affected.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions