Simple and precise static analysis of untrusted Linux kernel extensions

Elazar Gershuni, Nadav Amit, A. Gurfinkel, Nina Narodytska, J. Navas, N. Rinetzky, L. Ryzhyk, Shmuel Sagiv
{"title":"Simple and precise static analysis of untrusted Linux kernel extensions","authors":"Elazar Gershuni, Nadav Amit, A. Gurfinkel, Nina Narodytska, J. Navas, N. Rinetzky, L. Ryzhyk, Shmuel Sagiv","doi":"10.1145/3314221.3314590","DOIUrl":null,"url":null,"abstract":"Extended Berkeley Packet Filter (eBPF) is a Linux subsystem that allows safely executing untrusted user-defined extensions inside the kernel. It relies on static analysis to protect the kernel against buggy and malicious extensions. As the eBPF ecosystem evolves to support more complex and diverse extensions, the limitations of its current verifier, including high rate of false positives, poor scalability, and lack of support for loops, have become a major barrier for developers. We design a static analyzer for eBPF within the framework of abstract interpretation. Our choice of abstraction is based on common patterns found in many eBPF programs. We observed that eBPF programs manipulate memory in a rather disciplined way which permits analyzing them successfully with a scalable mixture of very-precise abstraction of certain bounded regions with coarser abstractions of other parts of the memory. We use the Zone domain, a simple domain that tracks differences between pairs of registers and offsets, to achieve precise and scalable analysis. We demonstrate that this abstraction is as precise in practice as more costly abstract domains like Octagon and Polyhedra. Furthermore, our evaluation, based on hundreds of real-world eBPF programs, shows that the new tool generates no more false alarms than the existing Linux verifier, while it supports a wider class of programs (including programs with loops) and has better asymptotic complexity.","PeriodicalId":441774,"journal":{"name":"Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation","volume":"214 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-06-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"56","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3314221.3314590","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 56

Abstract

Extended Berkeley Packet Filter (eBPF) is a Linux subsystem that allows safely executing untrusted user-defined extensions inside the kernel. It relies on static analysis to protect the kernel against buggy and malicious extensions. As the eBPF ecosystem evolves to support more complex and diverse extensions, the limitations of its current verifier, including high rate of false positives, poor scalability, and lack of support for loops, have become a major barrier for developers. We design a static analyzer for eBPF within the framework of abstract interpretation. Our choice of abstraction is based on common patterns found in many eBPF programs. We observed that eBPF programs manipulate memory in a rather disciplined way which permits analyzing them successfully with a scalable mixture of very-precise abstraction of certain bounded regions with coarser abstractions of other parts of the memory. We use the Zone domain, a simple domain that tracks differences between pairs of registers and offsets, to achieve precise and scalable analysis. We demonstrate that this abstraction is as precise in practice as more costly abstract domains like Octagon and Polyhedra. Furthermore, our evaluation, based on hundreds of real-world eBPF programs, shows that the new tool generates no more false alarms than the existing Linux verifier, while it supports a wider class of programs (including programs with loops) and has better asymptotic complexity.
对不可信的Linux内核扩展进行简单而精确的静态分析
扩展伯克利包过滤器(eBPF)是一个Linux子系统,它允许在内核中安全地执行不受信任的用户定义扩展。它依靠静态分析来保护内核免受错误和恶意扩展的侵害。随着eBPF生态系统的发展以支持更复杂和多样化的扩展,其当前验证器的局限性,包括高误报率、差的可伸缩性和缺乏对循环的支持,已经成为开发人员的主要障碍。在抽象解释的框架下,设计了一个eBPF静态分析器。我们对抽象的选择是基于在许多eBPF程序中发现的常见模式。我们观察到eBPF程序以一种相当有纪律的方式操作内存,这种方式允许通过对某些有界区域的非常精确的抽象和对内存其他部分的粗略抽象的可扩展混合来成功地分析它们。我们使用区域域,一个简单的域,跟踪寄存器和偏移量对之间的差异,以实现精确和可扩展的分析。我们证明,这种抽象在实践中与更昂贵的抽象领域(如八边形和多面体)一样精确。此外,我们基于数百个真实世界的eBPF程序的评估表明,新工具不会比现有的Linux验证器产生更多的假警报,同时它支持更广泛的程序类别(包括带有循环的程序),并且具有更好的渐近复杂性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
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学术文献互助群
群 号:481959085
Book学术官方微信