Formalization, Implementation, and Verification of the Bluetooth L2CAP State Machine
Tan Khang Le, Mohammad Omidvar Tehrani, Yuepeng Wang, Jianliang Wu, Steven Y. Ko
Abstract
The Logical Link Control and Adaptation Protocol (L2CAP) is a core Bluetooth component, and verifying its correctness is crucial for reliable and secure connectivity. However, verification can be challenging due to the complexity and ambiguities in its natural language (English) specification. In this paper, we present a formally verified implementation of the L2CAP state machine. Our approach introduces the Specification State Machine (SSM) to formalize the L2CAP state machine in the specification and the Operational State Machine (OSM) as an abstraction of the implementation. We then formally prove that (i) OSM refines SSM, and (ii) our implementation semantically conforms to OSM. By combining these two proofs, we verify that our implementation complies with our formalization of the specification. Furthermore, we define critical safety and liveness properties and formally prove that our implementation satisfies these guarantees. To ensure practicality, we implement the L2CAP state machine in Dafny and integrate it into Android's Fluoride Bluetooth stack. Our evaluation demonstrates that our formally verified implementation maintains competitive performance while ensuring formal correctness.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 148507ff-b070-4555-8144-fa3e68bea331Builds on7
- Validating SMT solvers via semantic fusionDominik Winterer, Chengyu Zhang, Zhendong SuPLDI 2020 · 80 citations
- Storage Systems are Distributed Systems (So Verify Them That Way!)Travis Hance, Andrea Lattuada, Chris Hawblitzel, Jon Howell et al.OSDI 2020 · 52 citations
- BadBluetooth: Breaking Android Security Mechanisms via Malicious Bluetooth PeripheralsFenghao Xu, Wenrui Diao, Zhou Li, Jiongyi Chen et al.NDSS 2019 · 51 citations
- Formal Model-Driven Discovery of Bluetooth Protocol Design VulnerabilitiesJianliang Wu, Ruoyu Wu, Dongyan Xu, Dave Jing Tian et al.S&P 2022 · 36 citations
- Testing Dafny (experience paper)Ahmed Irfan, Sorawee Porncharoenwase, Zvonimir Rakamaric, Neha Rungta et al.ISSTA 2022 · 15 citations
Related papers
- FormalJudge: A Neuro-Symbolic Paradigm for Agentic OversightJiayi Zhou, Yang Sheng, Hantao Lou, Yaodong Yang et al.ICML 2026
- Formally Verifying the State Machine of TLS 1.3 Handshake in OpenSSLJingjing Guan, Hui Li, Xiangdong Li, Xiaolei Wang et al.INFOCOM 2025 · 3 citations
- DafnyMPI: A Dafny Library for Verifying Message-Passing Concurrent ProgramsAleksandr Fedchin, Antero Mejr, Hari Sundar, Jeffrey S. FosterPOPL 2026 · 1 citation
- BSFuzzer: Context-Aware Semantic Fuzzing for BLE Logic Flaw DetectionTing Yang, Yue Qin, Lan Zhang, Zhiyuan Fu et al.NDSS 2026 · 1 citation
- BlueSWAT: A Lightweight State-Aware Security Framework for Bluetooth Low EnergyXijia Che, Yi He, Xuewei Feng, Kun Sun et al.CCS 2024 · 10 citations
