Verified Boot

Verified Boot

Introduction


Android 4.4 and later supports verified boot through the optional device-mapper-verity (dm-verity) kernel feature, which provides transparent integrity checking of block devices. dm-verity helps prevent persistent rootkits that can hold onto root privileges and compromise devices. This experimental feature helps Android users be sure when booting a device it is in the same state as when it was last used.

Clever malware with root privileges can hide from detection programs and otherwise mask themselves. The rooting software can do this because it is often more privileged than the detectors, enabling the software to "lie" to the detection programs.

The dm-verity feature lets you look at a block device, the underlying storage layer of the file system, and determine if it matches its expected configuration. It does this using a cryptographic hash tree. For every block (typically 4k), there is a SHA256 hash.

Since the hash values are stored in a tree of pages, only the top-level "root" hash must be trusted to verify the rest of the tree. The ability to modify any of the blocks would be equivalent to breaking the cryptographic hash. See the following diagram for a depiction of this structure.

Figure 1. dm-verity hash table

A public key is included on the boot partition, which must be verified externally by the OEM. That key is used to verify the signature for that hash and confirm the device's system partition is protected and unchanged.

Prerequisites


Establishing a verified boot flow

To greatly reduce the risk of compromise, verify the kernel using a key burned into the device. For details, see Verified boot.

Switching to block-oriented OTAs

To enable dm-verity for a device, you must use block-based over-the-air (OTA) updates to ensure all devices use the same system partition. For details, see Block-Based OTAs.

Configuring dm-verity

After switching to block-oriented OTAs, incorporate the latest Android kernel or use a stock upstream kernel and enable dm-verity support by including the relevant configuration option CONFIG_DM_VERITY.

When using the Android kernel, dm-verity is turned on when the kernel is built. For details, see Implementing dm-verity.

Supporting documentation


Verifying Boot
Block-Based OTA
Implementing dm-verity
cryptsetup - dm-verity: device-mapper block integrity checking target
The Chromium Projects - Verified Boot
Linux Kernel Documentation: verity.txt

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值