一句话:通过类型不变式证明潜在不安全操作的安全性,实证表明 Rust、C# 与 Ada 可无运行时开销实现安全网络设备驱动。
底层系统代码开发者出于性能考虑常使用不安全的编程语言,由此引入安全语言本可避免的缺陷与漏洞。本文主张,借助类型不变式(type invariants)证明潜在不安全操作的安全性,可以在不引入运行时开销的前提下获得安全性。作者从实证角度出发,将这类特性扩展到 Rust 与 C# 中,用它们实现安全的网络设备驱动,并确认运行时无额外开销;同时指出 Ada 语言已经内建了这些特性。该工作说明安全与性能在低层系统编程中并非必然取舍,为在现有语言中引入零开销安全机制提供了可行路径。
Developers write low-level systems code in unsafe programming languages due to performance concerns. The lack of safety causes bugs and vulnerabilities that safe languages avoid. We argue that safety without run-time overhead is possible through type invariants that prove the safety of potentially unsafe operations. We empirically show that Rust and C# can be extended with such features to implement safe network device drivers without run-time overhead, and that Ada has these features already.