{"title":"SNIP: Speculative Execution and Non-Interference Preservation for Compiler Transformations","authors":"Sören van der Wall, Roland Meyer","doi":"arxiv-2407.15080","DOIUrl":null,"url":null,"abstract":"We address the problem of preserving non-interference across compiler\ntransformations under speculative semantics. We develop a proof method that\nensures the preservation uniformly across all source programs. The basis of our\nproof method is a new form of simulation relation. It operates over directives\nthat model the attacker's control over the micro-architectural state, and it\naccounts for the fact that the compiler transformation may change the influence\nof the micro-architectural state on the execution (and hence the directives).\nUsing our proof method, we show the correctness of dead code elimination. When\nwe tried to prove register allocation correct, we identified a previously\nunknown weakness that introduces violations to non-interference. We have\nconfirmed the weakness for a mainstream compiler on code from the libsodium\ncryptographic library. To reclaim security once more, we develop a novel static\nanalysis that operates on a product of source program and register-allocated\nprogram. Using the analysis, we present an automated fix to existing register\nallocation implementations. We prove the correctness of the fixed register\nallocations with our proof method.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-07-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2407.15080","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
We address the problem of preserving non-interference across compiler
transformations under speculative semantics. We develop a proof method that
ensures the preservation uniformly across all source programs. The basis of our
proof method is a new form of simulation relation. It operates over directives
that model the attacker's control over the micro-architectural state, and it
accounts for the fact that the compiler transformation may change the influence
of the micro-architectural state on the execution (and hence the directives).
Using our proof method, we show the correctness of dead code elimination. When
we tried to prove register allocation correct, we identified a previously
unknown weakness that introduces violations to non-interference. We have
confirmed the weakness for a mainstream compiler on code from the libsodium
cryptographic library. To reclaim security once more, we develop a novel static
analysis that operates on a product of source program and register-allocated
program. Using the analysis, we present an automated fix to existing register
allocation implementations. We prove the correctness of the fixed register
allocations with our proof method.