kth.sePublications KTH
Change search
Link to record
Permanent link

Direct link
Publications (7 of 7) Show all publications
Lundberg, D. (2025). Formal Verification of Software-Defined Network Elements and Machine Code. (Doctoral dissertation). Stockholm: KTH Royal Institute of Technology
Open this publication in new window or tab >>Formal Verification of Software-Defined Network Elements and Machine Code
2025 (English)Doctoral thesis, comprehensive summary (Other academic)
Abstract [en]

Software, programmability and connectivity are increasingly pervasive aspects of society. In the span of a lifetime, everything from vehicles to phones has evolved from fixed-function to generally programmable devices that are always online. As a result, their functionality is entirely determined by their software, which may change from update to update and depending on what applications you have installed. The software itself is increasingly written by outsourced consultants or even by AI, with vulnerabilities appearing and being fixed on a daily basis.

Where does one even begin to secure modern digital equipment? The highest levels of assurance certification demand formal verification - mathematical proofs that rule out vulnerabilities based on models of hardware or programming-language semantics. This is costly and time-consuming, and so is applied mainly to small, critical components. The way to gain scalability is to base your assurance statements on highly automated verification tools whose correctness depends only on minimal, auditable trusted code bases.

The work in this thesis is focused on the creation of formal verification tools in the domains of machine code and networking. The common denominator is the use of an interactive theorem prover to gain assurance of the results. Specifically, the thesis presents (i) methods to decompose verification tasks for unstructured programs, especially as applied to machine code, and (ii) a formal model of the P4 domain-specific networking language, accompanied by (iii) a proof-producing symbolic execution tool and finally (iv) a complete toolchain to verifiably compile a verified P4 program down to a software switch.

Abstract [sv]

Mjukvara, programmerbarhet och uppkoppling genomsyrar i allt högre grad samhället. Under loppet av en livstid har allt från fordon till telefoner utvecklats från enheter med fast funktion till programmerbara enheter som alltid är uppkopplade. Som följd av detta bestäms deras funktionalitet helt av deras mjukvara, vilken kan förändras med uppdateringar och installering av applikationer. Mjukvaran i sig skrivs i allt högre grad av utkontrakterade konsulter eller till och med av AI, med sårbarheter som dyker upp och åtgärdas dagligen.

Hur kan man ens påbörja att säkra modern digital utrustning? De högsta nivåerna av säkerhetscertifiering kräver formell verifiering - matematiska bevis som utesluter sårbarheter baserat på modeller av hårdvara eller semantik för programmeringsspråk. Detta är kostsamt och tidskrävande, och tillämpas därför främst på små, kritiska komponenter. Vägen till skalbarhet går genom att basera sina assuransutlåtanden på högautomatiserade verifieringsverktyg vars korrekthet endast beror på minimala, granskningsbara betrodda kodbaser.

Arbetet i denna avhandling fokuserar på skapandet av formella verifieringsverktyg inom domänerna maskinkod och nätverk. Den gemensamma nämnaren är användningen av en interaktiv teorembevisare för att säkerställa resultatens tillförlitlighet. Specifikt presenterar avhandlingen (i) metoder för att dela upp verifieringsuppgifter för ostrukturerade program, särskilt tillämpat på maskinkod, och (ii) en formell modell av det domänspecifika språket P4 för nätverk, tillsammans med (iii) ett bevisproducerande exekveringsverktyg och slutligen (iv) en komplett verktygskedja för att verifierbart kompilera ett verifierat P4-program ner till en mjukvaruswitch.

Place, publisher, year, edition, pages
Stockholm: KTH Royal Institute of Technology, 2025. p. xix, 66
Series
TRITA-EECS-AVL ; 2025:103
Keywords
Formal verification, interactive theorem proving, HOL4, P4, binary analysis, semantics, program logic, symbolic execution, Formell verifiering, interaktiv teorembevisning, HOL4, P4, binäranalys, semantik, programlogik, symbolisk exekvering
National Category
Formal Methods
Research subject
Computer Science
Identifiers
urn:nbn:se:kth:diva-372675 (URN)978-91-8106-459-9 (ISBN)
Public defence
2025-12-08, https://kth-se.zoom.us/j/61627100868, Kollegiesalen, Brinellvägen 8, Stockholm, 13:00 (English)
Opponent
Supervisors
Funder
Swedish Foundation for Strategic ResearchVinnova, 2023-03003
Available from: 2025-11-13 Created: 2025-11-12 Last updated: 2025-11-24Bibliographically approved
Lundberg, D., Guanciale, R. & Dam, M. (2025). Proof-Producing Symbolic Execution for P4. In: Verified Software. Theories, Tools and Experiments - 16th International Conference, VSTTE 2024, Revised Selected Papers: . Paper presented at 16th International Conference on Verified Software: Theories, Tools, and Experiments, VSTTE 2024, Prague, Czechia, October 14-15, 2024 (pp. 70-83). Springer Nature
Open this publication in new window or tab >>Proof-Producing Symbolic Execution for P4
2025 (English)In: Verified Software. Theories, Tools and Experiments - 16th International Conference, VSTTE 2024, Revised Selected Papers, Springer Nature , 2025, p. 70-83Conference paper, Published paper (Refereed)
Abstract [en]

We introduce a proof-producing symbolic execution tool for formal verification of P4 programs. The tool has been implemented using the interactive theorem prover HOL4 and results are proved sound with respect to the HOL4P4 formalisation of the P4 language. Most notably, this is a general tool for proving functional correctness that can be applied to entire real-world P4 programs.

Place, publisher, year, edition, pages
Springer Nature, 2025
Keywords
Domain-Specific Languages, Formal Verification, Theorem Proving
National Category
Computer Sciences Computer Systems Embedded Systems
Identifiers
urn:nbn:se:kth:diva-363992 (URN)10.1007/978-3-031-86695-1_5 (DOI)001541342700005 ()2-s2.0-105005252570 (Scopus ID)
Conference
16th International Conference on Verified Software: Theories, Tools, and Experiments, VSTTE 2024, Prague, Czechia, October 14-15, 2024
Note

Part of ISBN 9783031866944

QC 20251021

Available from: 2025-06-02 Created: 2025-06-02 Last updated: 2025-11-12Bibliographically approved
Alshnakat, A., Lundberg, D., Guanciale, R. & Dam, M. (2024). HOL4P4: Mechanized Small-Step Semantics for P4. Proceedings of the ACM on Programming Languages, 8(OOPSLA1), Article ID 102.
Open this publication in new window or tab >>HOL4P4: Mechanized Small-Step Semantics for P4
2024 (English)In: Proceedings of the ACM on Programming Languages, E-ISSN 2475-1421, Vol. 8, no OOPSLA1, article id 102Article in journal (Refereed) Published
Abstract [en]

We present the first semantics of the network data plane programming language P4 able to adequately capture all key features of P416, the most recent version of P4, including external functions (externs) and concurrency. These features are intimately related since, in P4, extern invocations are the only points at which one execution thread can affect another. Reflecting P4's lack of a general-purpose memory and the presence of multithreading the semantics is given in small-step style and eschews the use of a heap. In addition to the P4 language itself, we provide an architectural level semantics, which allows the composition of P4-programmed blocks, models end-to-end packet processing, and can take into account features such as arbitration and packet recirculation. A corresponding type system is provided with attendant progress, preservation, and type-soundness theorems. Semantics, type system, and meta-theory are formalized in the HOL4 theorem prover. From this formalization, we derive a HOL4 executable semantics that supports verified execution of programs with partially symbolic packets able to validate simple end-to-end program properties.

Place, publisher, year, edition, pages
Association for Computing Machinery (ACM), 2024
Keywords
formal verification, interactive theorem proving, P4, programming language semantics
National Category
Computer Sciences
Identifiers
urn:nbn:se:kth:diva-348304 (URN)10.1145/3649819 (DOI)001209927600009 ()2-s2.0-85195797284 (Scopus ID)
Note

QC 20240624

Available from: 2024-06-20 Created: 2024-06-20 Last updated: 2025-11-12Bibliographically approved
Alshnakat, A., Lundberg, D., Guanciale, R., Dam, M. & Palmskog, K. (2022). HOL4P4: Semantics for a Verified Data Plane. In: EuroP4 2022: Proceedings of the 5th International Workshop on P4 in Europe, Part of CoNEXT 2022. Paper presented at 5th International Workshop on P4 in Europe, EuroP4 2022, co-located with ACM CoNEXT 2022, Rome, Italy, Dec 9 2022 (pp. 39-45). Association for Computing Machinery (ACM)
Open this publication in new window or tab >>HOL4P4: Semantics for a Verified Data Plane
Show others...
2022 (English)In: EuroP4 2022: Proceedings of the 5th International Workshop on P4 in Europe, Part of CoNEXT 2022, Association for Computing Machinery (ACM) , 2022, p. 39-45Conference paper, Published paper (Refereed)
Abstract [en]

We introduce a formal semantics of P4 for the HOL4 interactive theorem prover. We exploit properties of the language, like the absence of call by reference and the copy-in/copy-out mechanism, to define a heapless small-step semantics that is abstract enough to simplify verification, but that covers the main aspects of the language: interaction with the architecture via externs, table match, and parsers. Our formalization is written in the Ott metalanguage, which allows us to export definitions to multiple interactive theorem provers. The exported HOL4 semantics allows us to establish machine-checkable proofs regarding the semantics, properties of P4 programs, and soundness of analysis tools.

Place, publisher, year, edition, pages
Association for Computing Machinery (ACM), 2022
Keywords
formal verification, interactive theorem proving, P4, programming language semantics
National Category
Computer Sciences
Identifiers
urn:nbn:se:kth:diva-333491 (URN)10.1145/3565475.3569081 (DOI)001062234700007 ()2-s2.0-85145586258 (Scopus ID)
Conference
5th International Workshop on P4 in Europe, EuroP4 2022, co-located with ACM CoNEXT 2022, Rome, Italy, Dec 9 2022
Note

Part of ISBN 9781450399357

QC 20230802

Available from: 2023-08-02 Created: 2023-08-02 Last updated: 2023-10-16Bibliographically 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
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
Lundberg, D. & Guanciale, R.HOL4P4.EXE: A Formally Verified P4 Software Switch.
Open this publication in new window or tab >>HOL4P4.EXE: A Formally Verified P4 Software Switch
(English)Manuscript (preprint) (Other academic)
Abstract [en]

The emergence of programmable network elements and their usage in critical infrastructure is increasing the demand for formal guarantees of their correctness. This paper presents the first P4 software switch connected by proof to a formal semantics. This is accomplished by adjusting and optimizing the HOL4P4 semantics to create an efficient interpreter that can be compiled using the verified CakeML compiler. We demonstrate practical performance in a set of experiments, achieving several orders of magnitude improvement in throughput over existing semantics-based interpreters, with only small performance penalties compared to the BMv2 reference switch written in C++.

Keywords
HOL4, P4, Interactive Theorem Proving, Formal Verification, HOL4, P4, interaktiv teorembevisning, formell verifiering
National Category
Formal Methods
Research subject
Computer Science
Identifiers
urn:nbn:se:kth:diva-372690 (URN)
Funder
Vinnova, 2023-03003
Note

Accepted for publication in "Verified Software. Theories, Tools and Experiments". This version is a pre-copyedit manuscript.

QC 20251113

Available from: 2025-11-12 Created: 2025-11-12 Last updated: 2025-11-13Bibliographically approved
Organisations
Identifiers
ORCID iD: ORCID iD iconorcid.org/0000-0001-9921-3257

Search in DiVA

Show all publications

Profile pages