Description
Caches are part of processors as a means of speeding up memory accesses. At the same time, they are a valuable lever for attackers to retrieve sensitive information of concurrently running processes. In the context of cryptographic libraries, coding guidelines help to increase the robustness of implementations against cache attacks. But even when implementations are carefully coded, compiler optimizations can still introduce information leaks. In a recent work from October 2024, Schneider et al. provide an indication for information leaks in cryptographic libraries introduced by the LLVM optimization pipeline. In our work, we build on these results and provide a complete understanding of the source of the leaks. We further develop a countermeasure capable of disabling optimizations on a targeted set of program instructions. With this countermeasure, we can prevent a vast majority of leaks from being introduced in a precise manner. A benchmark of the performance impact on the global optimization pipeline shows that our countermeasure is efficient and viable in practice, with an overhead in the total amount of instructions of less than 5% on average, and a compilation time increased by around 4%. Our results and the active field of research around information leaks in security-sensitive software show that there is a continuing need for better contracts between microarchitectures of processors and the software executed by them.
|