Skip to content

Linking may not follow Rust rules #303

Closed

Description

@danielsn

RMC compiles each Rust crate to a goto binary, and then uses the CBMC linker to link those binaries together. It is possible that the CBMC and Rust linkers may make different decisions, particularly in the case of either duplicated or missing symbols.

Likelihood:

  • We know of at least two regressions that fail due to missing functions at link time
  • We have a workaround for duplicated function symbols (due to inlining). This workaround appears to work for all known cases, but there may well be corner cases we have not yet encountered.
  • Linking is known to be broken in RMC in cases where one crate overrides another

Mitigation:

  • Alarm on CBMC warnings.

Path to soundness:

  • Develop a formal model of Rust linking, and confirm that CBMC linking is compatible.
  • Add additional sanity checks to the CBMC linker.

Documentation:

Activity

  1. added this to the Soundness milestone on Jul 8, 2021
  2. zhassan-aws commented on Apr 19, 2022

    @zhassan-aws
    Contributor

    May be incomplete, but there are no known soundness issues.

  3. tedinski commented on Nov 14, 2022

    @tedinski
    Contributor

    @danielsn With the new linker, is this still an issue?

  4. added
    T-CBMC
    on Oct 2, 2024
  5. added
    [F] Soundness
    on Mar 27, 2026
  6. feliperodri commented on Nov 5, 2026

    @feliperodri
    Member

    Superseded: the MIR linker (default since fc43543, stable in b558eff) resolves Rust symbols in the compiler. goto-cc now only links --c-lib inputs. Reopen with a repro.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-CBMC[F] Soundness

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions