Canonical, in partnership with the University of Bristol, is investigating the use of automated tools to rewrite legacy C code into Rust. The primary goal is to achieve safe and maintainable Rust code without altering the original software's behavior. This research addresses the challenge of modernizing existing codebases while preserving functionality.
The research is testing the AI translation tool with AppArmor and snap-confine, both of which perform security-critical functions. AppArmor confines applications, and snap-confine creates sandboxed environments for snaps. These components were chosen to evaluate the translation process under high-stakes conditions, where errors could have significant security implications.
Canonical's proposed system uses language models to generate Rust code, followed by a verification process to detect and correct behavioral differences. The challenge lies not in generating code, but in proving that the translated code behaves identically to the original C code. Researchers plan to combine fuzzing with formal program analysis to identify discrepancies that traditional testing might miss.
When mismatches are detected, the system employs symbolic repair to diagnose failures and fix the code. A key focus is to minimize the overuse of 'unsafe' blocks in Rust, which allow operations not permitted in safe Rust and can reintroduce memory-safety risks present in C. The objective is to produce Rust code that is both memory-safe and functionally equivalent to the original C.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
Canonical is collaborating with the University of Bristol to research automated translation of legacy C code into Rust, focusing on ensuring behavioral equivalence and safety. This initiative aims to determine the feasibility and trustworthiness of AI-generated Rust code for critical systems like AppArmor and snap-confine.