Lemix : Enabling Testing of Embedded Applications as Linux Applications

Sai Ritvik Tanksalkar, Siddharth Muralee, Srihari Danduri, Paschal Amusuo, Antonio Bianchi, James C Davis, Aravind Kumar Machiry · 2025

Read Lemix : Enabling Testing of Embedded Applications as Linux Applications by Sai Ritvik Tanksalkar, Siddharth Muralee, Srihari Danduri, Paschal Amusuo, Antonio Bianchi, James C Davis, Aravind Kumar Machiry (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-17588.txt.

Introduction

Testing embedded software usually demands faithful fake hardware, a bar that keeps rising as gadgets multiply. Sai Ritvik Tanksalkar and co-authors argue the bar is set wrong in this 2025 paper. Their study of reported bugs found most flaws live at high levels of the software, where exact hardware mimicry adds little. Chasing perfect emulation slows security work for marginal gain.

Their framework, LEMIX, rehosts embedded apps as ordinary Linux programs on standard chips. Dynamic analysis then runs at native speed and scale. The hypothesis is that exposure, not fidelity, finds bugs. Security teams drowning in device variety get a pragmatic path. The extended report lays out the evidence and the tool.

Catalog record

CREATORSai Ritvik Tanksalkar, Siddharth Muralee, Srihari Danduri, Paschal Amusuo, Antonio Bianchi, James C Davis, Aravind Kumar Machiry
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE93 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2503-17588

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Lemix : Enabling Testing of Embedded Applications as Linux Applications Sai Ritvik Tanksalkar, Siddharth Muralee, Srihari Danduri, Paschal Amusuo, Antonio Bianchi, James C Davis, Aravind Kumar Machiry Abstract Dynamic analysis, through rehosting, is an important capability for security assessment in embedded systems software. Existing rehosting techniques aim to provide high-fidelity execution by accurately emulating hardware and peripheral interactions. However, these techniques face challenges in adoption due to the increasing number of available peripherals and the complexities involved in designing emulation models for diverse hardware. Additionally, contrary to the prevailing belief that guides existing works, our analysis of reported bugs shows that high-fidelity execution is not required to expose most bugs in embedded software. Our key hypothesis is that security vulnerabilities are more likely to arise at higher abstraction levels. To substantiate our hypothesis, we introduce Lemix , a framework enabling dynamic analysis of embedded applications by rehosting them as x86 Linux applications decoupled from hardware dependencies. Enabling embedded applications to run natively on Linux facilitates security analysis using available techniques and takes advantage of the powerful hardware available on the Linux platform for higher testing throughput. We develop various techniques to address the challenges involved in converting embedded applications to Linux applications. We evaluated Lemix on 18 real-world embedded applications across four RTOSes and found 21 new bugs, in 12 of the applications and all 4 of the RTOS kernels. We report that Lemix is superior to existing state-of-the-art techniques both in terms of code coverage ( ∼ \sim 2X more coverage) and bug detection (18 more bugs). 1 Introduction Society’s dependence on low-powered MCU ( MCU ) based devices ( e.g., IoT devices), has significantly increased, controlling various aspects of our daily lives, including homes [ 17 ] , transportation [ 16 ] , traffic management [ 90 ] , and the distribution of vital resources like food [ 75 ] and power [ 72 ] . The adoption of these devices has seen rapid and extensive growth, with an estimated count of over 50 billion devices by the end of 2020 [ 15 ] . Vulnerabilities in the software controlling these devices have far-reaching consequences [ 18 , 101 ] due to the pervasive and interconnected nature of these devices, as exemplified by the infamous Mirai botnet [ 66 ] and more recent URGENT/11 [ 11 ] vulnerabilities. It is important to detect such vulnerabilities proactively. Various works [ 102 ] show that dynamic analysis, especially fuzzing [ 64 ] , is effective at vulnerability detection in web and desktop software. However, the dynamic analysis of embedded systems [ 41 ] is challenging [ 69 , 99 ] because of the close interaction with hardware and the lack of OS ( OS ) abstractions. The lack of robust and readily available dynamic analysis tools (comparable to those for x86 systems) further imposes engineering challenges. To mitigate this, rehosting [ 37 ] has emerged as an effective technique. By decoupling firmware from its hardware dependencies and enabling execution within an emulated environment, rehosting facilitates deeper exploration and analysis of embedded software without the constraints of physical hardware. Existing rehosting techniques mainly focus on achieving high-fidelity execution without hardware and focus on modeling peripheral interactions through manually created models [ 30 ] , pattern-based model generation [ 39 ] , or models built using machine learning techniques [ 91 , 44 ] . They depend on the availability of an MCU -specific ISA ( ISA ) emulator and require considerable engineering effort [ 100 ] to configure different peripherals. We hypothesize that this high-fidelity execution is not required for vulnerability detection, and a coarse approximation of program behavior is sufficient . We validate our hypothesis through a preliminary analysis of previously reported bugs (§ 3.2.2 ). We find that most bugs occur at higher software levels, and not within architecture-specific elements like inline assembly. Starting from this observation, in this paper, we present Lemix , a novel approach to rehost embedded applications as Linux applications (for x86), which we call LeApp s, with the goal of improving vulnerability detection capability in embedded software with minimal engineering effort. Lemix enables the use of dynamic analysis techniques readily available for Linux applications, such as sanitizers [ 84 ] on embedded applications. However, converting embedded applications to x86 Linux applications and enabling dynamic analysis poses challenges, i.e., preserving execution semantics, retargeting to different ISA , and handling peripheral interactions. We maintain execution semantics by leveraging the Linux Portable Layer, which comes as a part of most of the prevalent RTOSes (§ 4.1.1 ). We use an interactive refactoring approach (§ 4.1.2 ) to handle ISA retargeting. We tackle peripheral interactions (§ 4.1.4 ) by first identifying MMIO addresses through constant address analysis and using runtime instrumentation to feed peripheral data through standard input, thereby eliminating the need for precise peripheral models. We also weaken peripheral state-dependent conditions to improve code coverage, which is often limited by these conditions that are difficult for a fuzzer to bypass. To further improve testing, we apply a function-level fuzzing approach based on available research [ 59 , 71 ] that directly invokes the target function with appropriate arguments generated from the input. Taken together, these design choices form a novel rehosting methodology that enables efficient bug discovery in embedded applications without sacrificing practical effectiveness, as demonstrated by our findings. We evaluated Lemix on 18 real-world embedded applications ranging across four RTOSes, including FreeRTOS, Nuttx, Zephyr, and Threadx. These RTOSes support major semiconductor platforms like Qualcomm, NXP, Nordic [ 8 , 9 , 13 , 5 ] etc. We show that our approach can successfully convert applications to LeApp with only a little manual effort. We tested LeApp s by using whole-program fuzzing and function-level fuzzing and found 21 previously unknown bugs with 14 out of 18 applications effected by these bugs. Our ablation study shows that each of our techniques significantly contribute to the overall effectiveness of Lemix . Finally, comparative evaluation against the state-of-the-art approaches shows that Lemix is superior at improving code coverage ( \sim 2X more coverage) and bug detection (18 additional bugs). In summary, the following are our contributions: • We propose Lemix , an extensible framework to rehost embedded applications as x86 Linux applications ( i.e., LeApp s) without emulation or physical devices. • We design various analysis techniques to tackle challenges in maintaining execution semantics, retargeting, and handling peripheral interactions. We also design techniques to improve the testing and code-coverage of LeApp s. • We evaluated Lemix on 18 embedded applications across four RTOS and found 21 previously unknown bugs, most of which are confirmed and fixed by the corresponding vendors. • Our comparative evaluation against state-of-the-art approaches shows that Lemix is superior in code coverage and bug detection. Figure 1: Architecture of a Type-2 Embedded System and overview of Lemix approach to convert it to a Linux Application. 2 Background and Threat Model RTOS Low Fidelity High Fidelity FreeRTOS 20 2 Zephyr 26 7 RIOT 14 2 Total 60 (85%) 11 (15%) Table 1: Our analysis of the CVEs from the Rust4Embedded survey [ 6 ] , [ 85 ] indicates that 60 out of 71 (85%) require low-fidelity execution.

Read the complete text