coreboot-kgpe-d16/src/lib
Vadim Bendebury 289ee8f0e9 lib/tpm2: do not create all NVRAM spaces with the same set of attributes
The TPM spaces created by the RO need to have different attributes
depending on the space's use. The firmware rollback counter and MRC
hash spaces are created by the RO code and need to be protected at the
highest level: it should be impossible to delete or modify the space
once the RO exits, and it is how it is done before this patch.

The rest of the spaces should be possible to modify or recreate even
after the RO exits. Let's use different set of NVRAM space attributes
to achieve that, and set the 'pcr0 unchanged' policy only for the
firmware counter and MRC cache spaces.

The definitions of the attributes can be found in "Trusted Platform
Module Library Part 2: Structures", Revision 01.16, section "13.2
TPMA_NV (NV Index Attributes)."

CQ-DEPEND=CL:410127
BRANCH=none
BUG=chrome-os-partner:59651
TEST=verified that the reef system boots fine in both normal and
     recovery modes; using tpmc confirmed that firmware, kernel and
     MRC cache NVRAM spaces are readable in both and writeable only in
     recovery mode.

Change-Id: I1a1d2459f56ec929c9a92b39175888b8d1bcda55
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://review.coreboot.org/17388
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
2016-11-14 19:11:55 +01:00
..
gnat Add option to use Ada code in ramstage 2016-11-06 17:28:13 +01:00
b64_decode.c
boot_device.c lib/boot_device: add RW boot device construct 2016-08-19 03:07:05 +02:00
bootblock.c lib: Add asmlinkage attribute to bootblock_main_with_timestamp 2016-06-09 17:15:35 +02:00
bootmem.c lib/bootmem: allow architecture specific bootmem ranges 2016-04-21 20:46:45 +02:00
bootmode.c bootmode: Get rid of CONFIG_BOOTMODE_STRAPS 2016-07-28 00:36:22 +02:00
cbfs.c ACPI S3: Remove HIGH_MEMORY_SAVE where possible 2016-11-09 20:52:07 +01:00
cbmem_common.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
cbmem_console.c arch/x86,lib: make cbmem console work in postcar stage 2016-09-19 17:02:17 +02:00
cbmem_stage_cache.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
compute_ip_checksum.c
coreboot_table.c drivers/spi: ensure SPI flash is boot device for coreboot tables 2016-08-19 18:14:20 +02:00
debug.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
delay.c
edid.c edid: Fix a function signature 2016-09-08 23:19:06 +02:00
ext_stage_cache.c soc/intel/apollolake: Implement stage cache to improve resume time 2016-10-07 18:18:14 +02:00
fallback_boot.c drivers/pc80: Rework normal / fallback selector code 2015-11-03 21:55:20 +01:00
fmap.c lib/fmap: provide RW region device support 2016-08-19 18:17:04 +02:00
gcc.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
gcov-glue.c lib/gcov-glue.c: Remove trailing number from COVERAGE_MAGIC macro 2016-02-02 01:39:28 +01:00
gcov-io.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
gcov-io.h tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
gcov-iov.h
generic_dump_spd.c
generic_sdram.c
gpio.c lib/gpio: add pullup & pulldown gpio_base2_value() variants 2016-07-07 20:44:36 +02:00
halt.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
hardwaremain.c Add option to use Ada code in ramstage 2016-11-06 17:28:13 +01:00
hexdump.c lib/hexdump: Refactor to skip lines with all ones as well 2016-01-22 14:10:28 +01:00
hexstrtobin.c hexstrtobin: Add a library function to decode ASCII hex into binary 2016-05-21 05:58:51 +02:00
imd.c Correct some common spelling mistakes 2016-01-07 22:57:02 +01:00
imd_cbmem.c arch/x86,lib: make cbmem console work in postcar stage 2016-09-19 17:02:17 +02:00
jpeg.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
jpeg.h tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
libgcc.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
libgcov.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
lzma.c lib: remove ulzma() 2016-07-01 23:55:16 +02:00
lzmadecode.c lzma: Port size-checking ulzman() version to coreboot 2016-02-12 22:00:55 +01:00
lzmadecode.h
Makefile.inc TPM: Add TPM driver files to romstage 2016-11-10 00:56:04 +01:00
malloc.c
memchr.c
memcmp.c
memcpy.c
memmove.c
memrange.c lib/memrange: avoid shadow object declarations 2016-02-26 02:14:56 +01:00
memset.c
mocked_tlcl.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
nhlt.c lib/nhlt: add helper functions for adding endpoints 2016-06-29 23:13:54 +02:00
primitive_memtest.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
prog_loaders.c ACPI S3: Remove HIGH_MEMORY_SAVE where possible 2016-11-09 20:52:07 +01:00
prog_ops.c lib/prog_loading: introduce prog_segment_loaded() 2016-04-02 03:56:37 +02:00
program.ld lib/program.ld: add .sdata sections 2016-10-31 19:33:44 +01:00
ramtest.c quick_ram_check: Remove reference to RAMBASE 2016-11-08 19:16:41 +01:00
reg_script.c lib/reg_script: Fix braces 2016-05-05 19:41:29 +02:00
rmodule.c lib/prog_loading: introduce prog_segment_loaded() 2016-04-02 03:56:37 +02:00
rmodule.ld
romstage_stack.c intel post-car: Consolidate choose_top_of_stack() 2016-07-10 11:16:07 +02:00
rtc.c lib: Add real-time-clock functions 2016-06-24 20:22:05 +02:00
selfboot.c arm64: Use 'payload' format for ATF instead of 'stage' 2016-10-06 21:49:52 +02:00
stack.c
thread.c src/lib: Capitalize ROM, RAM, NVRAM and CPU 2016-07-31 19:30:54 +02:00
timer.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
timer_queue.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
timestamp.c memlayout: Ensure TIMESTAMP() region is big enough to avoid BUG() 2016-08-23 21:33:29 +02:00
tlcl.c lib/tlcl: Ensure tlcl library is initialized only once 2016-11-11 22:15:57 +01:00
tlcl_internal.h
tlcl_structures.h
tpm2_marshaling.c tpm2: Fix tlcl and marshaling code for CAR usage 2016-09-06 22:51:13 +02:00
tpm2_marshaling.h tpm2: avoid comparison between signed and unsigned ints 2016-07-13 23:58:32 +02:00
tpm2_tlcl.c lib/tpm2: do not create all NVRAM spaces with the same set of attributes 2016-11-14 19:11:55 +01:00
tpm2_tlcl_structures.h tpm2: implement and use pcr_extend command 2016-07-14 00:00:30 +02:00
tpm_error_messages.h src/lib: Fix checkpatch warnings 2016-09-07 22:28:00 +02:00
trace.c src/lib: Fix checkpatch warnings 2016-09-07 22:28:00 +02:00
version.c lib/version: Correct whitespace alignment 2016-07-15 00:10:50 +02:00
wrdd.c lib: Implement framework for retrieving WiFi regulatory domain 2016-03-08 18:41:33 +01:00