arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2503.00404cs.PLcs.CR
收藏

SecRef*:在 F* 中安全共享已验证与未验证代码间的可变引用

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

Cezar-Constantin Andrici, Danel Ahman, Catalin Hritcu, Ruxandra Icleanu, Guido Martínez, Exequiel Rivas, Théo Winterhalter

AI总结:

提出 SecRef* 安全编译框架,通过跟踪引用可共享性并利用高阶合约进行动态检查,确保 F* 中已验证程序与未验证代码间的健全且安全的互操作性。

摘要:

我们引入了 SecRef*,这是一个安全的编译框架,用于保护在 F* 中验证的有状态程序免受链接的未验证代码的威胁,程序与该未验证代码动态共享 ML 风格的可变引用。为了简化这种设置下的程序验证,我们提出了一种方法来跟踪哪些引用可以与未验证代码共享,哪些不可共享,从而保证其内容在调用未验证代码后保持不变。不可共享引用的这一通用属性在接口中暴露,已验证程序在调用未验证代码时可以依赖此接口。已验证代码期望从未验证代码获得的剩余细化类型以及前置和后置条件,通过使用高阶合约转换为对共享引用的动态检查。我们在 F* 中形式化证明了该策略确保了与未验证代码的健全且安全的互操作性。由于 SecRef* 构建于 F* 的 Monotonic State 效应之上,这些证明依赖于该效应的第一个单子表示,这是我们工作的一项贡献,可能具有独立的意义。最后,我们使用 SecRef* 构建了一个简单的协作式多线程调度器,该调度器经过验证,并能与未验证线程安全交互。

英文摘要:

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 propose a way of tracking 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑