当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Interface Compliance of Inline Assembly: Automatically Check, Patch and Refine
arXiv - CS - Programming Languages Pub Date : 2021-02-15 , DOI: arxiv-2102.07485
Frédéric Recoules, Sébastien Bardin, Richard Bonichon, Matthieu Lemerre, Laurent Mounier, Marie-Laure Potet

Inline assembly is still a common practice in low-level C programming, typically for efficiency reasons or for accessing specific hardware resources. Such embedded assembly codes in the GNU syntax (supported by major compilers such as GCC, Clang and ICC) have an interface specifying how the assembly codes interact with the C environment. For simplicity reasons, the compiler treats GNU inline assembly codes as blackboxes and relies only on their interface to correctly glue them into the compiled C code. Therefore, the adequacy between the assembly chunk and its interface (named compliance) is of primary importance, as such compliance issues can lead to subtle and hard-to-find bugs. We propose RUSTInA, the first automated technique for formally checking inline assembly compliance, with the extra ability to propose (proven) patches and (optimization) refinements in certain cases. RUSTInA is based on an original formalization of the inline assembly compliance problem together with novel dedicated algorithms. Our prototype has been evaluated on 202 Debian packages with inline assembly (2656 chunks), finding 2183 issues in 85 packages -- 986 significant issues in 54 packages (including major projects such as ffmpeg or ALSA), and proposing patches for 92% of them. Currently, 38 patches have already been accepted (solving 156 significant issues), with positive feedback from development teams.

中文翻译:

内联装配的接口合规性:自动检查,修补和优化

内联汇编仍然是低级C编程中的一种常见做法,通常是出于效率原因或访问特定硬件资源的考虑。GNU语法中的此类嵌入式汇编代码(由主要编译器(如GCC,Clang和ICC等)支持)具有一个接口,用于指定汇编代码如何与C环境交互。为简单起见,编译器将GNU内联汇编代码视为黑盒,并且仅依赖于它们的接口将它们正确地粘贴到已编译的C代码中。因此,程序集块及其接口之间的充分性(称为合规性)是最重要的,因为此类合规性问题可能导致细微且难以发现的错误。我们建议使用RUSTInA,这是第一种用于正式检查内联装配符合性的自动化技术,在某些情况下具有提出(验证)补丁和(优化)优化的额外功能。RUSTInA基于内联程序装配问题的原始形式化以及新颖的专用算法。我们的原型在202个带有内联汇编的Debian软件包中进行了评估(2656个大块),在85个软件包中发现了2183个问题–在54个软件包中发现了986个重要问题(包括ffmpeg或ALSA等主要项目),并提出了92%的补丁建议。目前,已经接受了38个补丁程序(解决了156个重要问题),并获得了开发团队的积极反馈。我们的原型在202个带有内联汇编的Debian软件包中进行了评估(2656个大块),在85个软件包中发现了2183个问题–在54个软件包中发现了986个重要问题(包括ffmpeg或ALSA等主要项目),并提出了92%的补丁建议。目前,已经接受了38个补丁程序(解决了156个重要问题),并获得了开发团队的积极反馈。我们的原型在202个带有内联汇编的Debian软件包中进行了评估(2656个大块),在85个软件包中发现了2183个问题–在54个软件包中发现了986个重要问题(包括ffmpeg或ALSA等主要项目),并提出了92%的补丁建议。目前,已经接受了38个补丁程序(解决了156个重要问题),并获得了开发团队的积极反馈。
更新日期:2021-02-16
down
wechat
bug