hw/uefi: skip time check for append-write updates.
PATCH 1/1 hw/uefi: skip time check for append-write updates.
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 <[email protected]>
--- hw/uefi/var-service-vars.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/uefi/var-service-vars.c +2 -1
@@ -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;
Signature · 1 line
2.51.1