Fuzzing is a well-established technique for uncovering software vulnerabilities by subjecting programs to unexpected inputs. However, traditional fuzzing methods often fall short when dealing with the complexities of multi-threaded programs. The non-deterministic nature of thread interleaving poses a significant challenge in identifying race conditions – a critical class of concurrency bugs that can lead to data corruption, crashes, and security breaches. Existing fuzzing approaches have attempted to address this challenge by controlling thread scheduling, building interleaving models, and instrumenting code to influence thread priorities. While these methods show promise, they often rely on source code access for instrumentation and analysis, limiting their applicability to closed-source software. This thesis presents a novel approach to interleaving fuzzing that overcomes these limitations. Our method leverages user-level thread emulation within the QEMU User mode environment. By intercepting and controlling thread management system calls, we migrate threads from the kernel level to the user level, enabling deterministic scheduling and precise control over thread interleaving. This systematic exploration of thread interactions exposes potential race conditions that might otherwise remain hidden. We introduce a custom snapshotting mechanism to further enhance the effectiveness and reliability of our fuzzing process. This mechanism captures and restores the program's memory and thread state at specific points. This eliminates non-determinism caused by variations in the program's state and facilitates the analysis of discovered vulnerabilities. In conclusion, this thesis contributes to the field of software testing and security by presenting a practical and efficient solution for detecting race conditions in multi-threaded applications, particularly in closed-source scenarios. Combining user-level thread emulation with a custom snapshotting mechanism, our approach offers a powerful tool for enhancing software reliability and security. Future work includes refining the interleaving feedback mechanism and extending the approach to a wider range of architectures.
Il fuzzing è una tecnica consolidata per scoprire vulnerabilità del software sottoponendo i programmi a input inaspettati. Tuttavia, i metodi tradizionali di fuzzing spesso falliscono quando si ha a che fare con la complessità dei programmi multi-thread. La natura non deterministica dell'interleaving dei thread rappresenta una sfida significativa nell'identificazione delle race condition, una classe critica di bug di concorrenza che può portare a corruzione dei dati, crash e violazioni della sicurezza. Gli approcci esistenti hanno cercato di risolvere questo problema controllando la schedulazione dei thread, creando modelli di inteerleaving e instrumentando il codice per influenzare le priorità dei thread. Nonostante i progressi, questi metodi spesso richiedono l'accesso al codice sorgente, limitandone l'applicabilità ai software closed-source. Questa tesi presenta un nuovo approccio che supera tali limitazioni. Il nostro metodo utilizza l'emulazione dei thread a livello utente nell'ambiente QEMU User mode. Intercettando e gestendo le chiamate di sistema per la gestione dei thread, spostiamo i thread dal livello del kernel a quello utente, consentendo una schedulazione deterministica e un controllo preciso del interleaving dei thread. Introduciamo inoltre un meccanismo di snapshot personalizzato per aumentare l'efficacia e l'affidabilità del fuzzing. Questo meccanismo cattura e ripristina la memoria del programma e lo stato dei thread in punti specifici, eliminando l'imprevedibilità causata dalle variazioni nello stato del programma e facilitando l'analisi delle vulnerabilità scoperte. In conclusione, questa tesi contribuisce al campo del testing e della sicurezza del software offrendo una soluzione pratica ed efficiente per rilevare le race condition in applicazioni multi-thread, specialmente in scenari closed-source. Combinando l'emulazione dei thread a livello utente con un meccanismo di snapshot personalizzato, il nostro approccio fornisce uno strumento potente per migliorare l'affidabilità e la sicurezza del software. Il lavoro futuro prevede il perfezionamento del meccanismo di feedback dell'interazione tra i thread e l'estensione dell'approccio a un maggior numero di architetture.
TIELLA: A User-Level Thread Interleaving Fuzzing Approach for Binary Application
SACCHETTA, JURI
2023/2024
Abstract
Fuzzing is a well-established technique for uncovering software vulnerabilities by subjecting programs to unexpected inputs. However, traditional fuzzing methods often fall short when dealing with the complexities of multi-threaded programs. The non-deterministic nature of thread interleaving poses a significant challenge in identifying race conditions – a critical class of concurrency bugs that can lead to data corruption, crashes, and security breaches. Existing fuzzing approaches have attempted to address this challenge by controlling thread scheduling, building interleaving models, and instrumenting code to influence thread priorities. While these methods show promise, they often rely on source code access for instrumentation and analysis, limiting their applicability to closed-source software. This thesis presents a novel approach to interleaving fuzzing that overcomes these limitations. Our method leverages user-level thread emulation within the QEMU User mode environment. By intercepting and controlling thread management system calls, we migrate threads from the kernel level to the user level, enabling deterministic scheduling and precise control over thread interleaving. This systematic exploration of thread interactions exposes potential race conditions that might otherwise remain hidden. We introduce a custom snapshotting mechanism to further enhance the effectiveness and reliability of our fuzzing process. This mechanism captures and restores the program's memory and thread state at specific points. This eliminates non-determinism caused by variations in the program's state and facilitates the analysis of discovered vulnerabilities. In conclusion, this thesis contributes to the field of software testing and security by presenting a practical and efficient solution for detecting race conditions in multi-threaded applications, particularly in closed-source scenarios. Combining user-level thread emulation with a custom snapshotting mechanism, our approach offers a powerful tool for enhancing software reliability and security. Future work includes refining the interleaving feedback mechanism and extending the approach to a wider range of architectures.File | Dimensione | Formato | |
---|---|---|---|
TIELLA__A_User_Level_Thread_Interleaving_Fuzzing_Approach_for_Binary_Application.pdf
accessibile in internet per tutti a partire dal 27/06/2027
Dimensione
721.62 kB
Formato
Adobe PDF
|
721.62 kB | Adobe PDF | Visualizza/Apri |
Executive_Summary___Scuola_di_Ingegneria_Industriale_e_dell_Informazione___Politecnico_di_Milano.pdf
accessibile in internet per tutti a partire dal 27/06/2027
Dimensione
537.04 kB
Formato
Adobe PDF
|
537.04 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/222673