]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/uefi: skip time check for append-write updates.
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 4 Nov 2025 10:27:14 +0000 (11:27 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 3 Feb 2026 07:32:33 +0000 (08:32 +0100)
Only execute the time time check if the EFI_VARIABLE_APPEND_WRITE bit is
clear.  For append-write updates the timestamp verification is not
needed.

See uefi spec, section "8.2.6 Using the EFI_VARIABLE_AUTHENTICATION_2
descriptor"

Fixes: db1ecfb473ac ("hw/uefi: add var-service-vars.c")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20251104102714.733078-1-kraxel@redhat.com>

hw/uefi/var-service-vars.c

index 8533533ea5c8c977fa8c2c49a945da8df5bdd356..52845e9723d3d818b5e2ecb9ac2651da42ff2f92 100644 (file)
@@ -475,7 +475,8 @@ static size_t uefi_vars_mm_set_variable(uefi_vars_state *uv, mm_header *mhdr,
                 goto rollback;
             }
             if (old_var && new_var) {
-                if (uefi_time_compare(&old_var->time, &new_var->time) > 0) {
+                if ((va->attributes & EFI_VARIABLE_APPEND_WRITE) == 0 &&
+                    uefi_time_compare(&old_var->time, &new_var->time) > 0) {
                     trace_uefi_vars_security_violation("time check failed");
                     mvar->status = EFI_SECURITY_VIOLATION;
                     goto rollback;