[Paper Review] Robustly Safe Compilation or, Efficient, Provably Secure Compilation
This paper introduces Robustly Safe Compilation (RSC), a new criterion for secure compilation that ensures source-level safety properties are preserved under all adversarial contexts, offering a more efficient alternative to fully abstract compilation. RSC avoids unnecessary runtime checks by focusing only on relevant safety properties, enabling simpler proofs and optimized code generation while maintaining strong security guarantees through two novel proof techniques and three illustrative compilers using different target-level protections.
Secure compilers generate compiled code that withstands many target-level attacks such as alteration of control flow, data leaks or memory corruption. Many existing secure compilers are proven to be fully abstract, meaning that they reflect and preserve observational equivalence. Fully abstract compilation is a strong and useful property that, in certain cases, comes at the cost of requiring expensive runtime constructs in compiled code. These constructs may have no relevance for security, but are needed to accommodate differences between the source language and the target language that fully abstract compilation necessarily regards. As an alternative to fully abstract compilation, this paper explores a different criterion for secure compilation called robustly safe compilation or RSC. Briefly, this criterion means that the compiled code preserves relevant safety properties of the source program against all adversarial contexts interacting with said program. We show that RSC can be attained easily and results in code that is more efficient than that generated by fully abstract compilers. We also develop three illustrative robustly-safe compilers and, through them, develop two different proof techniques for establishing that a compiler attains RSC. Through these, we also establish that proving RSC is simpler than proving fully abstraction.
Motivation & Objective
- To address the inefficiency and complexity of fully abstract compilation (FAC), which enforces security-preserving properties even for non-security-relevant abstractions.
- To propose Robustly Safe Compilation (RSC) as a more practical and efficient alternative to FAC, focusing only on relevant safety properties.
- To demonstrate that RSC can be proven more easily than FAC, with less reliance on expensive runtime constructs.
- To present two proof techniques for establishing RSC and validate them through three distinct compilers using different target-level protection mechanisms.
Proposed method
- Proposes RSC as a criterion where compiled code preserves source-level safety properties against all adversarial contexts, excluding irrelevant abstractions.
- Introduces a backtranslation mechanism that maintains a runtime mapping from masked target indices to original source locations, enabling context-sensitive differentiation.
- Employs a differentiator component that inserts conditional checks (e.g., terminate/diverge) at strategic points in compiled code to detect and respond to trace discrepancies.
- Uses a meta-level structural analysis of heap values to extract source-level locations from masked indices during backtranslation.
- Applies two proof techniques: one based on contextual equivalence and another using a refined logical relation to verify RSC.
- Develops three compilers with distinct protection mechanisms—control flow integrity, memory tagging, and protected modules—demonstrating RSC’s versatility.
Experimental results
Research questions
- RQ1Can a secure compilation criterion be defined that preserves only relevant safety properties, avoiding unnecessary runtime overhead from full abstraction?
- RQ2How can RSC be formally established with simpler proofs than those required for fully abstract compilation?
- RQ3Can RSC be applied to diverse target-level protection mechanisms while maintaining efficiency and correctness?
- RQ4What are the practical trade-offs between RSC and fully abstract compilation in terms of code size and performance?
- RQ5Can the proof techniques for RSC be generalized across different language designs and compilation targets?
Key findings
- RSC enables provably secure compilation with significantly reduced runtime overhead compared to fully abstract compilation, as it avoids enforcing irrelevant abstractions such as code size equivalence.
- The proof of RSC is simpler than that of fully abstract compilation, as demonstrated by transforming one of the RSC compilers into a fully abstract one, showing that RSC is a weaker but sufficient criterion.
- The three illustrative RSC compilers—based on control flow integrity, memory tagging, and protected modules—successfully preserve safety under adversarial contexts while generating efficient code.
- The backtranslation mechanism correctly maps masked target indices to original source locations using a runtime list of pairs, enabling accurate context-sensitive differentiation.
- The differentiator component successfully inserts context-aware checks (e.g., terminate/diverge) at function bodies and call sites to detect trace discrepancies caused by adversarial behavior.
- RSC is robust to undefined behavior in source languages like C and LLVM, avoiding the pitfalls that can break naive FAC approaches.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.