summaryrefslogtreecommitdiffstats
path: root/src/include/boot_device.h
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2019-05-08 18:36:39 +0200
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2020-04-28 01:20:43 +0000
commit6093c5099f673a2f274acfbd9e6b17a9bf76843d (patch)
treeb5b5870f171ca66285ea529f7059ec3efc2f1a79 /src/include/boot_device.h
parent78feacc44057916161365d079ae92aa0baa679f8 (diff)
downloadcoreboot-6093c5099f673a2f274acfbd9e6b17a9bf76843d.tar.gz
coreboot-6093c5099f673a2f274acfbd9e6b17a9bf76843d.tar.bz2
coreboot-6093c5099f673a2f274acfbd9e6b17a9bf76843d.zip
security/lockdown: Write-protect WP_RO
Allow to write protect only the WP_RO region in case of enabled VBOOT. One can either lock the boot device in VERSTAGE early if VBOOT is enabled, or late in RAMSTAGE. Both options have their downsides as explained below. Lock early if you don't trust the code that's stored in the writeable flash partition. This prevents write-protecting the MRC cache, which is written in ramstage. In case the contents of the MRC cache are corrupted this can lead to system instability or trigger unwanted code flows inside the firmware. Lock late if you trust the code that's stored in the writeable flash partition. This allows write-protecting the MRC cache, but if a vulnerability is found in the code of the writeable partition an attacker might be able to overwrite the whole flash as it hasn't been locked yet. Change-Id: I72c3e1a0720514b9b85b0433944ab5fb7109b2a2 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Christian Walter <christian.walter@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32705 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'src/include/boot_device.h')
-rw-r--r--src/include/boot_device.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/boot_device.h b/src/include/boot_device.h
index 31464624b931..d5237cd45a7a 100644
--- a/src/include/boot_device.h
+++ b/src/include/boot_device.h
@@ -65,7 +65,7 @@ void boot_device_init(void);
/*
* Restrict read/write access to the bootmedia using platform defined rules.
*/
-#if CONFIG(BOOTMEDIA_LOCK_NONE)
+#if CONFIG(BOOTMEDIA_LOCK_NONE) || (CONFIG(BOOTMEDIA_LOCK_IN_VERSTAGE) && ENV_RAMSTAGE)
static inline void boot_device_security_lockdown(void) {}
#else
void boot_device_security_lockdown(void);