High Assurance Rust: Developing Secure and Robust Software
highassurance.rs
highassurance.rs
Unfortunately I cannot take this very seriously, if it is completely ignorant of the Spark/Ada ecosystem and presents Rust as the "state of the art".
Rust has some nice properties, but there is an entire field of programming languages and compilers designed for building safety-critical software for aerospace and defense. Unfortunately, it looks like that is going to be forgotten, or rather, intentionally overwritten by ignorance.
7. Can I use Rust in safety-critical domains?
Not yet. Rust isn't certified for use in a safety-critical setting.Example of a beginning effort:
"KRust: A Formal Executable Semantics of Rust"'
You need Ada or other languages for that.
There's also been a decent amount of empirical research on MISRA C's effectiveness, most of which has shown that attempting compliance actually makes programmer-introduced faults more likely[1].
[1]: http://resolver.tudelft.nl/uuid:646de5ba-eee8-4ec8-8bbc-2c18...
Ada: It would be insane to provide a standard library full of dangerous sharp edges so we didn't do that.
pjmlp: See? Practically twins.
This is absolutely ridiculous. Having a process for making high assurance, robust systems is a extraordinary claim which requires the extraordinary evidence of repeated success at delivering such systems in real-life adversarial environments and succeeding at audits and verification efforts that are demonstrably passed only by robust systems. Anybody who has not reached that standard should not use the words “high assurance”, “robust”, or “secure” as they have no evidence of their claims and anything they say should be completely, 100% ignored.
It is frankly outrageous that people so far from that standard that they can not even point to a single system that anybody has done have the gall to use those words.
I don't particularly care whether a particular flavor of Rust (or C, for that matter) brands itself as "high-assurance," as long as it is not dishonestly claiming compliance with a particular domain's assurance or robustness requirements.
Huh?!
They said you can't build safety-critical software in Rust because it's not certified.
Not all high assurance software is safety-critical, not all correct software is certifiable, and FOR SURE not all certifiable software is correct.
> evidence of repeated success at delivering such systems in real-life adversarial environments and succeeding at audits and verification efforts that are demonstrably passed only by robust systems.
Can you name one such process? The old auto and aero software standards from the 90s/early aughts are crufty, have demonstrably failed on any number of occasions, and leave much to be desired.
(BTW, "verification" in those standards means something totally different from what "verification" means to software experts today.)
The Rust compiler and ecosystem would need a thorough audit before its use in safety-critical settings, but I have no doubt that this audit will happen and that when it does the evidence generated y that audit will blow way past the standards applied to MISRA C/Ada/etc.
And not fully solvable at only the software level.
[1] https://blog.adacore.com/adacore-and-ferrous-systems-joining...
You might have also seen the AUTOSTAR Rust in Automotive Working Group announcement recently[2].
[1]: https://github.com/PolySync/misra-rust/blob/master/MISRA-Rul...
[2]: for some reason the announcement was removed from the "News and events" site, https://webcache.googleusercontent.com/search?q=cache%3Ahttp... but it is still available as a PDF https://www.autosar.org/fileadmin/user_upload/20220308_RustW...
It would be great if AUTOSAR would encompass Rust as well, currently I think they are only evaluating it.
Though not an Ada expert, I have used the SPARK subset. And I’ve worked on security assessment of military systems with components written in Ada. Although we looked at binaries and not source code, because our assurance model did not consider the Ada compiler to be part of the chain of trust (so we test the artifact the CPU will execute). I really like Ada and hope to use more of it in the future!
The HN community may be interested in this 1 hour presentation [1] on Nvidia's adoption of Ada, including why they chose it over Rust in 2019 (regulatory certification was one factor). There’s also a great academic paper [2] on the recent advances SPARK has made in heap memory verification, inspired in part by Rust’s type system.
There are currently efforts underway to certify Rust for usage in safety critical systems via an alternate, certified toolchain (among other pieces of the puzzle). Two related initiatives are linked through in FAQ question #7 (which someone already shared). I’ll be sure to add the Ferrous Systems and AdaCore collaboration when I have a chance to batch together some updates.
I, like many others, believe Rust is a technology that can deliver value in safety and mission critical verticals due to reduction in undefined behavior via principled static analysis (a type system for which there has been early success in formal verification of safety claims[3]). Looking forward to digging into Rust research tools for deductive verification in a later chapter(similar to SPARK - hand-written Hoare logic specifications, proven via SMT solving at compile-time).
We make comparisons to C and C++ in the book because they are the closest relatable analog for many developers. But I’m happy to add mention of Ada to not alienate potential readers like yourself, though my Ada knowledge is not currently deep enough to provide in-depth comparison.
This book is a best effort and an early-stage passion project. It strives to be technically accurate and data driven while remaining approachable to a range of readers. Like others have mentioned on this thread, this book does not claim to provide guidance for adherence with any particular standard or certification process. Although Chapter 3 does map concepts from MISRA C 2012 to Rust, in order to remain grounded in realistic, industry-adopted best practices.
The goal is to help readers build more secure and reliable software in general, to the furthest extent possible using entirely open-source tools. I look forward to iterating the content to meet high standards of quality, while keeping the entirety of the book freely available online.
Always open to critique and suggestions, thanks again!
[1] https://www.youtube.com/watch?v=2YoPoNx3L5E
[2] https://www.adacore.com/uploads/techPapers/Safe-Dynamic-Memo...
I think this is a learning resource (and not, for example, a more formal set of tools to write "high assurance rust").
https://highassurance.rs/chp1/about_the_team.html
As a personal preference, I like to place the content front-and-center and not dwell on the individuals behind it :)
While the content aims to be generally applicable to a broad range of software, further contextualization against a specific standard like DO-178C might make for a valuable appendix section.
There's a bit of a balancing act, however, since Rust is, at present, not a certified choice for such use cases.
Have you ever used a language like Haskell in a formal verification environment? You still get memory issues but there are far less tools to tackle them.
This is a project with world-class resources for enforcing memory safety, and yet they regularly encounter this class of bugs.
C and C++ do not provide sufficient tools to prevent memory safety, and this has been demonstrated across basically every project they're used in.