Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Rust FFI & C verification boundary #113

Open
4 tasks
podhrmic opened this issue Sep 25, 2024 · 2 comments
Open
4 tasks

[FEATURE] Rust FFI & C verification boundary #113

podhrmic opened this issue Sep 25, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request SoW TA2.1.1.C Develop CN specifications for components with rich code-level specifications.
Milestone

Comments

@podhrmic
Copy link
Collaborator

podhrmic commented Sep 25, 2024

Summary

Provide an example of Rust <-> C interface, such that the C portion of the code is verified with CN, and the Rust part is (ideally) verified with Verus (or similar - crux-mir or Kani) (see the use of Verus for seL4 Rust userspace here).

Consider the Rust part trusted while the C portion of code is untrusted. The main issue is marshaling complex datastructures, and tracking their ownership. This example uses vectors.

Ada/SPARK have FFI as well (see docs here), I am expecting that the C code will have similar concerns (ownership and complex data structures).

  • add CN specs to the vector example
  • consider how would Rust specs (Verus or similar) look like
  • document your progress
  • explore how (if at all) this approach would be different for Ada/SPARK

Relevant article from google about Rust in Android: https://security.googleblog.com/2024/09/eliminating-memory-safety-vulnerabilities-Android.html?m=1

@podhrmic podhrmic added enhancement New feature or request SoW TA2.1.1.C Develop CN specifications for components with rich code-level specifications. labels Sep 25, 2024
@podhrmic podhrmic added this to the MVP 3 milestone Sep 25, 2024
@podhrmic podhrmic modified the milestones: MVP 3, Next PI meeting Sep 27, 2024
@spernsteiner
Copy link
Contributor

One interesting candidate for this might be using a Rust implementation of some crypto primitive in the trusted boot or key management component. With crux-mir, it's possible to verify that the Rust implementation is equivalent to a Cryptol spec. We have examples of doing this for SHA256 and ChaCha20/Salsa20 somewhere (though they may be slightly bitrotted at this point).

@podhrmic
Copy link
Collaborator Author

podhrmic commented Nov 8, 2024

Note to @podhrmic - come up with 3 simple examples, and talk to Satiago about VSPELLs TA3 work

@podhrmic podhrmic assigned spernsteiner and unassigned spernsteiner Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SoW TA2.1.1.C Develop CN specifications for components with rich code-level specifications.
Projects
None yet
Development

No branches or pull requests

3 participants