Original title:
Zlepšování bezpečnosti garbage collectorů v Java Virtual Machine
Translated title:
Improving the Security of Garbage Collectors in the Java Virtual Machine
Authors:
Čerbák, Patrik ; Smrčka, Aleš (referee) ; Kozák, David (advisor) Document type: Master’s theses
Year:
2026
Language:
eng Publisher:
Vysoké učení technické v Brně. Fakulta informačních technologií Abstract:
[eng][cze]
Tato diplomová práce se zaměřuje na zlepšení bezpečnosti Garbage-First garbage collectoru (G1 GC) v Java Virtual Machine (JVM). Zvýšení bezpečnosti je dosaženo průběžnou relokací paměťových regionů používaných tímto garbage collectorem a "uzamčením" původní paměti, ve které se nacházely. Díky této relokaci je možné odhalit dereferenci "dangling" ukazatelů (nebo jiných ukazatelů vzniklých například přetečením bufferu), které stále chybně odkazují na původní paměť. To výrazně usnadňuje detekci a ladění paměťových zranitelností v tomto garbage collectoru. Toto rozšíření G1 GC se nazývá SanitizeGC a bylo testováno jak pomocí sady vlastních testů, tak s využitím testovací sady pro G1, která již byla součástí kódu JVM. Kromě toho byla jeho funkcionalita ověřena na několika reálných aplikacích. Vytvořeny byly také dva speciální scénáře, které záměrně zavádějí chyby, aby se ukázalo, že je toto rozšíření dokáže efektivně zachytit (což bylo úspěšné), i když za cenu nižšího výkonu (v průměru je 4,5krát pomalejší při vysokém zatížení paměti) a větší spotřeby fyzické paměti (v průměru 1,1krát vyšší, v nejhorším případě dvojnásobná). To poskytuje důkaz, že SanitizeGC je užitečným diagnostickým nástrojem ve fázích vývoje a testování JVM s přijatelnou režijí.
This thesis focuses on improving the security of the Garbage-First garbage collector (G1 GC) in the Java Virtual Machine (JVM). The increase in security is achieved through continuous relocation of memory regions used by the garbage collector and by "locking" the original memory regions in which they were located. Thanks to this relocation, the dereference of dangling pointers (or other pointers created, for example, by a buffer overflow), which are still incorrectly pointing to the original memory, would be detected. This makes it much easier to detect and debug memory vulnerabilities in this garbage collector. This extension of G1 GC is called SanitizeGC, and it was tested with a set of custom tests as well as with a G1 test suite already present in the JVM's code. Apart from that, its functionality was checked on a few real-world applications. There were also two special scenarios created that introduce bugs on purpose to showcase that the extension can catch them efficiently (which was successful), at the cost of worse performance (4.5 times slower on average in high memory workload scenarios) and higher physical memory usage (1.1 times more on average, doubled in the worst case). Giving evidence that SanitizeGC is a useful diagnostic tool in the development and testing phases of JVM with acceptable overhead.
Keywords:
bezpečnost; dangling ukazatele; G1 GC; garbage collectors; HotSpot; Java; JVM; OpenJDK; use-after-free zranitelnost; dangling pointers; G1 GC; garbage collectors; HotSpot; Java; JVM; OpenJDK; security; use-after-free vulnerability
Institution: Brno University of Technology
(web)
Document availability information: Fulltext is available in the Brno University of Technology Digital Library. Original record: http://hdl.handle.net/11012/260308