Closed-source kernel modules create significant challenges for analysis, testing, and verification. Traditional approaches either require access to the device hardware state, rely on source code availability, or are limited to same-architecture virtualization with hardware acceleration. This thesis presents a novel approach that enables the testing of closed-source kernel modules in a cross-emulation environment, without requiring direct access to the physical hardware state. This enables the testing of closed-source kernel modules, coming from low performance machines (such as embedded systems), on high computational power machines; allowing the use of computational expensive techniques, such as fuzzing. Our methodology combines kernel-level instrumentation with targeted modifications to QEMU’s translation engine to capture and redirect interactions between the kernel module and a virtual device. These interactions are then forwarded to the real device hosted on a separate machine. This design makes it possible to pass the probing phase of kernel modules compiled for ARM 32-bit platforms while running on an x86-64 host system. This work addresses a key challenge often overlooked in the literature: the correct loading of closed-source kernel modules under different kernel configurations. This framework automates the extraction of dependencies, adapts the Linux kernel configuration when necessary, and builds a fully functional virtual environment for module execution. The results demonstrate that the proposed approach allows transparent execution of closed-source modules, accurate reproduction of their probing phase, and controlled redirection of their interactions to real hardware. Unlike previous works, which assume device hardware state availability or require hardware acceleration and same architecture setups, this methodology supports closed-source modules, cross-emulation, and hardware-in-the-loop integration simultaneously. This research highlights a new path for dynamic analysis of closed-source drivers and future work will explore extending this framework to additional bus types and integrating advanced techniques to test deep states in kernel modules.
I moduli kernel closed-source pongono nuove sfide circa analisi, testing e verifica. Gli approcci tradizionali richiedono l'accesso allo stato interno dell'hardware del dispositivo, si basano sulla presenza del codice sorgente o sono limitati dalla virtualizzazione, con acceleratori hardware, della stessa architettura. Il lavoro svolto consente il testing di moduli kernel closed-source con cross-emulazione, senza l'accesso allo stato interno dell'hardware. Questo permette di testare i moduli, originariamente compilati su macchine con basse performance (come sistemi embedded), su macchine con alta potenza computazionale; permettendo l'utilizzo di tecniche che richiedo molta potenza computazionale (e.g. fuzzing). Questo lovoro combina la strumentazione a livello di kernel con modifiche al translation engine di QEMU per reindirizzare le interazioni tra il modulo del kernel e un dispositivo virtuale. Le interazioni vengono inoltrate a un dispositivo ospitato su una macchina separata. Questo design abilita il superamento della fase di probing dei moduli del kernel compilati per piattaforme ARM 32-bit durante l'esecuzione su un sistema host x86-64. Questa ricerca affronta inoltre il caricamento dei moduli del kernel closed-source su kernel diversi da quello originario. L'approccio proposto automatizza l'estrazione delle dipendenze, adatta la configurazione del kernel Linux e crea un ambiente virtuale funzionale per l'esecuzione dei moduli. I risultati dimostrano che il nostro approccio consente l'esecuzione di moduli closed-source, la riproduzione accurata della fase di probing e il reindirizzamento controllato delle interazioni con l'hardware. A differenza di lavori precedenti, che presuppongono la disponibilità dell'accesso allo stato interno dell'hardware o richiedono accelleratori hardware e stesse architetture, il nostro approccio supporta contemporaneamente moduli closed-source, cross-emulazione e hardware-in-the-loop. Questa ricerca evidenzia un nuovo percorso per l'analisi dinamica dei moduli closed-source e lavori futuri esploreranno l'estensione ad altri tipi di bus e l'integrazione di tecniche avanzate per testare stati profondi nei moduli del kernel.
Software-based rehosting of closed-source kernel modules
Costantino, Antonino
2024/2025
Abstract
Closed-source kernel modules create significant challenges for analysis, testing, and verification. Traditional approaches either require access to the device hardware state, rely on source code availability, or are limited to same-architecture virtualization with hardware acceleration. This thesis presents a novel approach that enables the testing of closed-source kernel modules in a cross-emulation environment, without requiring direct access to the physical hardware state. This enables the testing of closed-source kernel modules, coming from low performance machines (such as embedded systems), on high computational power machines; allowing the use of computational expensive techniques, such as fuzzing. Our methodology combines kernel-level instrumentation with targeted modifications to QEMU’s translation engine to capture and redirect interactions between the kernel module and a virtual device. These interactions are then forwarded to the real device hosted on a separate machine. This design makes it possible to pass the probing phase of kernel modules compiled for ARM 32-bit platforms while running on an x86-64 host system. This work addresses a key challenge often overlooked in the literature: the correct loading of closed-source kernel modules under different kernel configurations. This framework automates the extraction of dependencies, adapts the Linux kernel configuration when necessary, and builds a fully functional virtual environment for module execution. The results demonstrate that the proposed approach allows transparent execution of closed-source modules, accurate reproduction of their probing phase, and controlled redirection of their interactions to real hardware. Unlike previous works, which assume device hardware state availability or require hardware acceleration and same architecture setups, this methodology supports closed-source modules, cross-emulation, and hardware-in-the-loop integration simultaneously. This research highlights a new path for dynamic analysis of closed-source drivers and future work will explore extending this framework to additional bus types and integrating advanced techniques to test deep states in kernel modules.| File | Dimensione | Formato | |
|---|---|---|---|
|
2025_12_Costantino.pdf
accessibile in internet solo dagli utenti autorizzati
Descrizione: Testo della tesi
Dimensione
1.24 MB
Formato
Adobe PDF
|
1.24 MB | Adobe PDF | Visualizza/Apri |
|
2025_12_Costantino_Executive Summary.pdf
accessibile in internet solo dagli utenti autorizzati
Descrizione: Executive Summary
Dimensione
456.13 kB
Formato
Adobe PDF
|
456.13 kB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/246544