|
This article is cited in 1 scientific paper (total in 1 paper)
Prevention of vulnerabilities arising from optimization of code with undefined behavior
R. V. Baev, L. V. Skvortsov, E. A. Kudryashov, R. A. Buchatskiy, R. A. Zhuykov Ivannikov Institute for System Programming of the Russian Academy of Sciences
Abstract:
Aggressive optimization in modern compilers may uncover vulnerabilities in program code that did not lead to bugs prior to optimization. The source of these vulnerabilities is in code with undefined behavior. Programmers use such constructs relying on some particular behavior these constructs showed before in their experience, but the compiler is not obliged to stick to that behavior and may change the behavior if it's needed for optimization since the behavior is undefined by language standard. This article describes approaches to detection and elimination of vulnerabilities arising from optimization in the case when source code is available but its modification is undesirable or impossible. Concept of a safe compiler (i.e. compiler that ensures no vulnerability is added to the program during optimization) is presented and implementation of such a compiler on top of GCC compiler is described. Implementation of safe compiler's functionality is divided into three security levels whose applicability is discussed in the article. Feasibility of using the safe compiler on real-world codebases is demonstrated and possible performance losses are estimated.
Keywords:
compiler, vulnerability, undefined behavior.
Citation:
R. V. Baev, L. V. Skvortsov, E. A. Kudryashov, R. A. Buchatskiy, R. A. Zhuykov, “Prevention of vulnerabilities arising from optimization of code with undefined behavior”, Proceedings of ISP RAS, 33:4 (2021), 195–210
Linking options:
https://www.mathnet.ru/eng/tisp622 https://www.mathnet.ru/eng/tisp/v33/i4/p195
|
Statistics & downloads: |
Abstract page: | 22 | Full-text PDF : | 12 |
|