Skip to content

Commit

Permalink
CVE-2023-40546 mok: fix LogError() invocation
Browse files Browse the repository at this point in the history
On some ARM platform, jlinton noticed that when we fail to set a
variable (because it isn't supported at all, presumably), our error
message has an extra argument that doesn't match the format string.

This patch removes the extra argument.

Resolves: CVE-2023-40546
Signed-off-by: Peter Jones <[email protected]>
  • Loading branch information
vathpela authored and steve-mcintyre committed Oct 19, 2023
1 parent 7ba7440 commit 66e6579
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mok.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ mirror_one_esl(CHAR16 *name, EFI_GUID *guid, UINT32 attrs,
&var, &varsz);
if (EFI_ERROR(efi_status) || !var || !varsz) {
LogError(L"Couldn't allocate %lu bytes for mok variable \"%s\": %r\n",
varsz, var, efi_status);
varsz, name, efi_status);
return efi_status;
}

Expand All @@ -302,7 +302,7 @@ mirror_one_esl(CHAR16 *name, EFI_GUID *guid, UINT32 attrs,
FreePool(var);
if (EFI_ERROR(efi_status)) {
LogError(L"Couldn't create mok variable \"%s\": %r\n",
varsz, var, efi_status);
name, efi_status);
return efi_status;
}

Expand Down

0 comments on commit 66e6579

Please sign in to comment.