env: Kconfig: disable external env in secure os boot
PATCH 1/1 env: Kconfig: disable external env in secure os boot
Falcon mode uses falcon_image_file from the env during mmc fs boot, but external env can be compromised. Therefore disable access to external env by setting SPL_ENV_IS_NOWHERE when SPL_OS_BOOT_SECURE is set.
---
This is a standalone patch from an older RFC:
https://lore.kernel.org/u-boot/[email protected]/
Changes:
- Add a depends on !SPL_OS_BOOT_SECURE for each SPL_ENV_IS_IN_*
Depends on:
[PATCH -next v3 1/7] spl: Kconfig: add SPL_OS_BOOT_SECURE config symbol:
- https://lore.kernel.org/u-boot/[email protected]/
--- env/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+)
env/Kconfig +7 -0
@@ -827,12 +827,14 @@ if SPL_ENV_SUPPORT config SPL_ENV_IS_NOWHERE bool "SPL Environment is not stored" default y if ENV_IS_NOWHERE + default y if SPL_OS_BOOT_SECURE help Similar to ENV_IS_NOWHERE, used for SPL environment. config SPL_ENV_IS_IN_MMC bool "SPL Environment in an MMC device" depends on !SPL_ENV_IS_NOWHERE + depends on !SPL_OS_BOOT_SECURE depends on ENV_IS_IN_MMC default y help
@@ -841,6 +843,7 @@ config SPL_ENV_IS_IN_MMC config SPL_ENV_IS_IN_FAT bool "SPL Environment is in a FAT filesystem" depends on !SPL_ENV_IS_NOWHERE + depends on !SPL_OS_BOOT_SECURE depends on ENV_IS_IN_FAT default y help
@@ -849,6 +852,7 @@ config SPL_ENV_IS_IN_FAT config SPL_ENV_IS_IN_EXT4 bool "SPL Environment is in a EXT4 filesystem" depends on !SPL_ENV_IS_NOWHERE + depends on !SPL_OS_BOOT_SECURE depends on ENV_IS_IN_EXT4 default y help
@@ -857,6 +861,7 @@ config SPL_ENV_IS_IN_EXT4 config SPL_ENV_IS_IN_NAND bool "SPL Environment in a NAND device" depends on !SPL_ENV_IS_NOWHERE + depends on !SPL_OS_BOOT_SECURE depends on ENV_IS_IN_NAND default y help
@@ -865,6 +870,7 @@ config SPL_ENV_IS_IN_NAND config SPL_ENV_IS_IN_SPI_FLASH bool "SPL Environment is in SPI flash" depends on !SPL_ENV_IS_NOWHERE + depends on !SPL_OS_BOOT_SECURE depends on ENV_IS_IN_SPI_FLASH default y help
@@ -873,6 +879,7 @@ config SPL_ENV_IS_IN_SPI_FLASH config SPL_ENV_IS_IN_FLASH bool "SPL Environment in flash memory" depends on !SPL_ENV_IS_NOWHERE + depends on !SPL_OS_BOOT_SECURE depends on ENV_IS_IN_FLASH default y help
Signature · 1 line
2.51.0
Quoted 5 lines · Anshul Dalal
Falcon mode uses
falcon_image_filefrom the env during mmc fs boot, but external env can be compromised. Therefore disable access to external env by settingSPL_ENV_IS_NOWHEREwhenSPL_OS_BOOT_SECUREis set.Signed-off-by Anshul Dalal <[email protected]>
Signature · 1 line
Tom
Quoted 5 lines · Anshul Dalal
Falcon mode uses
falcon_image_filefrom the env during mmc fs boot, but external env can be compromised. Therefore disable access to external env by settingSPL_ENV_IS_NOWHEREwhenSPL_OS_BOOT_SECUREis set.
Applied to u-boot/master, thanks!
[1/1] env: Kconfig: disable external env in secure os boot
commit: 1e470ddd0743bbd1f229421e11e9ad2093f7fd20
Signature · 1 line
Tom
Quoted 8 lines · Tom Rini
Quoted 5 lines · Anshul Dalal
Falcon mode uses
falcon_image_filefrom the env during mmc fs boot, but external env can be compromised. Therefore disable access to external env by settingSPL_ENV_IS_NOWHEREwhenSPL_OS_BOOT_SECUREis set.
Quoted 4 lines
Applied to u-boot/master, thanks!
[1/1] env:
Kconfig: disable external env in secure os bootcommit: 1e470ddd0743bbd1f229421e11e9ad2093f7fd20
Hi Tom,
Unfortunately the patch this depends on[1] has not been merged yet. Essentially as master stands now, we are disabling env based on SPL_OS_BOOT_SECURE even though that config isn't defined anywhere.
I'm working on addressing your comments[2] on my last series disabling fallback in falcon mode and will duly post a revision, in the meantime could we just merge the [1/7] of that series and I'll remove it form the rest of the series in the revision?
[1]:
[PATCH -next v3 1/7] spl: Kconfig: add SPL_OS_BOOT_SECURE config symbol:
- https://lore.kernel.org/u-boot/[email protected]/
[2]: https://lore.kernel.org/u-boot/20251015195943.GA710760@bill-the-cat/
Regards,
Anshul
Quoted 16 lines · Anshul Dalal
Quoted 8 lines · Tom Rini
Quoted 5 lines · Anshul Dalal
Falcon mode uses
falcon_image_filefrom the env during mmc fs boot, but external env can be compromised. Therefore disable access to external env by settingSPL_ENV_IS_NOWHEREwhenSPL_OS_BOOT_SECUREis set.Quoted 4 lines
Applied to u-boot/master, thanks!
[1/1] env:
Kconfig: disable external env in secure os bootcommit: 1e470ddd0743bbd1f229421e11e9ad2093f7fd20Hi Tom,
Quoted 8 lines
Unfortunately the patch this depends on[1] has not been merged yet. Essentially as master stands now, we are disabling env based on
SPL_OS_BOOT_SECUREeven though that config isn't defined anywhere.I'm working on addressing your comments[2] on my last series disabling fallback in falcon mode and will duly post a revision, in the meantime could we just merge the [1/7] of that series and I'll remove it form the rest of the series in the revision?
So, whoops. However, in Kconfig evaluation of "depends on !DOES_NOT_EXIST" is true, so there's no functional breakage here.
Signature · 1 line
Tom