Confidential VM 時代の今こそ、OS を丸ごと形式検証しよう〜Ironclad ...

Acompany PRO
December 01, 2026

Confidential VM 時代の今こそ、OS を丸ごと形式検証しよう〜Ironclad Apps (OSDI '14) 再訪〜

2026年11月27日に開催された、「Confidential Computing勉強会」の登壇資料です。

▼イベントの詳細
https://acompany.connpass.com/event/407013/

Acompany PRO

December 01, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

40 slides
  1. Confidential Confidential VM VM 時⁠代⁠の​今⁠こ⁠そ⁠、 時⁠代⁠の​今⁠こ⁠そ⁠、 OS OS を​丸⁠ご⁠と​形⁠式⁠検⁠証⁠し⁠よ⁠う を​丸⁠ご⁠と​形⁠式⁠検⁠証⁠し⁠よ⁠う

    〜 Ironclad Apps (OSDI ’14) 再⁠訪 〜 〜 〜 Ironclad Ironclad Apps Apps (OSDI (OSDI ’14) ’14) 再⁠訪 再⁠訪 〜 〜 〜 Ironclad Apps (OSDI ’14) 再⁠訪 〜 椎⁠名 峻⁠平​(Acompany AI Lab) 2026.11.27 Confidential Computing 勉⁠強⁠会 #1 © Acompany Co., Ltd. 1
  2. 01 背⁠景 Intel SGX は​終⁠了⁠し⁠、Confidential VM の​時⁠代⁠へ Intel SGX Confidential

    VM ア⁠プ⁠リ⁠ケ⁠ー⁠シ⁠ョ⁠ン TEE (Confidential VM) TEE 保⁠護⁠さ⁠れ⁠な⁠い​ プ⁠ロ⁠グ⁠ラ⁠ム プ⁠ロ⁠グ⁠ラ⁠ム OS ア⁠プ⁠リ⁠ケ⁠ー⁠シ⁠ョ⁠ン ゲ⁠ス⁠ト OS ホ⁠ス⁠ト / ハ⁠イ⁠パ⁠ー⁠バ⁠イ⁠ザ プ⁠ロ⁠グ⁠ラ⁠ム⁠レ⁠ベ⁠ル⁠の​隔⁠離 TEE 上⁠で OS を​丸⁠ご⁠と​動⁠か⁠す 独⁠自⁠の SDK を​用⁠い⁠た​開⁠発⁠が​必⁠要 Intel TDX, AMD SEV-SNP な⁠ど 2026 年 10 月⁠に​廃⁠止⁠方​針⁠を​発⁠表1 既⁠存⁠ソ⁠フ⁠ト⁠ウ⁠ェ⁠ア⁠の​改⁠変⁠不⁠要 し⁠か⁠し​セ⁠キ⁠ュ⁠リ⁠テ⁠ィ⁠は…? © Acompany Co., Ltd. 1 Intel, Transition Paths for Intel® SGX Applications to Intel® TDX (2026-10-09) 2
  3. 01 背⁠景 Confidential VM の​セ⁠キ⁠ュ⁠リ⁠テ⁠ィ OS 全⁠体⁠が​信⁠頼⁠の​対⁠象⁠と​な⁠る​(TCB に​含⁠ま⁠れ⁠る⁠)​た⁠め⁠、SGX と​比⁠べ⁠て​攻⁠撃⁠界⁠面⁠が​増⁠大 TEE

    (Confidential VM) ア⁠プ⁠リ⁠ケ⁠ー⁠シ⁠ョ⁠ン 依⁠存⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠・⁠ツ⁠ー⁠ル す⁠べ⁠て​信⁠頼⁠対⁠象⁠! ゲ⁠ス⁠ト OS(Linux な⁠ど⁠) 想⁠定⁠さ⁠れ⁠る​脅⁠威: × Linux カ⁠ー⁠ネ⁠ル⁠の​脆⁠弱⁠性 権⁠限⁠昇⁠格⁠に​よ⁠り root 権⁠限⁠を​奪⁠わ⁠れ⁠る メ⁠モ⁠リ⁠へ⁠の​直⁠接⁠ア⁠ク⁠セ⁠ス ホ⁠ス⁠ト / ハ⁠イ⁠パ⁠ー⁠バ⁠イ⁠ザ サ⁠プ⁠ラ⁠イ⁠チ⁠ェ⁠ー⁠ン⁠攻⁠撃 依⁠存⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠や​ツ⁠ー⁠ル⁠に​悪⁠意⁠あ⁠る​コ⁠ー⁠ド⁠が​混⁠入 設⁠定⁠ミ⁠ス⁠に​よ⁠る​侵⁠入 SSH な⁠ど⁠の​設⁠定⁠不⁠備⁠で​第⁠三⁠者⁠が OS に​ロ⁠グ⁠イ⁠ン … © Acompany Co., Ltd. 3
  4. 01 背⁠景 OS・⁠ア⁠プ⁠リ⁠ケ⁠ー⁠シ⁠ョ⁠ン⁠全⁠体⁠の​安⁠全⁠性⁠を​ど⁠う​検⁠証⁠す⁠る⁠か⁠? 一⁠般⁠的⁠な​対⁠策 形⁠式⁠検⁠証 Linux や​依⁠存⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠の​脆⁠弱⁠性⁠情⁠報⁠を​追⁠い​ か⁠け⁠、​い⁠ち⁠早⁠く​パ⁠ッ⁠チ⁠を​適⁠用 仕⁠様⁠を​形⁠式⁠的⁠に​記⁠述⁠し⁠、​実⁠装⁠が​仕⁠様⁠を​満⁠た⁠す​ こ⁠と⁠を​機⁠械⁠的⁠に​検⁠証

    実⁠装⁠・⁠設⁠定⁠内⁠容⁠を​専⁠門⁠家⁠が​徹⁠底⁠的⁠に​レ⁠ビ⁠ュ⁠ー 具⁠体⁠的⁠な​テ⁠ス⁠ト⁠ケ⁠ー⁠ス⁠に​依⁠存⁠せ⁠ず⁠、​論⁠理⁠で​ 安⁠全⁠性⁠を​保⁠証⁠す⁠る​こ⁠と⁠が​可⁠能 テ⁠ス⁠ト⁠の​数⁠・⁠コ⁠ー⁠ナ⁠ー⁠ケ⁠ー⁠ス⁠を​増⁠や⁠す AI 脆⁠弱⁠性⁠診⁠断⁠の​活⁠用 … な⁠ど⁠な⁠ど⁠、​ア⁠ド⁠ホ⁠ッ⁠ク⁠な​対⁠策⁠が​必⁠要 TEE を​使⁠っ⁠て⁠い⁠な⁠い​場⁠合⁠と​大⁠き⁠く​ 変⁠わ⁠ら⁠な⁠い…? © Acompany Co., Ltd. 仕⁠様⁠の​レ⁠ビ⁠ュ⁠ー⁠は​必⁠須 仕⁠様⁠が TCB に​含⁠ま⁠れ⁠、​実⁠装⁠は TCB か⁠ら​ 外⁠せ⁠る​(⁠検⁠証⁠ツ⁠ー⁠ル⁠自⁠体⁠の​実⁠装⁠は TCB) 堅⁠牢⁠な​ソ⁠フ⁠ト⁠ウ⁠ェ⁠ア⁠を​作⁠れ⁠そ⁠う⁠。 し⁠か⁠し OS 含⁠め⁠た​シ⁠ス⁠テ⁠ム⁠全⁠体⁠を​ 形⁠式⁠検⁠証⁠す⁠る⁠の⁠は​現⁠実⁠的⁠? 4
  5. 01 背⁠景 近⁠年⁠の AI に​よ⁠る​形⁠式⁠検⁠証⁠・⁠証⁠明 従⁠来⁠は​専⁠門⁠家⁠で⁠も​莫⁠大⁠な​時⁠間⁠が​か⁠か⁠っ⁠て⁠い⁠た​形⁠式⁠化⁠・⁠証⁠明⁠の​記⁠述⁠が⁠、​高⁠性⁠能⁠な AI に​よ⁠っ⁠て​大⁠幅⁠に​効⁠率⁠化 Anthropic Microsoft

    Research 既⁠存⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠の​バ⁠イ⁠ナ⁠リ⁠検⁠証 Proof-Driven Development Kit 既⁠存⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠の​バ⁠イ⁠ナ⁠リ⁠を​ 直⁠接⁠検⁠証⁠、​一⁠定⁠の​安⁠全⁠性⁠を​証⁠明 煩⁠雑⁠な​証⁠明⁠の​記⁠述⁠は AI が​担⁠い⁠、 Rocq で​検⁠証 LLMs are making formal software verification feasible at a much larger scale (2026-10-22) © Acompany Co., Ltd. Google DeepMind AlphaProof Code AI が​仕⁠様⁠・⁠実⁠装⁠・⁠証⁠明⁠の​ 作⁠成⁠を​支⁠援⁠す⁠る​ 開⁠発⁠フ⁠レ⁠ー⁠ム⁠ワ⁠ー⁠ク Signal の​暗⁠号⁠通⁠信⁠実⁠装⁠の​ バ⁠イ⁠ナ⁠リ⁠を​直⁠接⁠検⁠証⁠し⁠、​ 機⁠密⁠性⁠・⁠認⁠証⁠な⁠ど⁠を​証⁠明 Rust 製 Web ア⁠プ⁠リ⁠の​ ロ⁠グ⁠イ⁠ン⁠処⁠理⁠を Verus で​検⁠証 AI が​証⁠明⁠を​記⁠述⁠、Lean で​検⁠証 Formally verifying agent-written full-stack web apps with PDD Kit (2026-11-05) AlphaProof Code: Verifying Signal’s Security at the Machine-Code Level (2026-11-10) 5
  6. 01 背⁠景 OS を​丸⁠ご⁠と​形⁠式⁠検⁠証⁠す⁠る⁠、⁠と​い⁠う​ア⁠プ⁠ロ⁠ー⁠チ AI が​証⁠明⁠記⁠述⁠を​担⁠う​現⁠代⁠で⁠は⁠、OS 全⁠体⁠の​形⁠式⁠検⁠証⁠も​現⁠実⁠的⁠な​手⁠段⁠に⁠? OS カ⁠ー⁠ネ⁠ル⁠を​丸⁠ご⁠と​形⁠式⁠検⁠証⁠す⁠る​研⁠究⁠は​以⁠前⁠か⁠ら​存⁠在​(seL4 な⁠ど⁠)

    seL4:2009 年⁠に C 言⁠語⁠レ⁠ベ⁠ル⁠の​正⁠し⁠さ⁠を​検⁠証1、 2013 年⁠に​バ⁠イ⁠ナ⁠リ⁠の​レ⁠ベ⁠ル⁠の​意⁠味⁠論⁠ま⁠で​拡⁠張2 し⁠か⁠し​証⁠明⁠コ⁠ス⁠ト⁠が​高⁠く⁠、​機⁠能⁠も​限⁠定⁠的 seL4 の 2009 年⁠の​検⁠証⁠で⁠は​約 20 人⁠年⁠と​報⁠告​(⁠検⁠証⁠ツ⁠ー⁠ル⁠な⁠ど⁠の​開⁠発⁠を​含⁠む⁠) 対⁠象⁠は​小⁠さ⁠な​マ⁠イ⁠ク⁠ロ⁠カ⁠ー⁠ネ⁠ル⁠で⁠、​ド⁠ラ⁠イ⁠バ⁠や​ネ⁠ッ⁠ト⁠ワ⁠ー⁠ク⁠な⁠ど⁠も​含⁠む⁠、Linux 相⁠当⁠の OS 全⁠体⁠の​ 検⁠証⁠と⁠は​大⁠き⁠な​隔⁠た⁠り 今⁠回⁠は⁠、OS・⁠ア⁠プ⁠リ⁠全⁠体⁠の​形⁠式⁠検⁠証⁠を​可⁠能⁠に​す⁠る Ironclad Apps (OSDI ‘14)3 に​注⁠目 OS・⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠・⁠ド⁠ラ⁠イ⁠バ⁠ま⁠で​含⁠む⁠実⁠行⁠バ⁠イ⁠ナ⁠リ⁠全⁠体⁠が⁠、​ア⁠プ⁠リ⁠の​仕⁠様⁠を​満⁠た⁠す​こ⁠と⁠を​検⁠証 seL4 で⁠は​カ⁠ー⁠ネ⁠ル⁠自⁠体⁠の​安⁠全⁠性​(⁠隔⁠離⁠の​保⁠証⁠な⁠ど⁠)⁠が​目⁠的⁠で⁠、​ア⁠プ⁠リ⁠含⁠め⁠た​全⁠体⁠の​証⁠明⁠は​対⁠象⁠外 © Acompany Co., Ltd. 1 seL4: Formal Verification of an OS Kernel (SOSP ‘09) 2 Translation Validation for a Verified OS Kernel (PLDI ‘13) 3 Ironclad Apps: End-to-End Security via Automated Full-System Verification (OSDI ‘14) 6
  7. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Ironclad Apps (OSDI ‘14)

    概⁠要 Microsoft Research、​ペ⁠ン⁠シ⁠ル⁠ベ⁠ニ⁠ア⁠大⁠学⁠、​ コ⁠ー⁠ネ⁠ル⁠大⁠学⁠の​研⁠究⁠者⁠に​よ⁠る​共⁠同⁠研⁠究 OS か⁠ら​ア⁠プ⁠リ⁠ま⁠で を​一⁠貫⁠し⁠て​形⁠式⁠検⁠証⁠。​ ラ⁠ン⁠タ⁠イ⁠ム⁠・⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠・⁠ド⁠ラ⁠イ⁠バ⁠も​含⁠む Dafny で​仕⁠様⁠・​実⁠装⁠を​記⁠述⁠し⁠、​仕⁠様⁠を​満⁠た⁠す​ こ⁠と⁠を x86 ア⁠セ⁠ン⁠ブ⁠リ⁠の​レ⁠ベ⁠ル⁠で​保⁠証 リ⁠モ⁠ー⁠ト⁠ア⁠テ⁠ス⁠テ⁠ー⁠シ⁠ョ⁠ン で⁠、​ 検⁠証⁠済⁠み⁠コ⁠ー⁠ド⁠の​実⁠行⁠を​利⁠用⁠者⁠が​確⁠認 TEE で⁠は⁠な⁠く TPM を​用⁠い⁠る SGX 製⁠品⁠化​(2015 年⁠)​以⁠前⁠の​研⁠究​(⁠!⁠) 4 種⁠類⁠の​ア⁠プ⁠リ⁠を​実⁠装⁠し⁠、​評⁠価 © Acompany Co., Ltd. Ironclad Apps: End-to-End Security via Automated Full-System Verification Chris Hawblitzel, Jon Howell, Jacob R. Lorch, Arjun Narayan† , Bryan Parno, Danfeng Zhang , Brian Zill Microsoft Research † University of Pennsylvania Abstract An Ironclad App lets a user securely transmit her data to a remote machine with the guarantee that every instruction executed on that machine adheres to a formal abstract specification of the app’s behavior. This does more than eliminate implementation vulnerabilities such as buffer overflows, parsing errors, or data leaks; it tells the user exactly how the app will behave at all times. We provide these guarantees via complete, low-level software verification. We then use cryptography and secure hardware to enable secure channels from the verified software to remote users. To achieve such complete verification, we developed a set of new and modified tools, a collection of techniques and engineering disciplines, and a methodology focused on rapid development of verified systems software. We describe our methodology, formal results, and lessons we learned from building a full stack of verified software. That software includes a verified kernel; verified drivers; verified system and crypto libraries including SHA, HMAC, and RSA; and four Ironclad Apps. 1 Introduction Today, when Alice submits her personal data to a remote service, she has little assurance that her data will remain secure. At best, she has vague legal guarantees provided by the service’s privacy policy and the hope that the owner will follow industry best practices. Even then, a vulnerable OS, library, or application may undermine the service provider’s best intentions [51]. In theory, complete formal verification of the service’s code would replace this tenuous position with the strong mathematical guarantee that the service precisely matches Alice’s formally specified security expectations. Unfortunately, while software verification provides strong guarantees [4, 6, 8, 17, 39], the cost is often high [25, 35, 36]; e.g., seL4 took over 22 person-years of effort to verify a microkernel. Some strong guarantees have been obtained in much less time, but those guarantees depend on unverified lower-level code. For example, past work produced a verified TLS implementation [9] and a proof of correctness for RSA-OAEP [7]. In both cases, though, they assumed the crypto libraries, their runtimes (e.g., .NET), and the OS were correct.  Cornell University does not assume that any piece of server software is correct. (2) The proof covers the assembly code that gets executed, not the high-level language in which the app is written. Thus, it assumes that the hardware is correct, but assumes nothing about the correctness of the compiler or runtime. (3) The verification demonstrates remote equivalence: that to a remote party the app’s implementation is indistinguishable from the app’s high-level abstract state machine. Verifiable remote equivalence dictates the behavior of the entire system in every possible situation. Thus, this approach provides stronger guarantees than type checkers or tools that look for classes of bugs such as buffer overflows or bounds errors. Our proof of remote equivalence involves proving properties of both functional correctness and information flow; we do the latter by proving noninterference, a relationship between two runs of the same code with different inputs. We then show how remote equivalence can be strengthened to secure remote equivalence via Trusted Computing [3, 53]. Specifically, the app verifiably uses secure hardware, including a TPM [63], to convince a remote client that its public key corresponds to a private key known only to the app. The client uses the public key to establish a secure channel, thereby achieving security equivalent to direct communication with the abstractly specified app [30]. Another goal of our work is to make it feasible to build Ironclad Apps with modest developer effort. Previous efforts, such as seL4 [35] or VCC [13], took tens of personyears to verify one software layer, so verifying an entire stack using these techniques may be prohibitive. To reduce developer effort, we use state-of-the-art tools for automated software verification, such as Dafny [39], Boogie [4], and Z3 [17]. These tools need much less guidance from developers than interactive proof assistants used in previous work [35, 52]. However, many in the verification community worry that automated verification cannot scale to large software and that the tools’ heuristics inevitably lead to unstable verification results. Indeed, we encountered these challenges, and dealt with them in multiple ways: via two new tools (§3.4); via modifications to existing verification Ironclad Apps: End-to-End Security via Automated Full-System Verification (OSDI ‘14) 8
  8. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 リ⁠モ⁠ー⁠ト⁠ア⁠テ⁠ス⁠テ⁠ー⁠シ⁠ョ⁠ン⁠で​ア⁠プ⁠リ⁠の​性⁠質⁠を​検⁠証 通⁠常⁠の​ア⁠テ⁠ス⁠テ⁠ー⁠シ⁠ョ⁠ン Ironclad に​お⁠け⁠る​ア⁠テ⁠ス⁠テ⁠ー⁠シ⁠ョ⁠ン

    遠⁠隔⁠サ⁠ー⁠ビ⁠ス 遠⁠隔⁠サ⁠ー⁠ビ⁠ス 起⁠動⁠の​証⁠明 起⁠動⁠の​証⁠明 利⁠用⁠者 デ⁠ー⁠タ⁠の​送⁠信 バ⁠イ⁠ナ⁠リ 性⁠質⁠は​不⁠明 特⁠定⁠の​バ⁠イ⁠ナ⁠リ⁠の OS が​起⁠動⁠し⁠たこ⁠と⁠を​確⁠認 そ⁠の​バ⁠イ⁠ナ⁠リ⁠の​性⁠質⁠は⁠、​ ア⁠テ⁠ス⁠テ⁠ー⁠シ⁠ョ⁠ン⁠だ⁠け⁠で⁠は​わ⁠か⁠ら⁠な⁠い 渡⁠し⁠た​デ⁠ー⁠タ⁠がど⁠う​使⁠わ⁠れ⁠る⁠か⁠ま⁠で⁠は​ 検⁠証⁠で⁠き⁠な⁠い 利⁠用⁠者 デ⁠ー⁠タ⁠の​送⁠信 バ⁠イ⁠ナ⁠リ 形⁠式⁠検⁠証⁠済⁠み 仕⁠様⁠を​満⁠た⁠すこ⁠と⁠を⁠、​バ⁠イ⁠ナ⁠リ⁠の​レ⁠ベ⁠ル⁠ま⁠で​ 形⁠式⁠検⁠証 ア⁠テ⁠ス⁠テ⁠ー⁠シ⁠ョ⁠ン⁠でそ⁠の​バ⁠イ⁠ナ⁠リ⁠の​起⁠動を​ 確⁠認 渡⁠し⁠た​デ⁠ー⁠タ⁠が仕⁠様⁠の​通⁠り⁠に​処⁠理⁠さ⁠れ⁠る​ こ⁠と⁠を​確⁠認⁠可⁠能 TEE で⁠も​同⁠様⁠に⁠、​ア⁠テ⁠ス⁠テ⁠ー⁠シ⁠ョ⁠ン⁠と​形⁠式⁠検⁠証⁠の​組⁠み⁠合⁠わ⁠せ⁠が​重⁠要 © Acompany Co., Ltd. 9
  9. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 一⁠般⁠的⁠な​形⁠式⁠検⁠証​(⁠通⁠常⁠の Dafny の​場⁠合⁠) ア⁠プ⁠リ⁠開⁠発⁠者⁠が

    Dafny 言⁠語⁠で​記⁠述 仕⁠様 実⁠装 高⁠水⁠準⁠の​仕⁠様 高⁠水⁠準⁠言⁠語⁠に​よ⁠る​実⁠装 Dafny の​検⁠証⁠器 判⁠定⁠結⁠果 機⁠械⁠語⁠に​よ⁠る​実⁠装 (x86) 信⁠頼⁠す⁠る​要⁠素 © Acompany Co., Ltd. コ⁠ン⁠パ⁠イ⁠ラ ツ⁠ー⁠ル 10
  10. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 一⁠般⁠的⁠な​形⁠式⁠検⁠証​(⁠通⁠常⁠の Dafny の​場⁠合⁠) 仕⁠様

    実⁠装 仕⁠様⁠は​人⁠が​徹⁠底⁠レ⁠ビ⁠ュ⁠ー ア⁠プ⁠リ⁠開⁠発⁠者⁠が Dafny 言⁠語⁠で​記⁠述 高⁠水⁠準⁠の​仕⁠様 高⁠水⁠準⁠言⁠語⁠に​よ⁠る​実⁠装 仕⁠様⁠の​抜⁠け⁠・​誤⁠り⁠が​あ⁠れ⁠ば⁠、 検⁠証⁠に​通⁠っ⁠て⁠も​バ⁠グ⁠は​発⁠生​(仕⁠様⁠バ⁠グ) Dafny の​検⁠証⁠器 判⁠定⁠結⁠果 機⁠械⁠語⁠に​よ⁠る​実⁠装 (x86) 信⁠頼⁠す⁠る​要⁠素 © Acompany Co., Ltd. コ⁠ン⁠パ⁠イ⁠ラ ツ⁠ー⁠ル 10
  11. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 一⁠般⁠的⁠な​形⁠式⁠検⁠証​(⁠通⁠常⁠の Dafny の​場⁠合⁠) ア⁠プ⁠リ⁠開⁠発⁠者⁠が

    Dafny 言⁠語⁠で​記⁠述 仕⁠様 実⁠装 高⁠水⁠準⁠の​仕⁠様 高⁠水⁠準⁠言⁠語⁠に​よ⁠る​実⁠装 Dafny の​検⁠証⁠器 コ⁠ン⁠パ⁠イ⁠ラ 判⁠定⁠結⁠果 機⁠械⁠語⁠に​よ⁠る​実⁠装 (x86) 信⁠頼⁠す⁠る​要⁠素 ツ⁠ー⁠ル 実⁠装⁠は​信⁠頼⁠対⁠象⁠か⁠ら​外⁠せ⁠る 信⁠頼⁠で⁠き⁠る​検⁠証⁠器⁠が​「⁠こ⁠の​実⁠装⁠は​仕⁠様⁠を​満⁠た⁠す⁠」⁠と​判⁠定⁠す⁠れ⁠ば⁠、 人⁠が​ソ⁠ー⁠ス⁠コ⁠ー⁠ド⁠を​読⁠ん⁠で​そ⁠の​性⁠質⁠を​確⁠か⁠め⁠る​必⁠要⁠は​な⁠い⁠。 © Acompany Co., Ltd. 10
  12. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 一⁠般⁠的⁠な​形⁠式⁠検⁠証​(⁠通⁠常⁠の Dafny の​場⁠合⁠) ア⁠プ⁠リ⁠開⁠発⁠者⁠が

    Dafny 言⁠語⁠で​記⁠述 仕⁠様 実⁠装 高⁠水⁠準⁠の​仕⁠様 高⁠水⁠準⁠言⁠語⁠に​よ⁠る​実⁠装 Dafny の​検⁠証⁠器 判⁠定⁠結⁠果 コ⁠ン⁠パ⁠イ⁠ラ 機⁠械⁠語⁠に​よ⁠る​実⁠装 (x86) 信⁠頼⁠す⁠る​要⁠素 ツ⁠ー⁠ル コ⁠ン⁠パ⁠イ⁠ラ⁠は​信⁠頼⁠対⁠象 ソ⁠ー⁠ス⁠の​検⁠証⁠に​通⁠っ⁠て⁠も⁠、​コ⁠ン⁠パ⁠イ⁠ラ⁠の​バ⁠グ⁠で​バ⁠イ⁠ナ⁠リ⁠の​挙⁠動⁠が​変⁠わ⁠り⁠う⁠る 最⁠適⁠化⁠や​コ⁠ー⁠ド⁠生⁠成⁠の​実⁠装⁠も​信⁠頼⁠す⁠る​た⁠め⁠、TCB は​大⁠き⁠く⁠な⁠り⁠や⁠す⁠い © Acompany Co., Ltd. 10
  13. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Ironclad に​お⁠け⁠る​バ⁠イ⁠ナ⁠リ⁠レ⁠ベ⁠ル⁠の​形⁠式⁠検⁠証 ア⁠プ⁠リ⁠開⁠発⁠者⁠が Dafny

    言⁠語⁠で​記⁠述 仕⁠様 実⁠装 高⁠水⁠準⁠の​仕⁠様 高⁠水⁠準⁠言⁠語⁠に​よ⁠る​実⁠装 仕⁠様⁠変⁠換⁠器​(DafnySpec) 検⁠証⁠可⁠能⁠な​ア⁠セ⁠ン⁠ブ⁠リ⁠言⁠語⁠に​よ⁠る​実⁠装 (BoogieX86) 低⁠水⁠準⁠の​仕⁠様 検⁠証⁠器 ア⁠セ⁠ン⁠ブ⁠ラ⁠・⁠リ⁠ン⁠カ 判⁠定⁠結⁠果 機⁠械⁠語⁠に​よ⁠る​実⁠装 (x86) 信⁠頼⁠す⁠る​要⁠素 © Acompany Co., Ltd. コ⁠ン⁠パ⁠イ⁠ラ​(DafnyCC) ツ⁠ー⁠ル 11
  14. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Ironclad に​お⁠け⁠る​バ⁠イ⁠ナ⁠リ⁠レ⁠ベ⁠ル⁠の​形⁠式⁠検⁠証 仕⁠様 実⁠装

    コ⁠ン⁠パ⁠イ⁠ラ⁠は​信⁠頼⁠し⁠な⁠く⁠て​よ⁠い ア⁠プ⁠リ⁠開⁠発⁠者⁠が 高⁠水⁠準⁠の​仕⁠様 Dafny x86 言⁠語⁠で​記⁠述 の​ア⁠セ⁠ン⁠ブ⁠リ⁠レ⁠ベ⁠ル⁠で​仕⁠様⁠と⁠の​一⁠致⁠を​検⁠証 コ⁠ン⁠パ⁠イ⁠ラ⁠実⁠装⁠に​バ⁠グ⁠が​あ⁠っ⁠た​場⁠合⁠は​検⁠証⁠が​通⁠ら⁠な⁠い 仕⁠様⁠変⁠換⁠器​(DafnySpec) (⁠検⁠証⁠を​通⁠す⁠た⁠め⁠の​注⁠釈⁠の​挿⁠入⁠な⁠ど​独⁠自⁠実⁠装⁠は​必⁠要⁠) コ⁠ン⁠パ⁠イ⁠ラ​(DafnyCC) 検⁠証⁠可⁠能⁠な​ア⁠セ⁠ン⁠ブ⁠リ⁠言⁠語⁠に​よ⁠る​実⁠装 (BoogieX86) 低⁠水⁠準⁠の​仕⁠様 検⁠証⁠器 ア⁠セ⁠ン⁠ブ⁠ラ⁠・⁠リ⁠ン⁠カ 判⁠定⁠結⁠果 機⁠械⁠語⁠に​よ⁠る​実⁠装 (x86) 信⁠頼⁠す⁠る​要⁠素 © Acompany Co., Ltd. 高⁠水⁠準⁠言⁠語⁠に​よ⁠る​実⁠装 ツ⁠ー⁠ル 11
  15. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Ironclad に​お⁠け⁠る​バ⁠イ⁠ナ⁠リ⁠レ⁠ベ⁠ル⁠の​形⁠式⁠検⁠証 ア⁠プ⁠リ⁠開⁠発⁠者⁠が Dafny

    言⁠語⁠で​記⁠述 仕⁠様 実⁠装 高⁠水⁠準⁠の​仕⁠様 高⁠水⁠準⁠言⁠語⁠に​よ⁠る​実⁠装 仕⁠様⁠変⁠換⁠器​(DafnySpec) 検⁠証⁠可⁠能⁠な x86 の​サ⁠ブ⁠セ⁠ッ⁠ト コ⁠ン⁠パ⁠イ⁠ラ​(DafnyCC) 先⁠行⁠研⁠究 Verve で​使⁠用⁠し⁠た BoogieX86 を​使⁠用 モ⁠デ⁠ル⁠定⁠義⁠が​実⁠機⁠の​動⁠作⁠を​正⁠し⁠く​表⁠す​こ⁠と⁠は​ 低⁠水⁠準⁠の​仕⁠様 検⁠証⁠器⁠と​し⁠て​信⁠頼⁠す⁠る​部​分 検⁠証⁠器 ア⁠セ⁠ン⁠ブ⁠ラ⁠・⁠リ⁠ン⁠カ 判⁠定⁠結⁠果 機⁠械⁠語⁠に​よ⁠る​実⁠装 (x86) 信⁠頼⁠す⁠る​要⁠素 © Acompany Co., Ltd. 検⁠証⁠可⁠能⁠な​ア⁠セ⁠ン⁠ブ⁠リ⁠言⁠語⁠に​よ⁠る​実⁠装 (BoogieX86) ツ⁠ー⁠ル 11
  16. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Ironclad に​お⁠け⁠る​バ⁠イ⁠ナ⁠リ⁠レ⁠ベ⁠ル⁠の​形⁠式⁠検⁠証 ア⁠プ⁠リ⁠開⁠発⁠者⁠が Dafny

    言⁠語⁠で​記⁠述 仕⁠様 実⁠装 高⁠水⁠準⁠の​仕⁠様 高⁠水⁠準⁠言⁠語⁠に​よ⁠る​実⁠装 仕⁠様⁠変⁠換⁠器​(DafnySpec) コ⁠ン⁠パ⁠イ⁠ラ​(DafnyCC) 検⁠証⁠可⁠能⁠な​ア⁠セ⁠ン⁠ブ⁠リ⁠言⁠語⁠に​よ⁠る​実⁠装 (BoogieX86) 低⁠水⁠準⁠の​仕⁠様 判⁠定⁠結⁠果⁠が true な⁠ら⁠、​高⁠水⁠準⁠の​仕⁠様⁠を​満⁠た⁠す⁠バ⁠イ⁠ナ⁠リ⁠で⁠あ⁠る⁠と​保⁠証⁠さ⁠れ⁠る 検⁠証⁠器 ア⁠セ⁠ン⁠ブ⁠ラ⁠・⁠リ⁠ン⁠カ 判⁠定⁠結⁠果 機⁠械⁠語⁠に​よ⁠る​実⁠装 (x86) 信⁠頼⁠す⁠る​要⁠素 © Acompany Co., Ltd. ツ⁠ー⁠ル 11
  17. Total 02 Ironclad Apps (OSDI ‘14) 紹⁠介 3546 6971 33203

    41566 10726 76606 TCB (Trusted Computing Base) の​行⁠数⁠比⁠較 Table 1: System Line Counts and Verification Times. Asm 通⁠常⁠の Dafny コ⁠ン⁠パ⁠イ⁠ラ⁠を​信⁠頼⁠す⁠る​場⁠合⁠に​比⁠べ⁠、TCB が​小⁠さ⁠い LOC includes both compiled Dafny and hand-written assembly. 通⁠常⁠の​コ⁠ン⁠パ⁠イ⁠ラ​(Dafny → C#) 32419 (⁠通⁠常⁠の Dafny で⁠は​信⁠頼⁠対⁠象⁠) Ironclad 独⁠自⁠の​コ⁠ン⁠パ⁠イ⁠ラ​(⁠信⁠頼⁠対⁠象⁠外⁠) Dafny DafnyCC DafnySpec BoogieX86 SymDiff 4292 4718 2182 8402 0 10000 in TCB Ironclad の​信⁠頼⁠対⁠象⁠。​計 15,302 行 20000 30000 40000 Figure 6: Tool Line Counts. 32,419 SLOC in the original Dafny-to-C# compiler, let alone the code for the C# compiler. Our DafnyCC tool is © Acompany Co., Ltd. ※ Boogie と Z3 も​信⁠頼⁠対⁠象⁠だ⁠が⁠、​図⁠の​行⁠数⁠に⁠は​含⁠ま⁠れ⁠な⁠い⁠。 12
  18. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 OS 含⁠む⁠ソ⁠フ⁠ト⁠ウ⁠ェ⁠ア⁠ス⁠タ⁠ッ⁠ク⁠を​丸⁠ご⁠と​形⁠式⁠検⁠証 App (PassHash,

    Notary, TrInc, or DiffPriv) Std. Lib App Common UDP/IP Datatypes RSA Ethernet SHA-1,256 BigNum Network Driver TPM Driver Core Math OS: late launch, IOMMU, segmentation, page tables, GC Figure 5: System Overview. annotations, spread throughout the code, as lemmas that build to the final high-level theorems. To convey the work necessary to complete the verifi- © Acompany Co., Ltd. 各⁠ア⁠プ⁠リ⁠に​期⁠待⁠す⁠る​振⁠る​舞⁠い⁠を ory that the IOMMU allows devices to see, can Dafny の​状⁠態⁠機⁠械で​形⁠式⁠的⁠に​定⁠義 store non-secret data O. In §3.6’s terminology, non-s means that OL = OR . More specifically, we require the left and right executions generate the same sequ 暗⁠号⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠や​ド⁠ラ⁠イ⁠バ⁠も⁠、 of device stores: the same values to the same addre 仕⁠様⁠を​形⁠式⁠化⁠し⁠て​実⁠装⁠を​検⁠証 modulo timing and liveness. To prove OL = OR , we annotate our implementat input and output paths with relational annotations. T input output paths includeOS)⁠を​用⁠い⁠、 the application event l Verveand (⁠著⁠者⁠ら⁠の​先⁠行⁠研⁠究⁠の OS 実⁠装⁠含⁠め⁠た​形⁠式⁠検⁠証 and the networking stack. For example, the Etherne and UDP layers maintain relational properties on pac Lemma 8 K EY IN TPM. Apps correctly extend a p key into the TPM’s PCR 19. The private key is gener using TPM randomness and never leaves the platform 13 Lemma 9 ATTESTATION . Apps generate a correct
  19. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 検⁠証⁠し⁠た 4 つ⁠の​サ⁠ー⁠ビ⁠ス Notary

    文⁠書⁠を​処⁠理⁠し⁠た​順⁠序⁠を​証⁠明 TrInc(Trusted Incrementer) 監⁠査⁠ロ⁠グ⁠に​使⁠え⁠る​利⁠用⁠者⁠別⁠カ⁠ウ⁠ン⁠タ 依⁠頼⁠ご⁠と⁠に​共⁠通⁠の​カ⁠ウ⁠ン⁠タ⁠を​進⁠め⁠、​そ⁠の⁠値⁠と​ 文⁠書⁠の​ハ⁠ッ⁠シ⁠ュ⁠に​署⁠名 利⁠用⁠者⁠ご⁠と⁠に​カ⁠ウ⁠ン⁠タ⁠を​管⁠理⁠し⁠、​現⁠在⁠値⁠以⁠上​ へ⁠の​更⁠新⁠だ⁠け⁠を​受⁠け⁠付⁠け⁠る 複⁠数⁠の​文⁠書⁠に​対⁠し⁠て​一⁠意⁠な​順⁠序⁠付⁠け⁠が​可⁠能 サ⁠ー⁠ビ⁠ス⁠は​更⁠新⁠前⁠後⁠の​値⁠と​メ⁠ッ⁠セ⁠ー⁠ジ⁠に​署⁠名 → 本⁠発⁠表⁠の​例⁠と​し⁠て​用⁠い⁠る PassHash パ⁠ス⁠ワ⁠ー⁠ド⁠照⁠合⁠用⁠の​ハ⁠ッ⁠シ⁠ュ⁠を​生⁠成 DiffPriv 差⁠分⁠プ⁠ラ⁠イ⁠バ⁠シ⁠ー⁠を​満⁠た⁠す⁠集⁠計 パ⁠ス⁠ワ⁠ー⁠ド⁠に​サ⁠ー⁠ビ⁠ス⁠内⁠の​秘⁠密⁠値⁠を​加⁠え⁠て​ ハ⁠ッ⁠シ⁠ュ⁠化 統⁠計⁠量⁠に​ノ⁠イ⁠ズ⁠を​加⁠え⁠、​個⁠々⁠の​記⁠録⁠の​内⁠容⁠を​ 推⁠測⁠し⁠に⁠く⁠く⁠す⁠る 流⁠出⁠し⁠た​ハ⁠ッ⁠シ⁠ュ⁠だ⁠け⁠で​パ⁠ス⁠ワ⁠ー⁠ド⁠候⁠補⁠の​ 照⁠合⁠は​困⁠難 1 行⁠の​書⁠き⁠換⁠え⁠で​集⁠計⁠値⁠が​変⁠わ⁠る​幅​(⁠感⁠度⁠、 sensitivity)⁠の​上⁠界⁠を​検⁠証 © Acompany Co., Ltd. 14
  20. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Notary の​具⁠体⁠例: 状⁠態⁠機⁠械⁠で​仕⁠様⁠を​表⁠す Advance

    (Notarize) 秘⁠密⁠鍵⁠で​入⁠力⁠メ⁠ッ⁠セ⁠ー⁠ジ⁠と​カ⁠ウ⁠ン⁠タ⁠に​署⁠名⁠し⁠て⁠返⁠す counter += N (≧ 1) Initialize 鍵⁠ペ⁠ア​( keys )⁠を​生⁠成 counter = 0 Uninitialized © Acompany Co., Ltd. Running 状⁠態 s = (keys, counter) ※ 以⁠降⁠の​説⁠明⁠も​含⁠め⁠、​論⁠文⁠の​例⁠を​少⁠し⁠改⁠変⁠・⁠簡⁠略⁠化⁠し⁠て⁠示⁠す⁠。 15
  21. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Notary の​具⁠体⁠例: 初⁠期⁠化​(Initialize)⁠の​仕⁠様 正⁠し⁠く​生⁠成⁠し⁠た​鍵⁠ペ⁠ア⁠を​持⁠ち⁠、​カ⁠ウ⁠ン⁠タ⁠を

    0 か⁠ら​始⁠め⁠る Dafny datatype NotaryState = State(keys: RSAKeyPair, counter: nat) predicate InitializeCorrect(s: NotaryState) { KeyGenerationCorrect(s.keys) && s.counter == 0 } KeyGenerationCorrect :⁠乱⁠数⁠に​基⁠づ⁠く​鍵⁠生⁠成⁠の​条⁠件⁠を​ま⁠と⁠め⁠た​述⁠語⁠。 © Acompany Co., Ltd. 16
  22. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Notary の​具⁠体⁠例: Notarize の​仕⁠様

    カ⁠ウ⁠ン⁠タ⁠を​単⁠調⁠増⁠加⁠さ⁠せ⁠、​秘⁠密⁠鍵⁠で​出⁠力⁠に​署⁠名⁠す⁠る Dafny datatype NotaryState = State(keys: RSAKeyPair, counter: nat) datatype NotaryOutput = Output(statement: seq<int>, signature: seq<int>) predicate NotarizeCorrect( s: NotaryState, s': NotaryState, in_msg: seq<int>, out_msg: NotaryOutput) { ByteSeq(in_msg) && s.keys == s'.keys && s.counter < s'.counter && out_msg.statement == Encode(s'.counter) + in_msg && out_msg.signature == Sign(s.keys, out_msg.statement) } © Acompany Co., Ltd. 17
  23. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Notary の​具⁠体⁠例: Notarize の​仕⁠様

    カ⁠ウ⁠ン⁠タ⁠を​単⁠調⁠増⁠加⁠さ⁠せ⁠、​秘⁠密⁠鍵⁠で​出⁠力⁠に​署⁠名⁠す⁠る Dafny datatype NotaryState = State(keys: RSAKeyPair, counter: nat) datatype NotaryOutput = Output(statement: seq<int>, signature: seq<int>) predicate NotarizeCorrect( s: NotaryState, s': NotaryState, 操⁠作⁠前⁠の​状⁠態 s と​操⁠作⁠後⁠の​状⁠態 s' の​間⁠の​関⁠係⁠を​考⁠え⁠る in_msg: seq<int>, out_msg: NotaryOutput) { ByteSeq(in_msg) && s.keys == s'.keys && s.counter < s'.counter && out_msg.statement == Encode(s'.counter) + in_msg && out_msg.signature == Sign(s.keys, out_msg.statement) } © Acompany Co., Ltd. 17
  24. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Notary の​具⁠体⁠例: Notarize の​仕⁠様

    カ⁠ウ⁠ン⁠タ⁠を​単⁠調⁠増⁠加⁠さ⁠せ⁠、​秘⁠密⁠鍵⁠で​出⁠力⁠に​署⁠名⁠す⁠る Dafny datatype NotaryState = State(keys: RSAKeyPair, counter: nat) datatype NotaryOutput = Output(statement: seq<int>, signature: seq<int>) predicate NotarizeCorrect( s: NotaryState, s': NotaryState, 操⁠作⁠前⁠の​状⁠態 s と​操⁠作⁠後⁠の​状⁠態 s' の​間⁠の​関⁠係⁠を​考⁠え⁠る in_msg: seq<int>, out_msg: NotaryOutput) { ByteSeq(in_msg) && s.keys == s'.keys 鍵⁠は​変⁠化⁠せ⁠ず⁠、​カ⁠ウ⁠ン⁠タ⁠の​値⁠は​前⁠よ⁠り​大⁠き⁠く⁠な⁠る && s.counter < s'.counter && out_msg.statement == Encode(s'.counter) + in_msg && out_msg.signature == Sign(s.keys, out_msg.statement) } © Acompany Co., Ltd. 17
  25. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Notary の​具⁠体⁠例: Notarize の​仕⁠様

    カ⁠ウ⁠ン⁠タ⁠を​単⁠調⁠増⁠加⁠さ⁠せ⁠、​秘⁠密⁠鍵⁠で​出⁠力⁠に​署⁠名⁠す⁠る Dafny datatype NotaryState = State(keys: RSAKeyPair, counter: nat) datatype NotaryOutput = Output(statement: seq<int>, signature: seq<int>) predicate NotarizeCorrect( s: NotaryState, s': NotaryState, in_msg: seq<int>, out_msg: NotaryOutput) 入⁠力 in_msg と​出⁠力 out_msg の​間⁠の​関⁠係⁠を​考⁠え⁠る { ByteSeq(in_msg) && s.keys == s'.keys && s.counter < s'.counter && out_msg.statement == Encode(s'.counter) + in_msg && out_msg.signature == Sign(s.keys, out_msg.statement) } © Acompany Co., Ltd. 17
  26. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Notary の​具⁠体⁠例: Notarize の​仕⁠様

    カ⁠ウ⁠ン⁠タ⁠を​単⁠調⁠増⁠加⁠さ⁠せ⁠、​秘⁠密⁠鍵⁠で​出⁠力⁠に​署⁠名⁠す⁠る Dafny datatype NotaryState = State(keys: RSAKeyPair, counter: nat) datatype NotaryOutput = Output(statement: seq<int>, signature: seq<int>) predicate NotarizeCorrect( s: NotaryState, s': NotaryState, in_msg: seq<int>, out_msg: NotaryOutput) 入⁠力 in_msg と​出⁠力 out_msg の​間⁠の​関⁠係⁠を​考⁠え⁠る { ByteSeq(in_msg) && s.keys == s'.keys && s.counter < s'.counter 出⁠力 statement( counter , && out_msg.statement == Encode(s'.counter) + in_msg && out_msg.signature == Sign(s.keys, out_msg.statement) in_msg )⁠は​秘⁠密⁠鍵⁠で​署⁠名⁠さ⁠れ⁠る } © Acompany Co., Ltd. 17
  27. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Notary の​具⁠体⁠例: 状⁠態⁠機⁠械⁠全⁠体⁠の​仕⁠様 個⁠々⁠の​遷⁠移​(Initialize,

    Notarize)⁠の​仕⁠様⁠を​つ⁠な⁠ぎ⁠、​状⁠態⁠機⁠械⁠全⁠体⁠の​仕⁠様⁠を​定⁠め⁠る 状⁠態⁠と​初⁠期⁠化 状⁠態⁠の​更⁠新 datatype NotaryStateMachine = Machine(initialized: bool, state: NotaryState) ghost method {:axiom} Advance( s': NotaryState, in_msg: seq<int>, out_msg: NotaryOutput) returns (released_signature: seq<int>) requires current.initialized; requires public(in_msg); requires public(s'.counter); requires NotarizeCorrect( current.state, s', in_msg, out_msg); modifies this`current; ensures current == old(current)[state := s']; ensures DeclassifiedSignature( released_signature, out_msg.signature); ghost var {:readonly} current: NotaryStateMachine; ghost method {:axiom} Initialize(s: NotaryState) requires !current.initialized; requires InitializeCorrect(s); modifies this`current; ensures current == Machine(true, s); 詳⁠細⁠な​説⁠明⁠は skip す⁠る⁠が⁠、​雰⁠囲⁠気⁠だ⁠け⁠紹⁠介 © Acompany Co., Ltd. 18
  28. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Notary の​具⁠体⁠例: 状⁠態⁠機⁠械⁠全⁠体⁠の​仕⁠様 個⁠々⁠の​遷⁠移​(Initialize,

    Notarize)⁠の​仕⁠様⁠を​つ⁠な⁠ぎ⁠、​状⁠態⁠機⁠械⁠全⁠体⁠の​仕⁠様⁠を​定⁠め⁠る 状⁠態⁠と​初⁠期⁠化 状⁠態⁠の​更⁠新 datatype NotaryStateMachine = Machine(initialized: bool, state: NotaryState) ghost method {:axiom} Advance( s': NotaryState, in_msg: seq<int>, out_msg: NotaryOutput) returns (released_signature: seq<int>) requires current.initialized; requires public(in_msg); requires public(s'.counter); requires NotarizeCorrect( current.state, s', in_msg, out_msg); modifies this`current; ensures current == old(current)[state := s']; Notarize の predicate ensures DeclassifiedSignature( released_signature, out_msg.signature); ghost var {:readonly} current: NotaryStateMachine; ghost method {:axiom} Initialize(s: NotaryState) requires !current.initialized; requires InitializeCorrect(s); modifies this`current; ensures current == Machine(true, s); 初⁠期⁠化⁠の predicate 先⁠ほ⁠ど​説⁠明⁠し⁠た⁠、​こ⁠の 2 つ⁠の​状⁠態⁠遷⁠移⁠を​つ⁠な​げ⁠た⁠い © Acompany Co., Ltd. 18
  29. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Notary の​具⁠体⁠例: 状⁠態⁠機⁠械⁠全⁠体⁠の​仕⁠様 個⁠々⁠の​遷⁠移​(Initialize,

    Notarize)⁠の​仕⁠様⁠を​つ⁠な⁠ぎ⁠、​状⁠態⁠機⁠械⁠全⁠体⁠の​仕⁠様⁠を​定⁠め⁠る 状⁠態⁠と​初⁠期⁠化 状⁠態⁠の​更⁠新 datatype NotaryStateMachine = Machine(initialized: bool, state: NotaryState) ghost method {:axiom} Advance( s': NotaryState, in_msg: seq<int>, out_msg: NotaryOutput) returns (released_signature: seq<int>) requires current.initialized; requires public(in_msg); requires public(s'.counter); requires NotarizeCorrect( current.state, s', in_msg, out_msg); modifies this`current; ensures current == old(current)[state := s']; ensures DeclassifiedSignature( released_signature, out_msg.signature); ghost var {:readonly} current: NotaryStateMachine; ghost method {:axiom} Initialize(s: NotaryState) requires !current.initialized; requires InitializeCorrect(s); modifies this`current; ensures current == Machine(true, s); グ⁠ロ⁠ー⁠バ⁠ル⁠な​状⁠態 current を​介⁠し⁠て⁠、​状⁠態⁠遷⁠移⁠が​つ⁠な⁠が⁠る (⁠操⁠作⁠後⁠の​状⁠態 s' が​次⁠の​初⁠期⁠状⁠態 current.state に​な⁠る⁠) © Acompany Co., Ltd. 18
  30. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 秘⁠密⁠が​漏⁠洩⁠し⁠な⁠い​こ⁠と⁠の​保⁠証 状⁠態⁠遷⁠移⁠の​仕⁠様⁠に​加⁠え⁠、​秘⁠密⁠が​漏⁠洩⁠し⁠な⁠い​こ⁠と⁠も​保⁠証⁠し⁠た⁠い 例⁠え⁠ば⁠、​実⁠装⁠で​秘⁠密⁠鍵⁠の 1

    ビ⁠ッ⁠ト secret_bit で​カ⁠ウ⁠ン⁠タ⁠の​増⁠加⁠量⁠を​決⁠め⁠る​こ⁠と⁠も​可⁠能: var next_counter := s.counter + 1 + secret_bit; 増⁠加⁠量⁠は 1 か 2 な⁠の⁠で⁠、単⁠調⁠増⁠加⁠と​い⁠う​仕⁠様⁠は​満⁠た⁠す し⁠か⁠し⁠、​増⁠加⁠量⁠を​見⁠る⁠と 秘⁠密⁠鍵⁠の 1 ビ⁠ッ⁠ト⁠が​漏⁠洩 秘⁠密⁠鍵⁠に​依⁠存⁠し⁠た​値⁠が​出⁠力⁠さ⁠れ⁠な⁠い​こ⁠と⁠を​保⁠証⁠す⁠る​必⁠要 → noninterference(⁠非​干⁠渉⁠性⁠) 一⁠方⁠、署⁠名⁠自⁠体⁠は​秘⁠密⁠鍵⁠に​依⁠存⁠す⁠るた⁠め⁠、​明⁠示⁠的⁠に​許⁠可⁠す⁠る​仕⁠組⁠み⁠が​必⁠要 © Acompany Co., Ltd. 19
  31. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 Noninterference(⁠非​干⁠渉⁠性⁠)⁠の​定⁠義 入⁠力⁠が​同⁠じ⁠な⁠ら⁠、​秘⁠密⁠の​値⁠に​依⁠存⁠せ⁠ず​必⁠ず​同⁠じ​出⁠力⁠に​な⁠る 定⁠義 1(⁠非​干⁠渉⁠性⁠)

    公⁠開⁠入⁠力 𝐼 と​秘⁠密 𝑆 に​対⁠す⁠る​観⁠測⁠出⁠力⁠を 𝑂 = 𝐹 (𝐼, 𝑆) と​す⁠る⁠。 任⁠意⁠の 2 つ⁠の​実⁠行 𝐿, 𝑅 の​出⁠力 𝑂𝐿 = 𝐹 (𝐼𝐿 , 𝑆𝐿 )、𝑂𝑅 = 𝐹 (𝐼𝑅 , 𝑆𝑅 ) が​次⁠を​満⁠た⁠す⁠。 ∀𝑆𝐿 , 𝑆𝑅 : 𝐼𝐿 = 𝐼𝑅 ⇒ 𝑂𝐿 = 𝑂𝑅 前⁠の​カ⁠ウ⁠ン⁠タ⁠の​例⁠は 𝐹 (10, 0) = 11、𝐹 (10, 1) = 12 と​な⁠り⁠、​こ⁠の​条⁠件⁠に​反⁠す⁠る⁠。 Ironclad で⁠は​こ⁠の⁠よ⁠う⁠に​表⁠現 method F(I: int, S: int) returns (O: int) requires public(I); // 入 力 の 一 致 を 仮 定 ensures public(O); // 出 力 の 一 致 を 証 明 public(x) は 𝑥𝐿 = 𝑥𝑅 を​表⁠す⁠注⁠釈1 © Acompany Co., Ltd. 1 Dafny の​レ⁠ベ⁠ル⁠で⁠は​検⁠証⁠さ⁠れ⁠ず⁠、​仕⁠様⁠変⁠換⁠後⁠に SymDiff ツ⁠ー⁠ル⁠を​使⁠っ⁠て​ア⁠セ⁠ン⁠ブ⁠リ⁠の​段⁠階⁠で​検⁠証 20
  32. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 秘⁠密⁠に​依⁠存⁠し⁠た​値⁠の​出⁠力⁠許⁠可​(Declassification) 例⁠え⁠ば⁠、​秘⁠密⁠鍵⁠に​依⁠存⁠し⁠た​署⁠名⁠の​出⁠力⁠を​明⁠示⁠的⁠に​許⁠可⁠す⁠る​こ⁠と⁠が​可⁠能 状⁠態⁠の​更⁠新​(⁠再⁠掲⁠) ghost

    method {:axiom} Advance( s': NotaryState, in_msg: seq<int>, out_msg: NotaryOutput) returns (released_signature: seq<int>) requires current.initialized; 入⁠力⁠メ⁠ッ⁠セ⁠ー⁠ジ⁠と​カ⁠ウ⁠ン⁠タ⁠は​公⁠開⁠値⁠。 requires public(in_msg); requires public(s'.counter); 秘⁠密⁠鍵⁠に⁠は public を​指⁠定⁠せ⁠ず⁠、​秘⁠密⁠と​し⁠て​扱⁠う⁠。 requires NotarizeCorrect( current.state, s', in_msg, out_msg); modifies this`current; ensures current == old(current)[state := s']; NotarizeCorrect が​定⁠め⁠た​応⁠答⁠の​署⁠名⁠だ⁠け⁠を ensures DeclassifiedSignature( released_signature, out_msg.signature); declassify の​対⁠象⁠に​指⁠定⁠し⁠て​開⁠示 © Acompany Co., Ltd. 21
  33. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 検⁠証⁠の​最⁠終⁠目⁠標: Remote equivalence ネ⁠ッ⁠ト⁠ワ⁠ー⁠ク⁠越⁠し⁠に​利⁠用⁠者⁠が​受⁠け⁠取⁠る​応⁠答⁠は⁠、​仕⁠様⁠ど⁠お⁠り⁠の​状⁠態⁠機⁠械⁠に​基⁠づ⁠く​出⁠力⁠と​し⁠て​説⁠明⁠で⁠き⁠る

    系 1(Remote equivalence) 同⁠じ​公⁠開⁠入⁠力⁠な⁠ら⁠、​実⁠装⁠が​利⁠用⁠者⁠に​返⁠す⁠値⁠を 仕⁠様⁠の​状⁠態⁠機⁠械⁠と​ネ⁠ッ⁠ト⁠ワ⁠ー⁠ク で​再⁠現⁠で⁠き⁠る⁠。 状⁠態⁠機⁠械⁠は​実⁠装⁠と​同⁠じ​秘⁠密⁠を​使⁠う⁠。​ネ⁠ッ⁠ト⁠ワ⁠ー⁠ク⁠は​そ⁠の​秘⁠密⁠を​知⁠ら⁠ず⁠、​応⁠答⁠を​改⁠変⁠で⁠き⁠る⁠。 各⁠ア⁠プ⁠リ⁠で​証⁠明⁠す⁠る 3 つ⁠の​性⁠質 入⁠力⁠の​非​干⁠渉⁠性(input noninterference)​ declassify に​渡⁠す⁠公⁠開⁠引⁠数⁠は​秘⁠密⁠に​依⁠存⁠し⁠な⁠い⁠。 機⁠能⁠的⁠正⁠し⁠さ(functional correctness)​ declassify す⁠る​値⁠は​状⁠態⁠機⁠械⁠の​出⁠力⁠と​一⁠致⁠す⁠る⁠。 出⁠力⁠の​非​干⁠渉⁠性(output noninterference)​ ⁠外⁠部​出⁠力⁠は​公⁠開⁠値⁠と declassify し⁠た​値⁠の⁠み⁠か⁠ら​決⁠ま⁠る⁠。 © Acompany Co., Ltd. 22
  34. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 (⁠補⁠足⁠)Remote equivalence の​保⁠証⁠範⁠囲 状⁠態⁠機⁠械⁠の​出⁠力⁠と​利⁠用⁠者⁠に​対⁠す⁠る​返⁠答⁠が​一⁠致⁠す⁠る​こ⁠と⁠ま⁠で⁠は​証⁠明⁠に​含⁠ま⁠れ⁠な⁠い

    実⁠装⁠内⁠部⁠の​状⁠態⁠遷⁠移⁠が​仕⁠様⁠に​従⁠う​こ⁠と⁠を​検⁠証⁠す⁠る⁠が⁠、​そ⁠の​外⁠側⁠で​利⁠用⁠者⁠に​対⁠し⁠て​デ⁠タ⁠ラ⁠メ⁠な​出⁠力⁠を​ 返⁠す⁠こ⁠と⁠は​可⁠能 実⁠際⁠に Notary の reply を​固⁠定⁠の​値 [42] に​変⁠更⁠し⁠て⁠も⁠、​検⁠証⁠を​通⁠過⁠し⁠た 一⁠方⁠で⁠、​情⁠報⁠フ⁠ロ⁠ー⁠の​制⁠約⁠は​保⁠証⁠す⁠る​(noninterference) (declassification を​迂⁠回⁠す⁠る⁠)​秘⁠密⁠に​依⁠存⁠し⁠た​出⁠力⁠は​検⁠証⁠で​正⁠し⁠く​弾⁠か⁠れ⁠る TrInc の​例⁠で⁠は​カ⁠ウ⁠ン⁠タ⁠の​値⁠を​署⁠名⁠し⁠て​返⁠し⁠て⁠い⁠る⁠の⁠で⁠、​安⁠全⁠性⁠は​保⁠た⁠れ⁠る 「⁠署⁠名⁠の​検⁠証⁠が​成⁠功⁠し⁠た⁠な⁠ら⁠ば⁠、​そ⁠の⁠値⁠は​状⁠態⁠機⁠械⁠の​仕⁠様⁠に​沿⁠っ⁠て​生⁠成⁠さ⁠れ⁠た​も⁠の⁠で⁠あ⁠る⁠」⁠と​言⁠え⁠る 署⁠名⁠せ⁠ず⁠、​単⁠に​イ⁠ン⁠ク⁠リ⁠メ⁠ン⁠ト⁠し⁠た​値⁠を​返⁠す⁠だ⁠け⁠の​仕⁠様⁠で⁠は​不⁠十⁠分​(⁠デ⁠タ⁠ラ⁠メ⁠な​値⁠を​返⁠す⁠こ⁠と⁠が​可⁠能⁠) declassification は⁠、​秘⁠密⁠に​依⁠存⁠し⁠た​出⁠力⁠を​許⁠可⁠す⁠る⁠と​い⁠う⁠以⁠上⁠に⁠、​状⁠態⁠機⁠械⁠の​出⁠力⁠と​利⁠用⁠者⁠へ⁠の​ 返⁠答⁠を​繋⁠ぐ​役⁠割⁠が​大⁠き⁠い © Acompany Co., Ltd. 23
  35. 02 Ironclad Apps (OSDI ‘14) 紹⁠介 性⁠能⁠評⁠価 未⁠検⁠証⁠の​場⁠合⁠に​比⁠べ⁠、​応⁠答⁠時⁠間⁠は​最⁠大 189 倍⁠。

    コ⁠ン⁠パ⁠イ⁠ラ DafnyCC は​独⁠自⁠実⁠装⁠で⁠あ⁠り⁠、​特⁠に RSA の​実⁠装⁠に⁠は​最⁠適⁠化⁠の​余⁠地​あ⁠り⁠。 最⁠大 189 倍 遅⁠い Operation Dominant step Ironclad Unverified Slowdown Notary notarize Compute RSA signature 934 ms ±0 ms 8.88 ms ±0.68 ms 105 TrInc create Compute reciprocal of RSA modulus 4.96 ms ±0.03 ms 866 µs ±507 µs 5.72 TrInc advance Compute RSA signature 1.01 s ±0.00 s 12.1 ms ±0.2 ms 83.6 PassHash hash Compute SHA-256 hash 276 µs ±10 µs 159 µs ±3 µs 1.73 DiffPriv initialize db None, just network overhead 168 µs ±2 µs 155 µs ±3 µs 1.08 DiffPriv add row Decrypt RSA-encrypted row 944 ms ±17 ms 8.85 ms ±0.06 ms 107 DiffPriv query Compute noise with BigInts 126 ms ±19 ms 668 µs ±36 µs 189 Table 3: App benchmarks. Latency of different request types, as seen by a client on the same network switch, for Ironclad Apps and unverified variants written in C#. Ranges shown are 95% confidence intervals for the mean. © Acompany Co., Ltd. Op Param Ironclad OpenSSL C#/.NET servers, we wrote unverified variants of our apps in C# 24
  36. 03 今⁠後⁠の​展⁠望 近⁠年⁠の​形⁠式⁠検⁠証⁠ツ⁠ー⁠ル⁠の​発⁠展 SMT に​よ⁠る​自⁠動⁠検⁠証 型⁠理⁠論⁠に​基⁠づ⁠く​定⁠理⁠証⁠明⁠支⁠援⁠系 SMT ソ⁠ル⁠バ⁠に​よ⁠っ⁠て​制⁠約⁠充⁠足⁠問⁠題⁠を​解⁠く Rocq(⁠旧 Coq)⁠、Isabelle/HOL、Lean

    な⁠ど Ironclad で⁠は Dafny / Boogie / Z3 を​使⁠用 高⁠階⁠述⁠語⁠論⁠理​(HOL)⁠や Curry–Howard 対⁠応⁠の​ 理⁠論⁠を​基⁠盤⁠に⁠、高⁠度⁠な​数⁠学⁠や​実​装⁠の​性⁠質⁠を​証⁠明 仕⁠様⁠や​補⁠題⁠か⁠ら​推⁠論⁠を​自⁠動⁠化⁠し⁠、証⁠明⁠記⁠述⁠を​ 比⁠較⁠的⁠少⁠な⁠く​で⁠き⁠る Ironclad 論⁠文⁠で⁠は 3 人⁠年​(seL4 は>20 人⁠年⁠) 一⁠方⁠で⁠、​右⁠に​比⁠べ⁠て​表⁠現⁠能⁠力⁠は​限⁠定⁠的 AI が Lean で​未⁠解⁠決⁠問⁠題⁠を AI が​解⁠く​事⁠例⁠が​話⁠題⁠に 近⁠年⁠で⁠は Rust 上⁠で​形⁠式⁠検⁠証⁠が​可⁠能⁠な Verus が​注⁠目 © Acompany Co., Ltd. 人⁠間⁠に​よ⁠る​証⁠明⁠記⁠述⁠の​負⁠担⁠が​大⁠き⁠い⁠点⁠が​ 課⁠題⁠だ⁠っ⁠た⁠が⁠、証⁠明⁠記⁠述⁠を AI が​担⁠え⁠る​今⁠、​世⁠間⁠の​ 注⁠目⁠を​集⁠め⁠て⁠い⁠る Lean で⁠は​証⁠明⁠済⁠み⁠の​定⁠理⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠で⁠あ⁠る Mathlib (⁠数⁠学⁠)⁠に​加⁠え⁠て CSLib(⁠計⁠算⁠機⁠科⁠学⁠)の​整⁠備⁠も​ 始⁠ま⁠っ⁠て⁠お⁠り⁠、​実⁠装⁠の​検⁠証⁠に​使⁠え⁠る​基⁠盤⁠も​拡⁠充 い⁠ず⁠れ⁠も​そ⁠れ⁠単⁠体⁠で⁠は​バ⁠イ⁠ナ⁠リ⁠レ⁠ベ⁠ル⁠の​実⁠装⁠ま⁠で​検⁠証⁠し⁠た⁠こ⁠と⁠に⁠は​な⁠ら⁠な⁠い​ (⁠コ⁠ン⁠パ⁠イ⁠ラ⁠ツ⁠ー⁠ル⁠チ⁠ェ⁠ー⁠ン⁠を​信⁠頼⁠す⁠る⁠)​た⁠め⁠、​コ⁠ン⁠パ⁠イ⁠ラ⁠自⁠体⁠を​形⁠式⁠検⁠証​(CompCert な⁠ど⁠)​し⁠た⁠り⁠、​ 信⁠頼⁠境⁠界⁠を​明⁠確⁠に​す⁠る​必⁠要 26
  37. 03 今⁠後⁠の​展⁠望 Confidential VM + 形⁠式⁠検⁠証⁠:2 つ⁠の​方​向⁠性 特⁠権⁠モ⁠ニ⁠タ⁠を​検⁠証​(VeriSMo1な⁠ど⁠) 全⁠体⁠を​検⁠証​(Ironclad 型⁠)

    TEE(Confidential VM) TEE(Confidential VM) 既⁠存⁠の​ア⁠プ⁠リ⁠ケ⁠ー⁠シ⁠ョ⁠ン 全⁠体⁠を​形⁠式⁠検⁠証 Linux カ⁠ー⁠ネ⁠ル​(⁠低⁠い​権⁠限⁠) ア⁠プ⁠リ⁠ケ⁠ー⁠シ⁠ョ⁠ン 権⁠限⁠分⁠離 ラ⁠イ⁠ブ⁠ラ⁠リ⁠・⁠ド⁠ラ⁠イ⁠バ 特⁠権⁠モ⁠ニ⁠タ​(⁠高⁠い​権⁠限⁠) こ⁠こ⁠だ⁠け⁠形⁠式⁠検⁠証 必⁠要⁠な OS 機⁠能 VeriSMo で⁠は Rust の Verus で​形⁠式⁠検⁠証 unikernel 的⁠に⁠、OS・⁠ア⁠プ⁠リ⁠を​一⁠体⁠で​検⁠証 CVM が​提⁠供⁠す⁠る​権⁠限⁠分⁠離​(AMD SEV-SNP の VPML な⁠ど⁠)⁠を​活⁠用 ア⁠プ⁠リ⁠固​有⁠の​性⁠質⁠を​証⁠明⁠可⁠能 Linux カ⁠ー⁠ネ⁠ル⁠の​上⁠で​既⁠存⁠プ⁠ロ⁠グ⁠ラ⁠ム⁠を​動⁠か⁠せ⁠る 形⁠式⁠検⁠証⁠可⁠能⁠な​形⁠で⁠の​ソ⁠フ⁠ト⁠ウ⁠ェ⁠ア⁠再⁠実⁠装⁠が​前⁠提 形⁠式⁠検⁠証⁠の​コ⁠ス⁠ト⁠大 カ⁠ー⁠ネ⁠ル⁠が​侵⁠害⁠さ⁠れ⁠て⁠も⁠、​形⁠式⁠検⁠証⁠さ⁠れ⁠た​ 特⁠権⁠モ⁠ニ⁠タ⁠が​一⁠定⁠の​安⁠全⁠性⁠を​保⁠証 証⁠明⁠で⁠き⁠る​性⁠質⁠は​限⁠定⁠的​(⁠ア⁠プ⁠リ⁠非⁠依⁠存⁠) © Acompany Co., Ltd. 1 VeriSMo: A Verified Security Module for Confidential VMs (OSDI ’24) 27
  38. 03 今⁠後⁠の​展⁠望 ま⁠と⁠め 「Confidential Computing × 形⁠式⁠検⁠証⁠」⁠の​可⁠能⁠性 Confidential VM で⁠は

    TCB が​肥⁠大⁠し⁠が​ち⁠だ⁠が⁠、​形⁠式⁠検⁠証⁠を​効⁠果⁠的⁠に​用⁠い⁠れ⁠ば TCB を​大⁠き⁠く​削⁠減⁠可⁠能⁠。 シ⁠ス⁠テ⁠ム⁠の​外⁠側⁠を Confidential Computing で​守⁠り⁠、​内⁠側⁠を​形⁠式⁠検⁠証⁠で​守⁠る⁠。 実⁠装⁠・⁠証⁠明⁠は AI 任⁠せ⁠で​良⁠い⁠が⁠、​仕⁠様⁠の​正⁠し⁠さ⁠は​人⁠間⁠の​責⁠任 実⁠装⁠が​仕⁠様⁠を​満⁠た⁠す⁠こ⁠と⁠は​機⁠械⁠的⁠に​検⁠証⁠可⁠能⁠だ⁠が⁠、仕⁠様⁠自⁠体⁠が​誤⁠っ⁠て⁠い⁠れ⁠ば​バ⁠グ⁠は​残⁠る⁠。 具⁠体⁠的⁠に​ど⁠の⁠よ⁠う⁠な​性⁠質⁠を​検⁠証⁠で⁠き⁠て⁠い⁠る⁠か​人⁠間⁠が​チ⁠ェ⁠ッ⁠ク⁠す⁠る​必⁠要⁠が​あ⁠る⁠。 ど⁠の​レ⁠ベ⁠ル⁠ま⁠で​形⁠式⁠検⁠証⁠す⁠る⁠か⁠が​重⁠要⁠な Design Choice 一⁠言⁠に​「⁠形⁠式⁠検⁠証⁠し⁠た⁠」⁠と​言⁠っ⁠て⁠も⁠、OS・⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠・⁠コ⁠ン⁠パ⁠イ⁠ラ⁠へ⁠の​信⁠頼⁠に​応⁠じ⁠て​保⁠証⁠範⁠囲⁠は​異⁠な⁠る⁠。 Ironclad は OS・⁠ラ⁠イ⁠ブ⁠ラ⁠リ⁠・⁠ア⁠プ⁠リ⁠全⁠体⁠を​バ⁠イ⁠ナ⁠リ⁠レ⁠ベ⁠ル⁠ま⁠で​形⁠式⁠検⁠証⁠し⁠た​事⁠例⁠。 AI が​証⁠明⁠を​支⁠援⁠で⁠き⁠る​今⁠、​こ⁠の⁠よ⁠う⁠な​全⁠体​検⁠証⁠に⁠も​改⁠め⁠て​取⁠り⁠組⁠む⁠価⁠値⁠が​あ⁠る⁠の⁠で⁠は⁠? © Acompany Co., Ltd. 28

More Decks by Acompany

Other Decks in Research