Skip to content

redbeardster/zircon-caps-isabelle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Formal Verification of Zircon Microkernel Capability System in Isabelle/HOL

Overview

This repository contains a complete formal verification of the capability-based security model used in the Zircon microkernel (the foundation of Google's Fuchsia OS). Using the interactive theorem prover Isabelle/HOL, we provide a mathematically rigorous model of Zircon's handle-based permission system and prove its fundamental security properties.

Key Features

Formal Model: A complete Isabelle/HOL specification of Zircon's kernel objects, handles, and rights system

Security Proofs: Machine-checked proofs of critical security properties including:

  • Monotonicity of rights (rights can only decrease, never increase)
  • No privilege escalation
  • Preservation of object references during handle transfer
  • Idempotence of rights reduction
  • Practical Example: A working example demonstrating the creation and transfer of a VMO (Virtual Memory Object) with proper rights reduction
  • System Call Model: Formal specification of Zircon's system call permission checking mechanism

Formal Model Components

  1. Basic Types
  • Handle IDs: 32-bit identifiers for kernel object references
  • Kernel Object Types: Process, Thread, Channel, VMO, etc.
  • Rights: Atomic permissions (READ, WRITE, EXECUTE, MAP, TRANSFER, DUPLICATE, SIGNAL)
  1. Core Definitions
  • Kernel Objects: Records containing type and unique identifier
  • Handles: References to kernel objects with associated rights
  • Handle Tables: Partial mappings from handle IDs to handles
  1. Key Operations
  • create_object: Creates new kernel objects with initial rights
  • transfer_handle: Transfers handles between processes with rights reduction
  • zircon_syscall: Models Zircon's system call permission checking

Verified Security Properties

Theorem 1: No Rights Escalation

theorem no_rights_escalation:
  assumes "transfer_handle src_hid new_rights ht = (ht', Some new_hid)"
  assumes "ht' new_hid = Some new_handle"
  assumes "ht src_hid = Some src_handle"
  shows "¬(∃r. r ∈ h_rights new_handle ∧ r ∉ h_rights src_handle)"

Proof: Rights can only be reduced during transfer, never increased.

Theorem 2: Transfer Preserves Object Reference

lemma transfer_preserves_object:
  assumes "transfer_handle src_hid new_rights ht = (ht', Some new_hid)"
  assumes "ht src_hid = Some src_handle"
  assumes "ht' new_hid = Some new_handle"
  shows "h_obj new_handle = h_obj src_handle"

Proof: Handle transfer only changes rights, not the underlying kernel object.

Theorem 3: Rights Reduction is Idempotent

  "reduce_rights R1 (reduce_rights R2 R) = reduce_rights (R1 ∩ R2) R"

Proof: Multiple rights reductions are equivalent to a single intersection.

Example Scenario

The model includes a practical example demonstrating Zircon's security properties:

  • Create a VMO with READ and WRITE rights
  • Transfer the VMO handle to another process, requesting only READ rights
  • Verify that the receiving process gets READ but not WRITE access

This example is formally proved correct in the example_scenario_true lemma.

Related Work

This work builds upon and contributes to several areas:

  • Formal Methods for OS Kernels: Following the tradition of seL4, Verve, and CertiKOS
  • Capability-Based Security: Extends formal models of capability systems
  • Zircon/Fuchsia Security: Provides formal foundations for Google's Fuchsia OS security model
  • Isabelle/HOL Applications: Demonstrates practical use of interactive theorem proving for real-world systems

Technical Details

Isabelle/HOL Features Used:

  • Higher-Order Logic: For expressing complex security properties
  • Record Types: For modeling kernel objects and handles
  • Partial Functions: For handle table representation
  • Set Theory: For rights and permissions modeling
  • SMT Integration: For automated proof assistance

Model Limitations

  • Simplified handle ID generation (sequential)
  • Abstract representation of kernel objects
  • Focus on permission system rather than full kernel functionality

Applications

This formal model can be used for:

  • Security Analysis: Rigorous verification of Zircon's security properties
  • Education: Teaching capability-based security and formal methods
  • Extension: Basis for modeling other aspects of Zircon/Fuchsia
  • Cross-Verification: Comparison with other capability systems

Future Work

Potential extensions to this model include:

  • Concurrency: Modeling multi-threaded access to handles
  • Full Kernel API: Formalizing more Zircon system calls
  • Refinement: Connecting to lower-level implementation details
  • Composition: Verifying properties of complex capability chains

References

Authors

redbeardster@gmail.com - Formal modeling and verification

License

This work is provided for educational and research purposes. See individual files for specific licensing information.

Acknowledgments

  • The Isabelle/HOL community for the excellent proof assistant
  • Google Fuchsia team for the Zircon microkernel design
  • Researchers in formal methods and OS verification for foundational work

"In mathematics you don't understand things. You just get used to them." – John von Neumann

This formal verification brings us one step closer to understanding – and proving – the security of modern operating systems.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published