Existing language-based information-flow control (IFC) tools face a fundamental tension: Denning-style systems that track explicit and implicit flows at the variable level typically require compiler modifications, while more coarse-grained approaches, including recent work Cocoon, avoid compiler changes but impose more restrictive programming models. We present Filament, a Denning-style static IFC library for Rust that requires no compiler modifications. Filament addresses three key challenges in building a practical IFC library for Rust. First, it enables fine-grained explicit-flow checking with minimal annotation overhead by leveraging Rust's type inference. Second, it introduces pc_block!, a lightweight construct for enforcing implicit flows via a compile-time program counter label, without requiring compiler support. Third, it provides fcall! and mcall! macros to support seamless and safe interoperability with standard and third-party libraries. Our evaluation shows that Filament incurs negligible compile-time overhead and requires only modest annotations. Moreover, compared to Cocoon, Filament offers a more permissive programming model, reducing the need for frequent escape hatches that bypass security checks.
翻译:摘要:现有的基于语言的信息流控制(IFC)工具面临一个根本性矛盾:在变量级别追踪显式和隐式流的丹宁风格系统通常需要修改编译器,而更粗粒度的方法(包括近期工作Cocoon)虽避免了编译器改动,却强加了更受限的编程模型。我们提出Filament——一个用于Rust的丹宁风格静态IFC库,无需编译器修改。Filament解决了为Rust构建实用IFC库的三个关键挑战。首先,它通过利用Rust的类型推断,以最小的标注开销实现细粒度显式流检查。其次,它引入pc_block!这一轻量级构造,在编译时通过程序计数器标签强制执行隐式流,而无需编译器支持。第三,它提供fcall!和mcall!宏,支持与标准库及第三方库的无缝安全互操作。我们的评估表明,Filament仅产生可忽略的编译时开销,且仅需适度标注。此外,与Cocoon相比,Filament提供更宽松的编程模型,减少了绕过安全检查的频繁跳板机制的需求。