You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: arewesafetycriticalyet.org/docs/main/intro.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ The following evaluation examines how well specific safety-standard requirements
34
34
35
35
🟡 Achievable with moderate additional effort
36
36
37
-
Rust's core language features-memory safety, strong typing, and data race prevention provide excellent basis for ISO 26262 compliance. However, critical gaps exist in qualified tools, control/data flow analysis, and qualified RTOS/HAL/PAC support. These require individual qualification efforts and are barriers for production use.
37
+
Rust's core language features - memory safety, strong typing, and data race prevention - provide excellent basis for ISO 26262 compliance. However, critical gaps exist in qualified tools, control/data flow analysis, and qualified RTOS/HAL/PAC support. These require individual qualification efforts and are barriers for production use.
38
38
39
39
[Detailed Rust vs. ISO 26262 gap analysis](iso26262.md)
Copy file name to clipboardExpand all lines: arewesafetycriticalyet.org/docs/main/iso26262.md
+25-17Lines changed: 25 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
4
4
# ISO 26262 vs. Rust Gap Analysis
5
5
6
6
ISO 26262 is a standard comprising 12 parts, covering Vocabulary, Management, System-, Hardware-, and Software-Level, as well as supporting processes and general guidelines.
7
-
Compliance to the standard can be claimed by fulfilling each single requirement, unless it has been tailored according to part 2 or a sound technical rationale is given.
7
+
Compliance with the standard can be claimed by fulfilling each single requirement, unless it has been tailored according to part 2 or a sound technical rationale is given.
8
8
9
9
The following analysis evaluates specifically the readiness of Rust to meet the requirements of Part 6: "Product development at the software level.", following the software reference phase model (V-Model) and corresponding clauses. The structure is based around the normative tables and an additional section on "general considerations" for each clause. These considerations are derived from practical experience and address indirect requirements or ecosystem constraints - while not explicitly mentioned in the standard, they are critical for successful implementation.
10
10
@@ -16,7 +16,7 @@ Contributions and corrections are welcome via [pull request](https://github.com/
16
16
17
17
**Note:** Where specific tools are referenced below, a comprehensive curated list is maintained [by the Tooling subcommittee](https://github.com/rustfoundation/safety-critical-rust-consortium/tree/main/subcommittee/tooling/tool-list).
18
18
19
-

19
+

20
20
21
21
### 🟢 6-5 General topics for the product development at the software level
22
22
@@ -37,7 +37,7 @@ Table 1 — Topics to be covered by modelling and coding guidelines
37
37
**General considerations:**
38
38
39
39
- Rust achieves requirement 5.4.2 The criteria that shall be considered when selecting a design, modelling or programming language are: 🟢
40
-
- an unambiguous and comprehensible definition; 🟢
40
+
- an unambiguous and comprehensible definition, by the Ferrocene Language Specification; 🟢
41
41
- suitability for specifying and managing safety requirements according to ISO 26262-8:2018 if modelling is used for requirements engineering and management; ⚪ (no model-based Rust code generation available)
42
42
- support the achievement of modularity, abstraction and encapsulation; and 🟢
43
43
- support the use of structured constructs. 🟢
@@ -64,8 +64,8 @@ This clause is not impacted by the programming language choice much.
| ID | Principle | Solution: Rust Native or Tool | Readiness |
77
77
| :--- | :--- | :--- | :--- |
78
-
|**1a**| Appropriate hierarchical structure of the software components | (Architecture) **encouraged** by Rusts module system (`mod` hierarchy) and visibility rules (pub, pub(crate)) | 🟢 |
78
+
|**1a**| Appropriate hierarchical structure of the software components | (Architecture) **encouraged** by Rust's module system (`mod` hierarchy) and visibility rules (pub, pub(crate)) | 🟢 |
79
79
|**1b**| Restricted size and complexity of software components | (Architecture) **neutral** Rust does not impose this logical design constraint | ⚪ |
80
80
|**1c**| Restricted size of interfaces | (Architecture) **neutral** Rust does not impose this logical design constraint | ⚪ |
81
81
|**1d**| Strong cohesion within each software component | (Architecture) **neutral** Rust does not impose this logical design constraint | ⚪ |
@@ -92,18 +92,18 @@ Table 4 — Methods for the verification of the software architectural design
92
92
|**1a**| Walk-through of the design | (Process) **improved** by Rust's explicit ownership annotations, error handling (Result/Option), and type signatures make control flow and data dependencies easier visible | 🟢 |
93
93
|**1b**| Inspection of the design | (Process) **improved** see entry 1a. | 🟢 |
94
94
|**1c**| Simulation of dynamic behavior of the design | (Tools) **not available** no Rust-specific architectural simulation tool exists. Standard approaches (software-in-the-loop testing, hardware emulation via Renode) work | 🟡 |
95
-
|**1d**| Prototype generation | (Process) **neutral** no specific gap |🟢|
95
+
|**1d**| Prototype generation | (Process) **neutral** no specific gap |⚪|
96
96
|**1e**| Formal verification | (Tools) **partially available** unqualified tools exist, e.g. creusot or kani | 🟡 |
97
-
|**1f**| Control flow analysis | (Tools) **partially available** at MIR-level e.g. by llvm-flow | 🟡 |
97
+
|**1f**| Control flow analysis | (Tools) **partially available** at MIR-level by e.g. llvm-flow | 🟡 |
98
98
|**1g**| Data flow analysis | (Tools) **not available**| 🔴 |
@@ -122,13 +122,13 @@ Table 6 — Design principles for software unit design and implementation
122
122
| ID | Principle | Solution: Rust Native or Tool | Readiness |
123
123
| :--- | :--- | :--- | :--- |
124
124
|**1a**| One entry and one exit point in subprograms and functions | (Architecture) **possible, not encouraged** Rust idiomatically uses early returns and the ? operator for error propagation, resulting in multiple exit points. This is widely considered safer than deeply nested single-return patterns, as each exit point has explicit type-checked error handling. An assessor may accept this with justification; if not, a custom clippy lint or coding guideline can restrict it. | 🟢 |
125
-
|**1b**| No dynamic objects or variables, or else online test during their creation | (Architecture) **encouraged** by no_std Rust without a global allocator statically guarantees the absence of heap allocation at compile time. For cases requiring dynamic-like containers, the heapless crate provides fixed-capacity collections. With a global allocator enabled, a fallible allocation API exists (try_reserve), but online testing of allocation failure remains the developer's responsibility. | 🟢 |
125
+
|**1b**| No dynamic objects or variables, or else online test during their creation | (Architecture) **encouraged** by no_std Rust without a global allocator statically guarantees the absence of heap allocation at compile time. For cases requiring dynamic-like containers, the heapless crate provides fixed-capacity collections. With a global allocator enabled, a fallible allocation API exists (try_reserve), but online testing of allocation failure remains the developer's responsibility (and would require qualification). | 🟢 |
|**1d**| No multiple use of variable names | (Language) **inherent** Rust encourages variables shadowing, but clippy can disallow it (clippy::shadow_reuse) | 🟢 |
128
128
|**1e**| Avoid global variables or else justify their usage | (Language) **inherent** feature of safe Rust, mutable global variables are considered unsafe | 🟢 |
129
-
|**1f**| Restricted use of pointers | (Language) **inherent** feature of safe Rust,| 🟢 |
130
-
|**1g**| No implicit type conversions | (Language) **inherent** enforced of safe Rust | 🟢 |
131
-
|**1h**| No hidden data flow or control flow |**largely inherent** as Rust prevents most sources of hidden data flow: no global mutable state without explicit synchronization, no implicit type conversions, no pointer aliasing. Control flow is explicit | 🟡 |
129
+
|**1f**| Restricted use of pointers | (Language) **inherent** feature of safe Rust | 🟢 |
130
+
|**1g**| No implicit type conversions | (Language) **inherent** enforced in safe Rust | 🟢 |
131
+
|**1h**| No hidden data flow or control flow |**largely inherent** as Rust prevents most sources of hidden data flow: no global mutable state without explicit synchronization, no implicit type conversions, no pointer aliasing. Control flow is explicit. The usage of macros can generate hidden control flow.| 🟡 |
132
132
|**1i**| No unconditional jumps | (Language) **inherent** feature of Rust: no goto support | 🟢 |
133
133
|**1j**| No recursions | (Architecture) **statically enforceable** Rust allows recursions. Rule should be enforced by static checks and no clippy lint exists so far | 🟡 |
134
134
@@ -149,6 +149,12 @@ Table 6 — Design principles for software unit design and implementation
149
149
- Foreign RTOS integration (VxWorks, QNX, Zephyr): Supported via C ABI/FFI.
150
150
- Panic Handling 🟢
151
151
- A panic_handler must be defined to reset the system safely
152
+
- Unsafe code management 🟡
153
+
- Rust's safety guarantees (memory safety, data race freedom) hold only for safe Rust; unsafe blocks opt out of compiler checks
154
+
- Embedded Rust typically requires unsafe for hardware register access, interrupt handlers, and FFI to C libraries
155
+
-`#[forbid(unsafe_code)]` can be used at module/crate level to guarantee absence of unsafe in application-level code
156
+
- Tools exist to audit unsafe usage (e.g. `cargo-geiger`) but are not qualified
157
+
- A formal unsafe usage and justification policy (analogous to MISRA deviation management) is needed
152
158
153
159
### 🟡 6-9 Software unit verification
154
160
@@ -162,7 +168,7 @@ Table 7 — Methods for software unit verification
162
168
|**1d**| Semi-formal verification | (Tools) **partially available** Semi-formal verification includes methods like systematic test derivation from semi-formal specifications (e.g. state machines, decision tables). Rust's enum + match exhaustiveness checking provides compiler-verified state machine completeness — a lightweight form of semi-formal verification built into the language. For test generation from external UML or SysML specifications, no Rust-specific tooling exists | 🟡 |
163
169
|**1e**| Formal verification | (Tools) **partially available** unqualified tools exist, e.g. creusot or kani, but quality unknown | 🟡 |
164
170
|**1f**| Control flow analysis | (Tools) **partially** The Rust compiler builds and analyzes a control flow graph (MIR) for every function on every compilation. Miri can detect undefined behavior along execution paths. Binary-level CFA tools (e.g. AbsInt aiT) exist | 🟡 |
165
-
|**1g**| Data flow analysis | (Tools) **partially** The borrow checker tracks variable definitions, uses, moves, and borrows. Miri extends this into unsafe code. No traditional DFA tool exists | 🟡 |
171
+
|**1g**| Data flow analysis | (Tools) **partially** The borrow checker tracks variable definitions, uses, moves, and borrows. Miri extends this into unsafe code - but no reports are generated. No traditional DFA tool exists | 🟡 |
|**1i**| Static analyses based on abstract interpretation | (Tools) **not available** lacking support for tools like Polyspace or Astree | 🔴 |
168
174
|**1j**| Requirements-based test | (Tools) **available** cargo test handles execution. Traceability to requirements requires tool as e.g. sphinx-needs or mantra | 🟢 |
@@ -185,7 +191,7 @@ Table 9 — Structural coverage metrics at the software unit level
185
191
186
192
- Coverage instrumentation for embedded targets 🔴
187
193
- Host-based: LLVM source coverage works on x86/ARM Linux.
188
-
- embedded Target: no direct instrumentation to measure code-coverage available
194
+
- embedded target: no direct instrumentation to measure code-coverage available
189
195
- Binary-level coverage via hardware trace (ETM/ITM + Lauterbach) is language-independent but requires hardware-support and tooling.
190
196
- General test tooling and report generation 🟡
191
197
- test runner inherent feature by cargo test
@@ -223,6 +229,8 @@ For general testing-related considerations see 6-9, no specifics for integration
223
229
224
230
### 🟡 6-11 Testing of the embedded software
225
231
232
+
Table 13 on the verification of the software safety requirements specification is omitted, because it has no direct impact from the programming language choice.
233
+
226
234
Table 14 — Methods for tests of the embedded software
227
235
228
236
| ID | Method | Solution: Rust Native or Tool | Readiness |
@@ -245,7 +253,7 @@ Table C.1: Mechanisms for the detection of unintended changes of data
245
253
### 🔴 8 Supporting Processes
246
254
247
255
- 11 Tool Qualification 🔴
248
-
- Tools being used during the development/operation need to have undergone Tool Qualification as per ISO 26262-8 clause 11)
256
+
- Tools being used during the development/operation need to have undergone Tool Qualification as per ISO 26262-8 clause 11
249
257
- Most of the open source tools mentioned before are not qualified
250
258
- Where not (sufficiently) available, this has to be individually performed based on the usage context
0 commit comments