skip to main content
10.1145/3623759.3624544acmconferencesArticle/Chapter ViewAbstractPublication PagessospConference Proceedingsconference-collections
short-paper

Pancake: Verified Systems Programming Made Sweeter

Published:23 October 2023Publication History

ABSTRACT

We introduce Pancake, a new language for verifiable, low-level systems programming, especially device drivers. Pancake eschews complex type systems to make the language attractive to systems programmers, while at the same time aiming to ease the formal verification of code. We describe the design of the language and its verified compiler, and examine its usability, performance and current limitations through case studies of device drivers and related systems components for an seL4-based operating system.

References

  1. E. Alkassar, M. Hillebrand, S. Knapp, R. Rusev, and S. Tverdyshev. 2007. Formal Device and Programming Model for a Serial Interface. In International Verification Workshop. Bremen, DE, 4--20.Google ScholarGoogle Scholar
  2. Eyad Alkassar and Mark A. Hillebrand. 2008. Formal Functional Verification of Device Drivers. In Verified Software: Theories, Tools and Experiments (Lecture Notes in Computer Science, Vol. 5295). Springer, Toronto, Canada, 225--239.Google ScholarGoogle Scholar
  3. Sidney Amani, Alex Hixon, Zilin Chen, Christine Rizkallah, Peter Chubb, Liam O'Connor, Joel Beeren, Yutaka Nagashima, Japheth Lim, Thomas Sewell, Joseph Tuong, Gabriele Keller, Toby Murray, Gerwin Klein, and Gernot Heiser. 2016. Cogent: Verifying High-Assurance File System Implementations. In International Conference on Architectural Support for Programming Languages and Operating Systems. Atlanta, GA, USA, 175--188. https://doi.org/10.1145/2872362.2872404Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Andrew W. Appel. 2011. Verified Software Toolchain - (Invited Talk). In European Symposium on Programming (ESOP) (LNCS, Vol. 6602). Springer, 1--17. https://doi.org/10.1007/978-3-642-19718-5_1Google ScholarGoogle ScholarCross RefCross Ref
  5. Andrew W. Appel, Robert Dockins, Aquinas Hobor, Lennart Beringer, Josiah Dodds, Gordon Stewart, Sandrine Blazy, and Xavier Leroy. 2014. Program Logics for Certified Compilers. Cambridge University Press, USA.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Vytautas Astrauskas, Christoph Matheja, Federico Poli, Peter Müller, and Alexander J. Summers. 2020. How do programmers use unsafe Rust? Proceedings of the ACM on Programming Languages 4, OOPSLA (2020), 136:1--136:27. https://doi.org/10.1145/3428204Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Hao Chen, Xiongnan (Newman) Wu, Zhong Shao, Joshua Lockerman, and Ronghui Gu. 2016. Toward compositional verification of interruptible OS kernels and device drivers. In ACM SIGPLAN Conference on Programming Language Design and Implementation. 431--447. https://doi.org/10.1145/2908080.2908101Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Jianjun Duan and John Regehr. 2010. Correctness Proofs for Device Drivers in Embedded Systems. In Systems Software Verification. USENIX Association, Vancouver, BC, CA.Google ScholarGoogle Scholar
  9. Adam Dunkels. 2001. Minimal TCP/IP implementation with proxy support. Technical Report T2001-20. SICS. 81 pages. http://www.sics.se/~adam/thesis.pdf.Google ScholarGoogle Scholar
  10. Ana Nora Evans, Bradford Campbell, and Mary Lou Soffa. 2020. Is Rust Used Safely by Software Developers?. In International Conference on Software Engineering. 246--257. https://doi.org/10.1145/3377811.3380413Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Alejandro Gómez-Londoño, Johannes Åman Pohjola, Hira Taqdees Syeda, Magnus O. Myreen, and Yong Kiam Tan. 2020. Do you have space for dessert? a verified space cost semantics for CakeML programs. Proc. ACM Program. Lang. 4, OOPSLA (2020), 204:1--204:29. https://doi.org/10.1145/3428272Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. David Greenaway, Japheth Lim, June Andronick, and Gerwin Klein. 2014. Don't Sweat the Small Stuff: Formal Verification of C Code Without the Pain. In ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, Edinburgh, UK, 429--439. https://doi.org/10.1145/2594291.2594296Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Gernot Heiser, Lucy Parker, Peter Chubb, Ivan Velickovic, and Ben Leslie. 2022. Can We Put the "S" Into IoT?. In IEEE World Forum on Internet of Things. Yokohama, JP.Google ScholarGoogle Scholar
  14. Trevor Jim, J. Gregory Morrisett, Dan Grossman, Michael W. Hicks, James Cheney, and Yanling Wang. 2002. Cyclone: A Safe Dialect of C. In Proceedings of the General Track: 2002 USENIX Annual Technical Conference, June 10--15, 2002, Monterey, California, USA. USENIX, 275--288. http://www.usenix.org/publications/library/proceedings/usenix02/jim.htmlGoogle ScholarGoogle Scholar
  15. Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, and Derek Dreyer. 2018. RustBelt: securing the foundations of the rust programming language. Proc. ACM Program. Lang. 2, POPL (2018), 66:1--66:34. https://doi.org/10.1145/3158154Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Shuanglong Kan, David Sanán, Shang-Wei Lin, and Yang Liu. 2018. K-Rust: An Executable Formal Semantics for Rust. CoRR abs/1804.07608 (2018). http://arxiv.org/abs/1804.07608 Preprint.Google ScholarGoogle Scholar
  17. Moonzoo Kim, Yunja Choi, Yunho Kim, and Hotae Kim. 2008. Formal Verification of a Flash Memory Device Driver -- An Experience Report. In SPIN Workshop on Model Checking Software (Lecture Notes in Computer Science, Vol. 5156). Los Angeles, CA, US, 144--159. https://doi.org/10.1007/978-3-540-85114-1_12Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Steve Klabnik and Carol Nichols. 2017. The Rust Programming Language. No Starch Press.Google ScholarGoogle Scholar
  19. Gerwin Klein, June Andronick, Kevin Elphinstone, Toby Murray, Thomas Sewell, Rafal Kolanski, and Gernot Heiser. 2014. Comprehensive Formal Verification of an OS Microkernel. ACM Transactions on Computer Systems 32, 1 (Feb. 2014), 2:1--2:70. https://doi.org/10.1145/2560537Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Ramana Kumar, Magnus Myreen, Michael Norrish, and Scott Owens. 2014. CakeML: A Verified Implementation of ML. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press, San Diego, 179--191. https://doi.org/10.1145/2535838.2535841Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Xavier Leroy. 2009. Formal verification of a realistic compiler. Commun. ACM 52, 7 (2009), 107--115. https://doi.org/10.1145/1538788.1538814Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. MITRE Corporation. 2023. Linux >> Linux Kernel: Security Vulnerabilities (CVSS score ≥ 9). https://www.cvedetails.com/vulnerability-list.php?vendor_id=33&product_id=47&version_id=&page=1&hasexp=0&opdos=0&opec=0&opov=0&opcsrf=0&opgpriv=0&opsqli=0&opxss=0&opdirt=0&opmemc=0&ophttprs=0&opbyp=0&opfileinc=0&opginf=0&cvssscoremin=9&cvssscoremax=0&year=0&month=0&cweid=0&order=1&trc=3034&sha=544260ec3a86a7e17f8b02b39d6342815d8d4bd5 Accessed: 2023-01-25.Google ScholarGoogle Scholar
  23. Tomas Möre. 2021. Formal verification of device driver monitors in HOL 4. Masters Thesis. School of EECS, KTH, SE.Google ScholarGoogle Scholar
  24. Magnus O. Myreen. 2021. A Minimalistic Verified Bootstrapped Compiler (Proof Pearl). In Certified Programs and Proofs (CPP). ACM, 32--45. https://doi.org/10.1145/3437992.3439915Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Magnus O. Myreen, Michael J. C. Gordon, and Konrad Slind. 2008. Machinecode Verification for Multiple Architectures: An Application of Decompilation into Logic. In Proceedings of the 2008 Conference on Formal Methods in Computer-Aided Design. IEEE, Portland, OR, US.Google ScholarGoogle ScholarCross RefCross Ref
  26. Wolfgang Naraschewski and Tobias Nipkow. 1999. Type Inference Verified: Algorithm W in Isabelle/HOL. J. Autom. Reason. 23, 3--4 (1999), 299--318. https://doi.org/10.1023/A:1006277616879Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Scott Owens, Magnus O. Myreen, Ramana Kumar, and Yong Kiam Tan. 2016. Functional Big-Step Semantics. In European Symposium on Programming (ESOP) (LNCS, Vol. 9632). Springer, 589--615. https://doi.org/10.1007/978-3-662-49498-1_23Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Lucy Parker. 2023. The seL4 Device Driver Framework. https://trustworthy.systems/publications/papers/Parker_23%3Asel4s.abstract Talk at the 5th seL4 Summit.Google ScholarGoogle Scholar
  29. Willem Penninckx, Jan Tobias Mühlberg, Jan Smans, Bart Jacobs, and Frank Piessens. 2012. Sound Formal Verification of Linux's USB BP Keyboard Driver. In NASA Formal Methods Symposium (Lecture Notes in Computer Science, Vol. 7226). https://doi.org/10.1007/978-3-642-28891-3_21Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Leonid Ryzhyk, Peter Chubb, Ihor Kuz, and Gernot Heiser. 2009. Dingo: Taming Device Drivers. In EuroSys Conference. Nuremberg, DE, 275--288.Google ScholarGoogle Scholar
  31. Leonid Ryzhyk, Yanjin Zhu, and Gernot Heiser. 2010. The Case for Active Device Drivers. In Asia-Pacific Workshop on Systems (APSys). New Delhi, India, 25--30.Google ScholarGoogle Scholar
  32. Thomas Sewell, Magnus Myreen, and Gerwin Klein. 2013. Translation Validation for a Verified OS Kernel. In ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, Seattle, Washington, USA, 471--481.Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Konrad Slind and Michael Norrish. 2008. A Brief Overview of HOL4. In Theorem Proving in Higher Order Logics (TPHOLs) (LNCS, Vol. 5170). Springer, 28--32. https://doi.org/10.1007/978-3-540-71067-7_6Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Yong Kiam Tan, Magnus Myreen, Ramana Kumar, Anthony Fox, Scott Owens, and Michael Norrish. 2019. The verified CakeML compiler backend. Journal of Functional Programming 29 (Feb. 2019), 57 pages. https://doi.org/10.1017/S0956796818000229Google ScholarGoogle ScholarCross RefCross Ref
  35. Trustworthy Systems. 2023. The seL4 Microkit. UNSW Sydney. https://trustworthy.systems/projects/microkit/Google ScholarGoogle Scholar
  36. Feng Wang, Fu Song, Min Zhang, Xiaoran Zhu, and Jun Zhang. 2018. KRust: A Formal Executable Semantics of Rust. In 2018 International Symposium on Theoretical Aspects of Software Engineering, TASE 2018, Guangzhou, China, August 29-31, 2018. IEEE Computer Society, 44--51. https://doi.org/10.1109/TASE.2018.00014Google ScholarGoogle ScholarCross RefCross Ref
  37. Aaron Weiss, Daniel Patterson, Nicholas D. Matsakis, and Amal Ahmed. 2019. Oxide: The Essence of Rust. CoRR abs/1903.00982 (2019). http://arxiv.org/abs/1903.00982 Preprint.Google ScholarGoogle Scholar
  38. Ian Wienand and Luke Macpherson. 2004. ipbench: A Framework for Distributed Network Benchmarking. In Conference for Unix, Linux and Open Source Professionals (AUUG). Melbourne, Australia, 163--170.Google ScholarGoogle Scholar
  39. Li-yao Xia, Yannick Zakowski, Paul He, Chung-Kil Hur, Gregory Malecha, Benjamin C. Pierce, and Steve Zdancewic. 2020. Interaction trees: representing recursive and impure programs in Coq. Proceedings of the ACM on Programming Languages 4 (Jan. 2020), 51:1--51:32. https://doi.org/10.1145/3371119Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Pancake: Verified Systems Programming Made Sweeter
          Index terms have been assigned to the content through auto-classification.

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            PLOS '23: Proceedings of the 12th Workshop on Programming Languages and Operating Systems
            October 2023
            96 pages
            ISBN:9798400704048
            DOI:10.1145/3623759

            Copyright © 2023 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 23 October 2023

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • short-paper
            • Research
            • Refereed limited

            Acceptance Rates

            Overall Acceptance Rate17of32submissions,53%

            Upcoming Conference

            SOSP '24
          • Article Metrics

            • Downloads (Last 12 months)105
            • Downloads (Last 6 weeks)10

            Other Metrics

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader