paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SecRef*: Securely Sharing Mutable References between Verified and Unverified Code in F*

SecRef*:在 F* 中安全共享已验证与未验证代码之间的可变引用
ICFP 9(ICFP)2025匹配度 2/10 · 论文属于程序验证/形式化方法,研究已验证与未验证代码间的安全互操作,但不涉及用户核心关注的 LLM/Agent、静态分析应用于 ML 系统、浮点程序分析或贝叶斯程序分析。仅在 PL/形式化验证的宽泛层面上与研究方向相邻。引用 1 inbox
Cezar-Constantin Andrici, Danel Ahman, Cătălin Hriţcu, Ruxandra Icleanu, Guido Martínez, Exequiel Rivas, Théo Winterhalter
crossref: 2026-09-10

AI 速览

一句话:SecRef* 框架让 F* 中已验证代码与未验证代码安全共享可变引用,并用契约与形式证明保证互操作可靠。

本文针对在 F* 中验证的有状态程序与链接的未验证代码动态共享 ML 风格可变引用时的安全性与可验证性问题。SecRef* 区分可与未验证代码共享的引用和不可共享引用:后者内容在调用未验证代码后保证不变,该通用性质被暴露给已验证程序。对于已验证代码期望未验证代码满足的 refinement types、前置与后置条件,框架通过高阶契约将其转换为对共享引用的动态检查。作者在 F* 中形式化证明该策略保证健全且安全的互操作。由于 SecRef* 建立在 F* 的 Monotonic State 效应之上,证明还依赖本文提出的该效应首个 monadic 表示,这一表示可独立使用。最后,作者实现了一个与未验证线程安全交互的协作式多线程调度器。

问题
如何在 F* 中将已验证的有状态程序与链接的未验证代码安全互操作,尤其是共享 ML 风格可变引用时,既保持安全编译保证,又不让验证负担过重。
方法
SecRef* 跟踪引用是否可与未验证代码共享,对不可共享引用利用其内容不变性质,并将期望的 refinement types 与前后条件经高阶契约转为对共享引用的动态检查;证明基于 F* Monotonic State 效应的新 monadic 表示。
评估
在 F* 中形式化证明该互操作策略的健全性与安全性,并用框架构造一个与未验证线程安全交互的协作式多线程调度器作为案例。
原文摘要(Abstract)

We introduce SecRef ★ , a secure compilation framework protecting stateful programs verified in F ★ against linked unverified code, with which the program dynamically shares ML-style mutable references. To ease program verification in this setting, we track which references are shareable with the unverified code, and which ones are not shareable and whose contents are thus guaranteed to be unchanged after calling into unverified code. This universal property of non-shareable references is exposed in the interface on which the verified program can rely when calling into unverified code. The remaining refinement types and pre- and post-conditions that the verified code expects from the unverified code are converted into dynamic checks about the shared references by using higher-order contracts. We prove formally in F ★ that this strategy ensures sound and secure interoperability with unverified code. Since SecRef ★ is built on top of the Monotonic State effect of F ★ , these proofs rely on the first monadic representation for this effect, which is a contribution of our work that can be of independent interest. Finally, we use SecRef ★ to build a simple cooperative multi-threading scheduler that is verified and that securely interacts with unverified threads.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot3056,
  title = {SecRef*: Securely Sharing Mutable References between Verified and Unverified Code in F*},
  author = {Cezar-Constantin Andrici and Danel Ahman and Cătălin Hriţcu and Ruxandra Icleanu and Guido Martínez and Exequiel Rivas and Théo Winterhalter},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {ICFP},
  year = {2025},
  doi = {10.1145/3747522}
}