1 Android Verified Boot 2.0
3 This file contains information about the current support of Android Verified
7 ---------------------------------
8 Verified Boot establishes a chain of trust from the bootloader to system images
9 * Provides integrity checking for:
10 - Android Boot image: Linux kernel + ramdisk. RAW hashing of the whole
11 partition is done and the hash is compared with the one stored in
13 - system/vendor partitions: verifying root hash of dm-verity hashtrees.
14 * Provides capabilities for rollback protection.
16 Integrity of the bootloader (U-boot BLOB and environment) is out of scope.
18 For additional details check:
19 https://android.googlesource.com/platform/external/avb/+/master/README.md
21 1.1. AVB using OP-TEE (optional)
22 ---------------------------------
23 If AVB is configured to use OP-TEE (see 4. below) rollback indexes and
24 device lock state are stored in RPMB. The RPMB partition is managed by
25 OP-TEE (https://www.op-tee.org/) which is a secure OS leveraging ARM
29 2. AVB 2.0 U-BOOT SHELL COMMANDS
30 -----------------------------------
31 Provides CLI interface to invoke AVB 2.0 verification + misc. commands for
32 different testing purposes:
34 avb init <dev> - initialize avb 2.0 for <dev>
35 avb verify - run verification process using hash data from vbmeta structure
36 avb read_rb <num> - read rollback index at location <num>
37 avb write_rb <num> <rb> - write rollback index <rb> to <num>
38 avb is_unlocked - returns unlock status of the device
39 avb get_uuid <partname> - read and print uuid of partition <partname>
40 avb read_part <partname> <offset> <num> <addr> - read <num> bytes from
41 partition <partname> to buffer <addr>
42 avb write_part <partname> <offset> <num> <addr> - write <num> bytes to
43 <partname> by <offset> using data from <addr>
46 3. PARTITIONS TAMPERING (EXAMPLE)
47 -----------------------------------
48 Boot or system/vendor (dm-verity metadata section) is tampered:
51 avb_slot_verify.c:175: ERROR: boot: Hash of data does not match digest in
53 Slot verification result: ERROR_IO
55 Vbmeta partition is tampered:
58 avb_vbmeta_image.c:206: ERROR: Hash does not match!
59 avb_slot_verify.c:388: ERROR: vbmeta: Error verifying vbmeta image:
61 Slot verification result: ERROR_IO
64 4. ENABLE ON YOUR BOARD
65 -----------------------------------
66 The following options must be enabled:
71 In addtion optionally if storing rollback indexes in RPMB with help of
76 CONFIG_SUPPORT_EMMC_RPMB=y
78 Then add `avb verify` invocation to your android boot sequence of commands,
81 => avb_verify=avb init $mmcdev; avb verify;
82 => if run avb_verify; then \
83 echo AVB verification OK. Continue boot; \
84 set bootargs $bootargs $avb_bootargs; \
86 echo AVB verification failed; \
90 => emmc_android_boot= \
91 echo Trying to boot Android from eMMC ...; \
94 mmc read ${fdtaddr} ${fdt_start} ${fdt_size}; \
95 mmc read ${loadaddr} ${boot_start} ${boot_size}; \
96 bootm $loadaddr $loadaddr $fdtaddr; \
99 To switch on automatic generation of vbmeta partition in AOSP build, add these
100 lines to device configuration mk file:
102 BOARD_AVB_ENABLE := true
103 BOARD_AVB_ALGORITHM := SHA512_RSA4096
104 BOARD_BOOTIMAGE_PARTITION_SIZE := <boot partition size>
106 After flashing U-boot don't forget to update environment and write new
109 => setenv partitions $partitions_android
111 => gpt write mmc 1 $partitions_android