LwRustIP: Memory-safe and efficient embedded networking stack with ownership semantics

IF 9 Q2 COMPUTER SCIENCE, INFORMATION SYSTEMS
High-Confidence Computing Pub Date : 2026-03-01 Epub Date: 2025-09-09 DOI:10.1016/j.hcc.2025.100351
Guangyong Shang , Guangpeng Qi , Jianing Ren , Xianqi Jin , Wanjiang Shen , Junchao Li , Xiuzhen Cheng , Runyu Pan
{"title":"LwRustIP: Memory-safe and efficient embedded networking stack with ownership semantics","authors":"Guangyong Shang ,&nbsp;Guangpeng Qi ,&nbsp;Jianing Ren ,&nbsp;Xianqi Jin ,&nbsp;Wanjiang Shen ,&nbsp;Junchao Li ,&nbsp;Xiuzhen Cheng ,&nbsp;Runyu Pan","doi":"10.1016/j.hcc.2025.100351","DOIUrl":null,"url":null,"abstract":"<div><div>As modern embedded systems are increasingly network connected, their protocol stacks expose themselves as a surface that is frequently attacked. While C-based implementations such as <em>LwIP</em> are efficient, their lack of memory safety induces critical vulnerabilities such as buffer overflows, dangling pointers, and use-after-free, leading to remote code execution or privilege escalation. In this paper, we present <span>LwRustIP</span>, a memory-safe embedded networking stack reimplemented in Rust and compatible with <em>LwIP</em>. We also share our development experience. <span>LwRustIP</span> replaces unsafe linked-list memory management with a custom allocator that honors the Rust ownership semantics, leverages zero-copy techniques for inter-layer packet handoffs, and applies lock-free object pools for concurrent buffer management. These design choices ensure memory safety while maintaining performance comparable to traditional C-based implementations. We deploy <span>LwRustIP</span> on ARM-based embedded platforms and evaluate its correctness, performance, and memory safety. Experimental results show that <span>LwRustIP</span> achieves memory safety without incurring measurable performance overhead compared to the original C-based implementation. Our experience highlights the practical challenges and benefits of using Rust for low-level system components and offers guidance for future efforts in memory-safe reengineering of legacy C codebases.</div></div>","PeriodicalId":100605,"journal":{"name":"High-Confidence Computing","volume":"6 1","pages":"Article 100351"},"PeriodicalIF":9.0000,"publicationDate":"2026-03-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"High-Confidence Computing","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S2667295225000558","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2025/9/9 0:00:00","PubModel":"Epub","JCR":"Q2","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0

Abstract

As modern embedded systems are increasingly network connected, their protocol stacks expose themselves as a surface that is frequently attacked. While C-based implementations such as LwIP are efficient, their lack of memory safety induces critical vulnerabilities such as buffer overflows, dangling pointers, and use-after-free, leading to remote code execution or privilege escalation. In this paper, we present LwRustIP, a memory-safe embedded networking stack reimplemented in Rust and compatible with LwIP. We also share our development experience. LwRustIP replaces unsafe linked-list memory management with a custom allocator that honors the Rust ownership semantics, leverages zero-copy techniques for inter-layer packet handoffs, and applies lock-free object pools for concurrent buffer management. These design choices ensure memory safety while maintaining performance comparable to traditional C-based implementations. We deploy LwRustIP on ARM-based embedded platforms and evaluate its correctness, performance, and memory safety. Experimental results show that LwRustIP achieves memory safety without incurring measurable performance overhead compared to the original C-based implementation. Our experience highlights the practical challenges and benefits of using Rust for low-level system components and offers guidance for future efforts in memory-safe reengineering of legacy C codebases.
LwRustIP:具有所有权语义的内存安全和高效的嵌入式网络堆栈
随着现代嵌入式系统越来越多地与网络连接,它们的协议栈暴露为一个经常受到攻击的表面。尽管基于c的实现(如LwIP)是高效的,但它们缺乏内存安全性会导致严重的漏洞,例如缓冲区溢出、悬空指针和free后使用,从而导致远程代码执行或特权升级。在本文中,我们提出了LwRustIP,一个内存安全的嵌入式网络堆栈,在Rust中重新实现,并与LwIP兼容。我们也分享我们的开发经验。LwRustIP用一个遵循Rust所有权语义的自定义分分器取代了不安全的链表内存管理,利用零复制技术实现层间数据包传递,并为并发缓冲区管理应用无锁对象池。这些设计选择确保了内存安全,同时保持了与传统的基于c的实现相当的性能。我们将LwRustIP部署在基于arm的嵌入式平台上,并评估其正确性、性能和内存安全性。实验结果表明,与原始的基于c的实现相比,LwRustIP在不产生可测量的性能开销的情况下实现了内存安全性。我们的经验强调了在底层系统组件中使用Rust的实际挑战和好处,并为将来对遗留C代码库进行内存安全重构提供了指导。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
CiteScore
4.70
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书