Thetis: A Booster for Building Safer Systems Using the Rust Programming Language

Author:

Jiang Renshuang1,Dong Pan1,Ding Yan1,Wei Ran2,Jiang Zhe3

Affiliation:

1. College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China

2. Department of Engineering, University of Cambridge, Cambridge CB2 1PZ, UK

3. Department of Computer Science and Technology, University of Cambridge, Cambridge CB3 0FD, UK

Abstract

Rust is a new system-level programming language that prioritizes performance, safety, and productivity. However, as evidenced in many previous works, unsafe code fragments broadly exist in Rust projects. The use of these unsafe fragments can fundamentally violate the safety of systems developed using the programming language. In response to this problem, we propose a novel methodology (Thetis) to enhance the safety capability of Rust. The core idea of Thetis is to reduce unsafe code, encapsulate unsafe code using safety rules, and make it easier to verify unsafe code through formal means. The proposed methodology involves three main components. In the context of Rust itself, Thetis combines replacement and encapsulation for Interior Unsafe segments, minimizing unsafe fragments and reducing unsafe operations and their range. For systems developed using Rust, new ACSL formal statutes are applied to reduce the unsafe potential of the encapsulated Interior Unsafe segments, enhancing the safety of the system. Regarding the development life cycle in Rust, Thetis introduces automatic defect detection and optimization based on feature extraction, improving engineering efficiency. We demonstrate the effectiveness of Thetis by using it to fix defects in BlogOS and ArceOS. The experimental results reveal that Thetis reduces the number of unsafe operations in these OSs by 40% and 45%, respectively. The use of Miri to detect and eliminate defects in ArceOS reduces the likelihood of undefined behavior by about 50%, which effectively demonstrates that the proposed method can improve the safety of the Rust system. In addition, performance test results from LMbench show that the performance loss caused by Thetis is only 1.076%, thereby maintaining the high-performance characteristics of the Rust system.

Funder

National Natural Science Foundation of China

Pre-Research Project

Publisher

MDPI AG

Subject

Fluid Flow and Transfer Processes,Computer Science Applications,Process Chemistry and Technology,General Engineering,Instrumentation,General Materials Science

Reference62 articles.

1. Gens, D., Schmitt, S., Davi, L., and Sadeghi, A.-R. (2018, January 18–21). K-Miner: Uncovering Memory Corruption in Linux. Proceedings of the 25th Annual Network and Distributed System Security Symposium, NDSS 2018, San Diego, CA, USA.

2. Research Situation and Prospects of Operating System Virtualization;Wu;J. Comput. Res. Dev.,2019

3. (2019, May 30). Concurrency in Operating System. Available online: https://www.geeksforgeeks.org/concurrency-in-operating-system/.

4. (2023, November 13). Memory Management. Available online: https://www.tutorialspoint.com/operating_system/os_memory_management.htm.

5. Nagarakatte, S.G. (2012). Practical Low-Overhead Enforcement of Memory Safety for C Programs, University of Pennsylvania.

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3