hw/uefi: add missing uefi_str_is_valid check to uefi_vars_mm_lock_variable
PATCH 1/1 hw/uefi: add missing uefi_str_is_valid check to uefi_vars_mm_lock_variable
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4213
Signed-off-by Gerd Hoffmann <[email protected]>
--- hw/uefi/var-service-vars.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/uefi/var-service-vars.c +4 -0
@@ -690,6 +690,10 @@ uefi_vars_mm_lock_variable(uefi_vars_state *uv, mm_header *mhdr,return uefi_vars_mm_error (mhdr, mvar,EFI_BAD_BUFFER_SIZE ); } +if (!uefi_str_is_valid (name, lv->name_size, true)) { +return uefi_vars_mm_error (mhdr, mvar,EFI_INVALID_PARAMETER ); + } +uefi_trace_variable (__func__, lv->guid, name, lv->name_size); pe =g_malloc0 (sizeof (*pe) + lv->name_size);
Signature · 1 line
2.55.0
Quoted 2 lines · Gerd Hoffmann
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4213
Signed-off-by Gerd Hoffmann <[email protected]>
Reviewed-by Luigi Leonardi <[email protected]>