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

Clone this repo:
  1. 68f2afb DO NOT MERGE by Xin Li · 6 weeks ago master oreo-mr1-iot-release android-o-mr1-iot-release-1.0.7 android-o-mr1-iot-release-1.0.8
  2. 50b3b5a Snap for 4605948 from 6c246ace0160aedf62a7e699e1ccef51e1d12a01 to pi-release by android-build-team Robot · 11 months ago pie-cts-release pie-cuttlefish-testing pie-gsi pie-platform-release pie-r2-release pie-r2-s1-release pie-r2-s2-release pie-release pie-release-2 pie-s2-release pie-vts-release android-9.0.0_r1 android-9.0.0_r10 android-9.0.0_r17 android-9.0.0_r18 android-9.0.0_r2 android-9.0.0_r3 android-9.0.0_r5 android-9.0.0_r6 android-9.0.0_r7 android-9.0.0_r8 android-9.0.0_r9 android-cts-9.0_r1 android-cts-9.0_r2 android-cts-9.0_r3 android-cts-9.0_r4 android-cts-9.0_r5 android-vts-9.0_r4 android-vts-9.0_r5 android-wear-9.0.0_r1 android-wear-9.0.0_r2 android-wear-9.0.0_r3
  3. 6c246ac Req fake-nvram-seccomp.policy only on def'd archs. am: b393064c69 am: b8cee6ee08 by Steven Moreland · 11 months ago master-cuttlefish-testing-release nougat-iot-release oreo-mr1-1.2-iot-release pie-dev pie-dr1-dev pie-dr1-release pie-qpr1-release pie-qpr1-s1-release pie-qpr1-s2-release pie-qpr1-s3-release android-9.0.0_r11 android-9.0.0_r12 android-9.0.0_r16 android-9.0.0_r19 android-9.0.0_r20 android-9.0.0_r21 android-9.0.0_r22 android-9.0.0_r30 android-n-iot-release-ihome-igv1 android-o-mr1-iot-release-1.0.3 android-o-mr1-iot-release-1.0.4 android-o-mr1-iot-release-1.0.5 android-o-mr1-iot-release-smart-display-r3 android-o-mr1-iot-release-smart-display-r4 android-o-mr1-iot-release-smart-display-r5 android-wear-8.0.0_r2
  4. 6bc2ad8 Req fake-nvram-seccomp.policy only on def'd archs. am: b393064c69 am: b8cee6ee08 by Steven Moreland · 11 months ago
  5. b8cee6e Req fake-nvram-seccomp.policy only on def'd archs. am: b393064c69 by Steven Moreland · 11 months ago

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.