kth.sePublications KTH
Change search
Link to record
Permanent link

Direct link
Publications (10 of 10) Show all publications
Marinaro, T., Buiras, P., Lindner, A., Guanciale, R. & Nemati, H. (2024). Beyond Over-Protection: A Targeted Approach to Spectre Mitigation and Performance Optimization. In: ACM AsiaCCS 2024 - Proceedings of the 19th ACM Asia Conference on Computer and Communications Security: . Paper presented at 19th ACM Asia Conference on Computer and Communications Security, AsiaCCS 2024, July 1-5, 2024, Singapore, Singapore (pp. 203-216). Association for Computing Machinery (ACM)
Open this publication in new window or tab >>Beyond Over-Protection: A Targeted Approach to Spectre Mitigation and Performance Optimization
Show others...
2024 (English)In: ACM AsiaCCS 2024 - Proceedings of the 19th ACM Asia Conference on Computer and Communications Security, Association for Computing Machinery (ACM) , 2024, p. 203-216Conference paper, Published paper (Refereed)
Abstract [en]

Since the advent of Spectre attacks, researchers and practitioners have developed a range of hardware and software measures to counter transient execution attacks. A prime example of such mitigation is speculative load hardening (slh) in LLVM, which protects against leaks by tracking the speculation state and masking values during misspeculation. LLVM relies on static analysis to harden programs using slh that often results in over-protection, which incurs performance overhead. We extended an existing side-channel model validation framework, Scam-V, to check the vulnerability of programs to Spectre-PHT attacks and optimize the protection of programs using the slh approach. We illustrate the efficacy of Scam-V by first demonstrating that it can automatically identify Spectre vulnerabilities in programs, e.g., fragments of crypto-libraries. We then develop an optimization mechanism to validate the necessity of slh hardening w.r.t. the target platform. Our experiments showed that hardening introduced by LLVM in most cases could be improved when the underlying microarchitecture properties are considered.

Place, publisher, year, edition, pages
Association for Computing Machinery (ACM), 2024
Keywords
countermeasures, hardware security, side-channel attacks, Spectre
National Category
Computer Sciences
Identifiers
urn:nbn:se:kth:diva-351495 (URN)10.1145/3634737.3637651 (DOI)001283918100015 ()2-s2.0-85199256356 (Scopus ID)
Conference
19th ACM Asia Conference on Computer and Communications Security, AsiaCCS 2024, July 1-5, 2024, Singapore, Singapore
Note

Part of ISBN 9798400704826

QC 20241011

Available from: 2024-08-23 Created: 2024-08-23 Last updated: 2024-10-11Bibliographically approved
Lindner, A. (2023). Proving Safety and Security of Binary Programs. (Doctoral dissertation). Stockholm: KTH Royal Institute of Technology
Open this publication in new window or tab >>Proving Safety and Security of Binary Programs
2023 (English)Doctoral thesis, comprehensive summary (Other academic)
Abstract [en]

With the increasing ubiquity of computing devices, their correct and secure operation is of growing importance. In particular, critical components that provide core functionalities or process sensitive data have to operate as intended. Examples are operating systems that must provide proper isolation among applications, device drivers that must reliably communicate with the hardware, crypto routines that must avoid leakage of sensitive information, and low-level security mechanisms that must be implemented correctly to be effective. All these make use of hardware functionalities that are beyond plain software execution. Therefore, they should ideally be verified at binary level to accurately account for the effects their execution has on the underlying hardware systems.

Verifying properties of binary code is challenging because of its lack of structure in terms of control flows and memory representations, and the complex hardware specifics involved. In this thesis, we aim to improve the precision and trustworthiness of binary code analyses by basing the analyses on interactive theorem proving. We contribute with the new HolBA framework for binary analysis, which is built on top of the HOL4 theorem prover. This allows all implemented algorithms to produce machine-checked correctness proofs for their results. We applied this to implement translation procedures into the intermediate language BIR to facilitate analyses. The proof-producing analysis procedures we provide for program verification are the weakest precondition propagation and symbolic execution. We evaluated the framework with a number of binaries and a larger case study, which is the control software for a balancing robot. The latter has been used as an analysis target to establish execution time bounds using symbolic execution.

Since verification is carried out on models of hardware, the applicability of the verification results hinges on how well the used models reflect the actual hardware. In particular, in the context of security applications, where an attacker tries to exploit traits of hardware execution, this has received less attention in the formal methods community. We contribute with the new Scam-V methodology and tool for differential testing to discover possible instances where the attacker-exploitable behavior of a model and a real hardware system diverge. In a number of case studies with real processors, we found a number of new types of leakage that could be exploited by an attacker. Additionally, our validation exercises revealed a number of modeling issues.

Abstract [sv]

Med datorer och inbyggda system förekommande överallt i dagens samhälle blir dessas korrekthet och säkerhet allt viktigare. I synnerhet måste mjukvarukomponenter som bidrar med viktig funktionalitet eller hanterar känslig data fungera som avsett. Exempel på komponenter är operativsystem som måste isolera applikationer, drivrutiner som måste kommunicera med hårdvaran på ett tillförlitligt sätt, kryptografiska rutiner som inte får läcka känslig information och fundamentala säkerhetsmekanismer vars resultat beror starkt på implementationens korrekthet. Alla dessa komponenter involverar hårdvaruaspekter som normalt sett inte involveras vid exekvering av applikationsprogram. För korrekt verifiering bör därför dessa komponenter analyseras på binär nivå.

Att verifiera binärkodsegenskaper är utmanande då kontrollflöden och minnesrepresentationer saknar struktur i binärkod, och för att verifieringen involverar komplexa hårdvarudetaljer. I denna avhandling förbättrar vi precisionen och tillförlitligheten i binärkodsanalys med hjälp av en interaktiv bevisassistent. Vi presenterar ramverket HolBA för binärkodsanalys, som vi har implementerat i den interaktiva bevisassistenten HOL4. HolBA möjliggör implementation av analysalgoritmer så att algoritmerna producerar maskinkontrollerade korrekthetsbevis för dessas beräknade resultat. Vi har använt HolBA för att implementera översättningsprocedurer från binärkod till det mer abstrakta programspråket BIR för att underlätta formell analys. HolBA har två bevisproducerande analysrutiner för att möjliggöra programverifiering: en rutin för symbolisk exekvering och en rutin som beräknar det minst restriktiva villkoret som garanterar att programets resultat satisfierar ett givet villkor. Vi utvärderar HolBA med hjälp av ett antal binära program, och en större fallstudie bestående av ett program som styr en självbalanserande robot. Robotmjukvarans exekveringstider har analyserats med symbolisk exekvering för att verifiera dess övre och undre tidsgränser.

Verifieringsresultatens tillförlitlighet beror på hur precist hårdvarumodellerna återspeglar den faktiska hårdvaran. Denna aspekt har fått begränsad uppmärksamhet i samband med säkerhet, där subtila hårdvaruoperationer kan utnyttjas vid angrepp. Vi presenterar Scam-V, en metod och ett verktyg för differentiell testning, som upptäcker skillnader i beteende mellan modell och hårdvara som kan ge upphov till säkerhetssårbarheter. I ett antal fallstudier med riktiga processorer hittades, tidigare okända, typer av informationsläckage.

Place, publisher, year, edition, pages
Stockholm: KTH Royal Institute of Technology, 2023. p. vi, 181
Series
TRITA-EECS-AVL ; 2023:41
Keywords
Binary Code, Binary Analysis, Formal Verification, Model-Based Testing, Theorem Proving, HOL4, Intermediate Language, Instruction Set Architectures, ISA, Observational Models, Symbolic Execution, Weakest-Precondition, Execution Time Analysis, binärkod, binärkodsanalys, formell verifiering, modellbaserad testning, satsbevisning, HOL4, mellankod, instruktionsuppsättningar, ISA, observationsmodeller, symbolisk exekvering, minst restriktiva villkoret, analys av övre tidsgräns
National Category
Computer Sciences
Research subject
Computer Science
Identifiers
urn:nbn:se:kth:diva-326719 (URN)978-91-8040-583-6 (ISBN)
Public defence
2023-06-02, https://kth-se.zoom.us/j/68807417997, L1, Drottning Kristinas väg 30, Stockholm, 09:00 (English)
Opponent
Supervisors
Funder
Swedish Foundation for Strategic Research, RIT 17-0036Swedish Civil Contingencies Agency, 2015-831
Note

QC 20230509

Available from: 2023-05-09 Created: 2023-05-09 Last updated: 2023-05-15Bibliographically approved
Buiras, P., Nemati, H., Lindner, A. & Guanciale, R. (2021). Validation of side-channel models via observation refinement. In: Proceedings of the Annual International Symposium on Microarchitecture, MICRO: . Paper presented at 54th Annual IEEE/ACM International Symposium on Microarchitecture, MICRO 2021, 18 October 2021 through 22 October 2021 (pp. 578-591). Association for Computing Machinery (ACM)
Open this publication in new window or tab >>Validation of side-channel models via observation refinement
2021 (English)In: Proceedings of the Annual International Symposium on Microarchitecture, MICRO, Association for Computing Machinery (ACM) , 2021, p. 578-591Conference paper, Published paper (Refereed)
Abstract [en]

Observational models enable the analysis of information flow properties against side channels. Relational testing has been used to validate the soundness of these models by measuring the side channel on states that the model considers indistinguishable. However, unguided search can generate test states that are too similar to each other to invalidate the model. To address this we introduce observation refinement, a technique to guide the exploration of the state space to focus on hardware features of interest. We refine observational models to include fine-grained observations that characterize behavior that we want to exclude. States that yield equivalent refined observations are then ruled out, reducing the size of the space. We have extended an existing model validation framework, Scam-V, to support refinement. We have evaluated the usefulness of refinement for search guidance by analyzing cache coloring and speculative leakage in the ARMv8-A architecture. As a surprising result, we have exposed SiSCLoak, a new vulnerability linked to speculative execution in Cortex-A53.

Place, publisher, year, edition, pages
Association for Computing Machinery (ACM), 2021
Keywords
Information flow security, Microarchitectures, Model validation, Side channels, Testing, Channel modelling, Flow properties, Information flows, Micro architectures, Observational models, On state, Side-channel, Unguided search, Security of data
National Category
Computer Sciences
Identifiers
urn:nbn:se:kth:diva-313186 (URN)10.1145/3466752.3480130 (DOI)001118047400042 ()2-s2.0-85118897960 (Scopus ID)
Conference
54th Annual IEEE/ACM International Symposium on Microarchitecture, MICRO 2021, 18 October 2021 through 22 October 2021
Note

QC 20220602

part of proceedings ISBN 9781450385572

Available from: 2022-06-02 Created: 2022-06-02 Last updated: 2025-11-28Bibliographically approved
Lundberg, D., Guanciale, R., Lindner, A. & Dam, M. (2020). Hoare-Style Logic for Unstructured Programs. In: Frank de Boer, Antonio Cerone (Ed.), Software Engineering and Formal Methods: . Paper presented at 18th International Conference, SEFM 2020, Amsterdam, The Netherlands, September 14–18, 2020 (pp. 193-213). Cham: Springer Nature
Open this publication in new window or tab >>Hoare-Style Logic for Unstructured Programs
2020 (English)In: Software Engineering and Formal Methods / [ed] Frank de Boer, Antonio Cerone, Cham: Springer Nature , 2020, p. 193-213Conference paper, Published paper (Refereed)
Abstract [en]

Enabling Hoare-style reasoning for low-level code is attractive since it opens the way to regain structure and modularity in a domain where structure is essentially absent. The field, however, has not yet arrived at a fully satisfactory solution, in the sense of avoiding restrictions on control flow (important for compiler optimization), controlling access to intermediate program points (important for modularity), and supporting total correctness. Proposals in the literature support some of these properties, but a solution that meets them all is yet to be found. We introduce the novel Hoare-style program logic , which interprets postconditions relative to program points when these are first encountered. The logic can support both partial and total correctness, derive contracts for arbitrary control flow, and allows one to freely choose decomposition strategy during verification while avoiding step-indexed approximations and global invariants. The logic can be instantiated for a variety of concrete instruction set architectures and intermediate languages. The rules of  have been verified in the interactive theorem prover HOL4 and integrated with the toolbox HolBA for semi-automated program verification, making it applicable to the ARMv6 and ARMv8 instruction sets.

Place, publisher, year, edition, pages
Cham: Springer Nature, 2020
Series
LNCS, ISSN 0302-9743, E-ISSN 1611-3349 ; 12310
Keywords
Program logics, Formal verification, Theorem proving, Binary analysis, Hoare Logic
National Category
Computer Sciences
Research subject
Computer Science
Identifiers
urn:nbn:se:kth:diva-281691 (URN)10.1007/978-3-030-58768-0_11 (DOI)000722446400011 ()2-s2.0-85091597792 (Scopus ID)
Conference
18th International Conference, SEFM 2020, Amsterdam, The Netherlands, September 14–18, 2020
Projects
TrustFullCERCES
Funder
Swedish Foundation for Strategic ResearchSwedish Civil Contingencies Agency
Note

QC 20200921

Available from: 2020-09-21 Created: 2020-09-21 Last updated: 2023-03-30Bibliographically approved
Nemati, H., Buiras, P., Lindner, A., Guanciale, R. & Jacobs, S. (2020). Validation of Abstract Side-Channel Models for Computer Architectures. In: Lecture Notes in Computer Science book series: . Paper presented at CAV 2020: Computer Aided Verification, 21 July 2020 through 24 July 2020 (pp. 225-248). Springer, 1224
Open this publication in new window or tab >>Validation of Abstract Side-Channel Models for Computer Architectures
Show others...
2020 (English)In: Lecture Notes in Computer Science book series, Springer , 2020, Vol. 1224, p. 225-248Conference paper, Published paper (Refereed)
Abstract [en]

Observational models make tractable the analysis of information flow properties by providing an abstraction of side channels. We introduce a methodology and a tool, Scam-V, to validate observational models for modern computer architectures. We combine symbolic execution, relational analysis, and different program generation techniques to generate experiments and validate the models. An experiment consists of a randomly generated program together with two inputs that are observationally equivalent according to the model under the test. Validation is done by checking indistinguishability of the two inputs on real hardware by executing the program and analyzing the side channel. We have evaluated our framework by validating models that abstract the data-cache side channel of a Raspberry Pi 3 board with a processor implementing the ARMv8-A architecture. Our results show that Scam-V can identify bugs in the implementation of the models and generate test programs which invalidate the models due to hidden microarchitectural behavior.

Place, publisher, year, edition, pages
Springer, 2020
Keywords
Information flow security, Microarchitectures, Model validation, Side channels, Testing, Computer aided analysis, Program debugging, Software testing, Indistinguishability, Information flows, Observational models, Program generation, Relational analysis, Side-channel, Symbolic execution, Test program, Computer architecture
National Category
Computer Sciences
Identifiers
urn:nbn:se:kth:diva-285360 (URN)10.1007/978-3-030-53288-8_12 (DOI)000695276000012 ()2-s2.0-85089236051 (Scopus ID)
Conference
CAV 2020: Computer Aided Verification, 21 July 2020 through 24 July 2020
Note

QC 20201201

Available from: 2020-12-01 Created: 2020-12-01 Last updated: 2024-01-10Bibliographically approved
Lindner, A., Guanciale, R. & Metere, R. (2019). TrABin: Trustworthy analyses of binaries. Science of Computer Programming, 174, 72-89
Open this publication in new window or tab >>TrABin: Trustworthy analyses of binaries
2019 (English)In: Science of Computer Programming, ISSN 0167-6423, E-ISSN 1872-7964, Vol. 174, p. 72-89Article in journal (Refereed) Published
Abstract [en]

Verification of microkernels, device drivers, and crypto routines requires analyses at the binary level. In order to automate these analyses, in the last years several binary analysis platforms have been introduced. These platforms share a common design: the adoption of hardware-independent intermediate representations, a mechanism to translate architecture dependent code to this representation, and a set of architecture independent analyses that process the intermediate representation. The usage of these platforms to verify software introduces the need for trusting both the correctness of the translation from binary code to intermediate language (called transpilation) and the correctness of the analyses. Achieving a high degree of trust is challenging since the transpilation must handle (i) all the side effects of the instructions, (ii) multiple instruction encodings (e.g. ARM Thumb), and (iii) variable instruction length (e.g. Intel). Similarly, analyses can use complex transformations (e.g. loop unrolling) and simplifications (e.g. partial evaluation) of the artifacts, whose bugs can jeopardize correctness of the results. We overcome these problems by developing a binary analysis platform on top of the interactive theorem prover HOL4. First, we formally model a binary intermediate language and we prove correctness of several supporting tools (i.e. a type checker). Then, we implement two proof-producing transpilers, which respectively translate ARMv8 and CortexM0 programs to the intermediate language and generate a certificate. This certificate is a HOL4 proofdemonstrating correctness of the translation. As demonstrating analysis, we implement a proof-producing weakest precondition generator, which can be used to verify that a given loop-free program fragment satisfies a contract. Finally, we use an AES encryption implementation to benchmark our platform.

Place, publisher, year, edition, pages
Elsevier, 2019
Keywords
Binary analysis, Formal verification, Proof producing analysis, Theorem proving
National Category
Computer Systems
Identifiers
urn:nbn:se:kth:diva-246462 (URN)10.1016/j.scico.2019.01.001 (DOI)000461533200003 ()2-s2.0-85060511323 (Scopus ID)
Projects
Trustfull
Note

QC 20190321

Available from: 2019-03-21 Created: 2019-03-21 Last updated: 2023-05-09Bibliographically approved
Metere, R., Lindner, A. & Guanciale, R. (2017). Sound transpilation from binary to machine-independent code. In: 20th Brazilian Symposium on Formal Methods, SBMF 2017: . Paper presented at 20th Brazilian Symposium on Formal Methods, SBMF 2017, Recife, Brazil, 29 November 2017 through 1 December 2017 (pp. 197-214). Springer, 10623
Open this publication in new window or tab >>Sound transpilation from binary to machine-independent code
2017 (English)In: 20th Brazilian Symposium on Formal Methods, SBMF 2017, Springer, 2017, Vol. 10623, p. 197-214Conference paper, Published paper (Refereed)
Abstract [en]

In order to handle the complexity and heterogeneity of modern instruction set architectures, analysis platforms share a common design, the adoption of hardware-independent intermediate representations. The usage of these platforms to verify systems down to binary-level is appealing due to the high degree of automation they provide. However, it introduces the need for trusting the correctness of the translation from binary code to intermediate language. Achieving a high degree of trust is challenging since this transpilation must handle (i) all the side effects of the instructions, (ii) multiple instruction encoding (e.g. ARM Thumb), and (iii) variable instruction length (e.g. Intel). We overcome these problems by formally modeling one of such intermediate languages in the interactive theorem prover HOL4 and by implementing a proof-producing transpiler. This tool translates ARMv8 programs to the intermediate language and generates a HOL4 proof that demonstrates the correctness of the translation in the form of a simulation theorem. We also show how the transpiler theorems can be used to transfer properties verified on the intermediate language to the binary code.

Place, publisher, year, edition, pages
Springer, 2017
Series
Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), ISSN 0302-9743 ; 10623
Keywords
Binary analysis, Formal verification, Proof producing analysis, Theorem proving
National Category
Embedded Systems
Identifiers
urn:nbn:se:kth:diva-219665 (URN)10.1007/978-3-319-70848-5_13 (DOI)000452447600013 ()2-s2.0-85035086144 (Scopus ID)9783319708478 (ISBN)
Conference
20th Brazilian Symposium on Formal Methods, SBMF 2017, Recife, Brazil, 29 November 2017 through 1 December 2017
Projects
trustfull
Note

QC 20171212

Available from: 2017-12-12 Created: 2017-12-12 Last updated: 2022-10-24Bibliographically approved
Lindner, M., Lindner, A. & Lindgren, P. (2016). Safe tasks: run time verification of the RTFM-lang model of computation. In: 2016 IEEE 21ST INTERNATIONAL CONFERENCE ON EMERGING TECHNOLOGIES AND FACTORY AUTOMATION (ETFA): . Paper presented at 21st IEEE International Conference on Emerging Technologies and Factory Automation (ETFA), SEP 06-09, 2016, OWL Univ Appl Sci, Fraunhofer IOSB INA, Berlin, GERMANY. IEEE
Open this publication in new window or tab >>Safe tasks: run time verification of the RTFM-lang model of computation
2016 (English)In: 2016 IEEE 21ST INTERNATIONAL CONFERENCE ON EMERGING TECHNOLOGIES AND FACTORY AUTOMATION (ETFA), IEEE, 2016Conference paper, Published paper (Refereed)
Abstract [en]

Embedded systems for critical applications are typically specified with requirements on predictable timing and safety. While ensuring predictable timing, the RTFM-lang (Real-Time For the Masses) model of computation (MoC) currently lacks memory access protection among real-time tasks. In this paper, we discuss how to safely verify task execution given a specification using the RTFM-MoC. Furthermore, an extension to the RTFM-core infrastructure is outlined and tested with use cases of embedded development. We propose a method for run time verification exploiting memory protection hardware. For this purpose, we introduce memory resources to the declarative language RTFM-core allowing compliance checks. As a proof of concept, compiler support for model analysis and automatic generation of run time verification code is implemented together with an isolation layer for the RTFM-kernel. With this verification foundation, functional run time checks as well as further overhead assessments are future research questions.

Place, publisher, year, edition, pages
IEEE, 2016
Series
IEEE International Conference on Emerging Technologies and Factory Automation-ETFA, ISSN 1946-0740
National Category
Electrical Engineering, Electronic Engineering, Information Engineering
Identifiers
urn:nbn:se:kth:diva-200023 (URN)10.1109/ETFA.2016.7733550 (DOI)000389524200057 ()2-s2.0-84996551916 (Scopus ID)978-1-5090-1314-2 (ISBN)
Conference
21st IEEE International Conference on Emerging Technologies and Factory Automation (ETFA), SEP 06-09, 2016, OWL Univ Appl Sci, Fraunhofer IOSB INA, Berlin, GERMANY
Note

QC 20170130

Available from: 2017-01-30 Created: 2017-01-20 Last updated: 2022-06-27Bibliographically approved
Lundberg, D., Guanciale, R., Lindner, A. & Dam, M.Hoare-Style Logic for Unstructured Programs.
Open this publication in new window or tab >>Hoare-Style Logic for Unstructured Programs
(English)Manuscript (preprint) (Other academic)
Abstract [en]

Enabling Hoare-style reasoning for low-level code is attractive since it opens the way to regain structure and modularity in a domain where structure is essentially absent. The field, however, has not yet arrived at a fully satisfactory solution, in the sense of avoiding restrictions on control flow (important for compiler optimization), controlling access to intermediate program points (important for modularity), and supporting total correctness. Proposals in the literature support some of these properties, but a solution that meets them all is yet to be found.We introduce the novel Hoare-style program logic L_a, which interprets postconditions relative to program points when these are first encountered. The logic supports both partial and total correctness, derives contracts for arbitrary control flow, and allows one to freely choose decomposition strategy during verification while avoiding step-indexed approximations and global invariants. The logic can be instantiated for a variety of concrete instruction set architectures and intermediate languages. The rules of L_a have been verified in the interactive theorem prover HOL4 and integrated with the toolbox HolBA for semi-automated program verification, which supports the ARMv6, ARMv8 and RISC-V instruction sets.

Keywords
Program Logics, Formal Verification, Theorem Proving, Binary Analysis, Hoare Logic
National Category
Formal Methods
Research subject
Computer Science
Identifiers
urn:nbn:se:kth:diva-372695 (URN)
Funder
Swedish Foundation for Strategic ResearchVinnova, 2023-03003Swedish Civil Contingencies Agency
Note

Accepted for publication in "Journal of Logical and Algebraic Methods in Programming". This version is a pre-copyedit manuscript.

QC 20251113

Available from: 2025-11-12 Created: 2025-11-12 Last updated: 2025-11-13Bibliographically approved
Lindner, A., Guanciale, R. & Dam, M.Proof-Producing Symbolic Execution for Binary Code Verification.
Open this publication in new window or tab >>Proof-Producing Symbolic Execution for Binary Code Verification
(English)Manuscript (preprint) (Other academic)
National Category
Computer Sciences
Identifiers
urn:nbn:se:kth:diva-326741 (URN)
Note

QC 20230509

Available from: 2023-05-09 Created: 2023-05-09 Last updated: 2023-05-09Bibliographically approved
Organisations
Identifiers
ORCID iD: ORCID iD iconorcid.org/0000-0001-5311-1781

Search in DiVA

Show all publications