Owner: mnissler Bug: http://b/25969241, http://b/27101983

Clone this repo:
  1. 184c1c9 Convert system/nvram/Android.mk to Android.bp. am: 843f23682b am: f651fd4535 by Patrice Arruda · 10 months ago android10-mainline-networking-release android10-mainline-resolv-release master android-mainline-10.0.0_r6 android-mainline-10.0.0_r8 android-r-preview-1
  2. 45d3742 Convert system/nvram/Android.mk to Android.bp. am: 843f23682b am: f651fd4535 by Patrice Arruda · 10 months ago ndk-sysroot-r21
  3. f651fd4 Convert system/nvram/Android.mk to Android.bp. am: 843f23682b by Patrice Arruda · 10 months ago android-o-mr1-iot-release-1.0.13 android-o-mr1-iot-release-1.0.14
  4. 843f236 Convert system/nvram/Android.mk to Android.bp. by Patrice Arruda · 10 months ago
  5. 0f6a0aa [automerger skipped] DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master by Xin Li · 1 year ago android10-c2f2-release android10-c2f2-s1-release android10-c2f2-s2-release android10-dev android10-mainline-media-release android10-qpr1-b-release android10-qpr1-b-s1-release android10-qpr1-c-release android10-qpr1-c-s1-release android10-qpr1-d-release android10-qpr1-mainline-release android10-qpr1-release android-10.0.0_r12 android-10.0.0_r13 android-10.0.0_r14 android-10.0.0_r15 android-10.0.0_r16 android-10.0.0_r18 android-10.0.0_r19 android-10.0.0_r20 android-10.0.0_r21 android-10.0.0_r22 android-10.0.0_r23 android-10.0.0_r24 android-10.0.0_r25 android-10.0.0_r26 android-10.0.0_r27 android-10.0.0_r28 android-10.0.0_r29 android-10.0.0_r7 android-10.0.0_r8 android-10.0.0_r9 android-mainline-10.0.0_r4 android-mainline-10.0.0_r5 android-mainline-10.0.0_r7 android-mainline-10.0.0_r9

Access-controlled NVRAM implementation

This repository contains various pieces related to the Access-controlled NVRAM HAL. In a nutshell, the Access-controlled NVRAM HAL allows creation of NVRAM spaces that can hold arbitrary data blobs of limited size. Access restrictions can be configured on each NVRAM space to prevent the contents from being accessed or modified, up to the point of requiring full hardware reset to clear a locked NVRAM space. This can be used for various security features that require a trusted storage location for critical data that an attacker can't tamper with. For details of the NVRAM HAL API, see hardware/libhardware/include/hardware/nvram.h.

client

Contains a simple command-line application to interact with the NVRAM HAL implementation. This is useful for experimentation and use in scripts. nvram-client receives commands and parameters on the command line and translates them to NVRAM HAL calls. Results are printed on stdout.

core

A reference implementation of the NVRAM functionality. This reference implementation can be used to create NVRAM HAL implementations that run in a trusted execution environment. It is also the basis for the testing NVRAM HAL module, which implements the entire NVRAM HAL API surface in userspace for the sake of illustration (but obviously doesn't meet the persistence and tamper-evidence requirements).

Note that the reference implementation leaves persistent storage to be handled by the embedding code, which needs to provide an implementation of the storage interface defined in system/nvram/core/include/nvram/core/storage.h.

hal

The hal directory contains glue code that simplifies creation of NVRAM HAL modules. The code implements the API surface specified by the nvram.h HAL header and translates calls into the request/response message format defined in the messages directory. Thus, to create a working NVRAM HAL module, it is sufficient to provide an implementation that understands nvram::Request and nvram::Response objects, the glue code will adapt it to the full NVRAM API surface.

messages

Defines an IPC message format that can be used to serialize NVRAM HAL calls and their parameters in preparation for sending them elsewhere (e.g., a TEE) for execution. There is a request and a response struct corresponding to each NVRAM HAL function. The nvram::Request and nvram::Response wrappers keep track of the actual request or response type, respectively, as well as the request or response parameters specific to the type.