efi_init_runtime_variable_supported() creates the two variables the OS
needs to write the variable file itself: RTStorageVolatile names the file
on the ESP and VarToFile hands out its contents. Both are inserted into
the same 128 KiB in-memory store as every other variable, so both fail
with EFI_OUT_OF_RESOURCES once that store is full.

The loader itself does not need those variables, only runtime
SetVariable() does. Warn and clear EFI_RT_SUPPORTED_SET_VARIABLE in the
runtime properties table instead, so the OS is told that persisting
variables at runtime is not available, and boot on.

Assisted-by: Claude:opus-5
Signed-off-by: Ahmad Fatoum <[email protected]>
---
 efi/loader/runtime.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/efi/loader/runtime.c b/efi/loader/runtime.c
index f0fbd263fe55..a33db166d064 100644
--- a/efi/loader/runtime.c
+++ b/efi/loader/runtime.c
@@ -72,8 +72,10 @@ efi_status_t efi_init_runtime_supported(void)
                CHECK_RT_FLAG(QUERY_VARIABLE_INFO);
 
        ret = efi_init_runtime_variable_supported();
-       if (ret != EFI_SUCCESS)
-               return ret;
+       if (ret != EFI_SUCCESS) {
+               pr_warn("no runtime variable store: %s\n", efi_strerror(ret));
+               rt_table->runtime_services_supported &= 
~EFI_RT_SUPPORTED_SET_VARIABLE;
+       }
 
        return efi_install_configuration_table(&efi_rt_properties_table_guid, 
rt_table);
 }
-- 
2.47.3


Reply via email to