coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
antirollback.h File Reference
#include <types.h>
#include <security/tpm/tspi.h>
#include <vb2_sha.h>
Include dependency graph for antirollback.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FIRMWARE_NV_INDEX   0x1007
 
#define KERNEL_NV_INDEX   0x1008
 
#define BACKUP_NV_INDEX   0x1009
 
#define FWMP_NV_INDEX   0x100a
 
#define MRC_REC_HASH_NV_INDEX   0x100b
 
#define MRC_RW_HASH_NV_INDEX   0x100d
 
#define HASH_NV_SIZE   VB2_SHA256_DIGEST_SIZE
 
#define WIDEVINE_COUNTER_NV_INDEX(n)   (0x3000 + (n))
 
#define NUM_WIDEVINE_COUNTERS   4
 
#define WIDEVINE_COUNTER_NAME   "Widevine Secure Counter"
 
#define WIDEVINE_COUNTER_SIZE   sizeof(uint64_t)
 
#define ZTE_BOARD_ID_NV_INDEX   0x3fff00
 
#define ZTE_RMA_SN_BITS_INDEX   0x3fff01
 
#define ZTE_RMA_BYTES_COUNTER_INDEX   0x3fff04
 
#define FLAG_LAST_BOOT_DEVELOPER   0x01
 

Functions

uint32_t antirollback_read_space_firmware (struct vb2_context *ctx)
 
uint32_t antirollback_write_space_firmware (struct vb2_context *ctx)
 Write may be called if the versions change. More...
 
uint32_t antirollback_read_space_kernel (struct vb2_context *ctx)
 Read and write kernel space in TPM. More...
 
uint32_t antirollback_write_space_kernel (struct vb2_context *ctx)
 
uint32_t antirollback_lock_space_firmware (void)
 Lock must be called. More...
 
uint32_t antirollback_read_space_mrc_hash (uint32_t index, uint8_t *data, uint32_t size)
 
uint32_t antirollback_write_space_mrc_hash (uint32_t index, const uint8_t *data, uint32_t size)
 
uint32_t antirollback_lock_space_mrc_hash (uint32_t index)
 

Macro Definition Documentation

◆ BACKUP_NV_INDEX

#define BACKUP_NV_INDEX   0x1009

Definition at line 23 of file antirollback.h.

◆ FIRMWARE_NV_INDEX

#define FIRMWARE_NV_INDEX   0x1007

Definition at line 19 of file antirollback.h.

◆ FLAG_LAST_BOOT_DEVELOPER

#define FLAG_LAST_BOOT_DEVELOPER   0x01

Definition at line 49 of file antirollback.h.

◆ FWMP_NV_INDEX

#define FWMP_NV_INDEX   0x100a

Definition at line 24 of file antirollback.h.

◆ HASH_NV_SIZE

#define HASH_NV_SIZE   VB2_SHA256_DIGEST_SIZE

Definition at line 30 of file antirollback.h.

◆ KERNEL_NV_INDEX

#define KERNEL_NV_INDEX   0x1008

Definition at line 20 of file antirollback.h.

◆ MRC_REC_HASH_NV_INDEX

#define MRC_REC_HASH_NV_INDEX   0x100b

Definition at line 26 of file antirollback.h.

◆ MRC_RW_HASH_NV_INDEX

#define MRC_RW_HASH_NV_INDEX   0x100d

Definition at line 29 of file antirollback.h.

◆ NUM_WIDEVINE_COUNTERS

#define NUM_WIDEVINE_COUNTERS   4

Definition at line 33 of file antirollback.h.

◆ WIDEVINE_COUNTER_NAME

#define WIDEVINE_COUNTER_NAME   "Widevine Secure Counter"

Definition at line 34 of file antirollback.h.

◆ WIDEVINE_COUNTER_NV_INDEX

#define WIDEVINE_COUNTER_NV_INDEX (   n)    (0x3000 + (n))

Definition at line 32 of file antirollback.h.

◆ WIDEVINE_COUNTER_SIZE

#define WIDEVINE_COUNTER_SIZE   sizeof(uint64_t)

Definition at line 35 of file antirollback.h.

◆ ZTE_BOARD_ID_NV_INDEX

#define ZTE_BOARD_ID_NV_INDEX   0x3fff00

Definition at line 37 of file antirollback.h.

◆ ZTE_RMA_BYTES_COUNTER_INDEX

#define ZTE_RMA_BYTES_COUNTER_INDEX   0x3fff04

Definition at line 39 of file antirollback.h.

◆ ZTE_RMA_SN_BITS_INDEX

#define ZTE_RMA_SN_BITS_INDEX   0x3fff01

Definition at line 38 of file antirollback.h.

Function Documentation

◆ antirollback_lock_space_firmware()

uint32_t antirollback_lock_space_firmware ( void  )

Lock must be called.

Definition at line 52 of file secdata_mock.c.

References tlcl_set_global_lock().

Referenced by verstage_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ antirollback_lock_space_mrc_hash()

uint32_t antirollback_lock_space_mrc_hash ( uint32_t  index)

Definition at line 57 of file secdata_mock.c.

Referenced by verstage_main().

Here is the caller graph for this function:

◆ antirollback_read_space_firmware()

uint32_t antirollback_read_space_firmware ( struct vb2_context *  ctx)

Definition at line 18 of file secdata_mock.c.

References factory_initialize_tpm(), read_space_firmware(), RETURN_ON_FAILURE, TPM_E_BADINDEX, TPM_E_CORRUPTED_STATE, TPM_SUCCESS, and VBDEBUG.

Referenced by verstage_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ antirollback_read_space_kernel()

uint32_t antirollback_read_space_kernel ( struct vb2_context *  ctx)

Read and write kernel space in TPM.

Definition at line 29 of file secdata_mock.c.

References BIOS_ERR, CONFIG, KERNEL_NV_INDEX, printk, RETURN_ON_FAILURE, tlcl_get_permissions(), tlcl_read(), TPM2, TPM_E_CORRUPTED_STATE, TPM_E_RANGE, TPM_NV_PER_PPWRITE, TPM_SUCCESS, and VBDEBUG.

Referenced by verstage_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ antirollback_read_space_mrc_hash()

uint32_t antirollback_read_space_mrc_hash ( uint32_t  index,
uint8_t data,
uint32_t  size 
)

Definition at line 62 of file secdata_mock.c.

Referenced by mrc_cache_verify_hash().

Here is the caller graph for this function:

◆ antirollback_write_space_firmware()

uint32_t antirollback_write_space_firmware ( struct vb2_context *  ctx)

Write may be called if the versions change.

Definition at line 24 of file secdata_mock.c.

References CONFIG, FIRMWARE_NV_INDEX, safe_write(), and tlcl_cr50_enable_nvcommits().

Referenced by vboot_save_data().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ antirollback_write_space_kernel()

uint32_t antirollback_write_space_kernel ( struct vb2_context *  ctx)

Definition at line 47 of file secdata_mock.c.

References CONFIG, KERNEL_NV_INDEX, safe_write(), and tlcl_cr50_enable_nvcommits().

Referenced by vboot_save_data().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ antirollback_write_space_mrc_hash()

uint32_t antirollback_write_space_mrc_hash ( uint32_t  index,
const uint8_t data,
uint32_t  size 
)

Definition at line 67 of file secdata_mock.c.

Referenced by mrc_cache_update_hash().

Here is the caller graph for this function: