Android HLOS は、前のステージから CDI 値と DICE チェーンを受け取ると、それらを読み取り、SDV サービス ディスカバリに必要なシークレット(公開鍵と秘密鍵のペアや、さらなる CDI ステージなど)を導出して消去します。
このプロセスは、第 2 段階の init の early-init 中のブートフローでできるだけ早く行われます。これにより、サードパーティのコードが実行される前に、Android HLOS が CDI 値を消費して消去します。
Android ブートローダー(または Android ブートローダーが存在しない場合はハイパーバイザーのゲスト ローダー)は、SDV の Linux カーネルを介して次の値を Android ユーザー空間の second stage init に渡します。
- Android HLOS レイヤの構成証明 CDI 値。
- Android HLOS レイヤの CDI 値のシーリング。
- Android HLOS レイヤまでの CBOR エンコード DICE チェーン。
これらの値は SdvDiceHandover 形式を使用します。SdvDiceHandover は、次の CDDL フラグメントで記述される CBOR エンコード マップです。
SdvDiceHandover = {
1 : bstr .size 32, ; CDI_Attest
2 : bstr .size 32, ; CDI_Seal
3 : DiceCertChain, ; Android SDV DICE chain
}
IRemotelyProvisionedComponent HAL DiceCertChain は、DiceCertChain の形式を指定します。SdvDiceHandover には決定論的にエンコードされた CBOR は必要ありませんが、より広範な DICE ポリシーをサポートするため、強く推奨されます。
SdvDiceHandover 形式は次の形式とよく似ています。
DICE の参照実装の Open Profile が定義する
AndroidDiceHandover形式、pvmfwが DICE チェーンを pVM に引き渡すために使用するPvmfwDiceHandover形式。たとえば、Microdroid などがあります。
AndroidDiceHandover とは対照的に、PvmfwDiceHandover 形式と同様に、DiceCertChain は必須であり、省略できません。
DICE カーネル ドライバの Open Profile
Android ブートローダー(ブートローダーがない場合はハイパーバイザのゲストローダー)から Android HLOS への Android HLOS CDI の DICE ハンドオーバーは、DICE カーネル ドライバのオープン プロファイルに依存します。Android ブートローダーは、デバイスツリー(DT)が指定する必要があるゲストのメモリ内のリージョンに DICE チェーン エントリを書き込みます。
ドライバは、DT が指定するこのメモリ領域を読み取り、/dev/open-dice0 デバイスとしてユーザー空間に公開します。ドライバは、このメモリ領域の読み取りとワイプを許可します。デバイスツリーは arm64 専用のコンセプトであるため、Open Profile for DICE ドライバは arm64 アーキテクチャにのみ存在します。
compatible プロパティで "google,open-dice" を指定してドライバ用にタグ付けした DT の reserved-memory ノードを使用して、Open Profile for DICE ドライバが公開するメモリ領域を指定します。次に例を示します。
reserved-memory {
// The number of u32 cells to represent the address of a memory region
#address-cells = <2>;
// The number of u32 cells to represent the size of a memory region
#size-cells = <2>;
ranges;
// The unit address (after the @) must match the address in the reg property
dice@D1C30000 {
compatible = "google,open-dice";
no-map;
// The address and the size of the memory region that is passed to the Open
// Profile for DICE driver. The address must be page-aligned, and the size a
// multiple of the page size. The first two hex numbers (cells) represent
// the address of the memory region, the last two represent its size.
reg = <0x0 0xD1C30000 0x0 0x1000>;
};
};