Interface Compliance of Inline Assembly: Automatically Check, Patch and Refine

02/15/2021
by   Frédéric Recoules, et al.
0

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 already been accepted (solving 156 significant issues), with positive feedback from development teams.

READ FULL TEXT
research
05/05/2020

A new generation 99 line Matlab code for compliance Topology Optimization and its extension to 3D

Compact and efficient Matlab implementations of compliance Topology Opti...
research
03/15/2019

Get rid of inline assembly through trustable verification-oriented lifting

Formal methods for software development have made great strides in the l...
research
04/22/2022

Design of Adaptive Compliance Controllers for Safe Robotic Assembly

Insertion operations are a critical element of most robotic assembly ope...
research
11/10/2017

FunTAL: Reasonably Mixing a Functional Language with Assembly

We present FunTAL, the first multi-language system to formalize safe int...
research
02/19/2019

Improving dual-arm assembly by master-slave compliance

In this paper we show how different choices regarding compliance affect ...
research
04/15/2020

Modular-topology optimization with Wang tilings: An application to truss structures

Modularity is appealing for solving many problems in optimization. It br...

Please sign up or login with your details

Forgot password? Click here to reset