diff options
| author | Peter Jones <pjones@redhat.com> | 2023-09-25 16:49:26 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2024-01-22 14:17:20 -0500 |
| commit | 49c6d95bd5c4f57f004db1f25b57fe36ca1c7443 (patch) | |
| tree | 9f56195f991f4f0b5f4070cd7503077297101212 /shim.c | |
| parent | 57c0eedfa1ebf6e2132a9cb26a7b0fcdee82557f (diff) | |
| download | efi-boot-shim-49c6d95bd5c4f57f004db1f25b57fe36ca1c7443.tar.gz efi-boot-shim-49c6d95bd5c4f57f004db1f25b57fe36ca1c7443.zip | |
Fix some minor ia32 build issues.
Several of our CVE fixes apparently were not well tested on 32-bit, and
needed some (uintptr_t) casts sprinkled about to build with
-Werror=pointer-to-int-cast.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'shim.c')
| -rw-r--r-- | shim.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -644,7 +644,8 @@ verify_buffer_authenticode (char *data, int datasize, if (!sig) break; - if ((uint64_t)&sig[1] > (uint64_t)data + datasize) { + if ((uint64_t)(uintptr_t)&sig[1] + > (uint64_t)(uintptr_t)data + datasize) { perror(L"Certificate size is too large for secruity database"); return EFI_INVALID_PARAMETER; } @@ -716,7 +717,8 @@ verify_buffer_sbat (char *data, int datasize, Section = context->FirstSection; for (i = 0; i < context->NumberOfSections; i++, Section++) { - if ((uint64_t)&Section[1] > (uint64_t)data + datasize) { + if ((uint64_t)(uintptr_t)&Section[1] + > (uintptr_t)(uintptr_t)data + datasize) { perror(L"Section exceeds bounds of image\n"); return EFI_UNSUPPORTED; } @@ -749,8 +751,8 @@ verify_buffer_sbat (char *data, int datasize, SBATSize = Section->SizeOfRawData; dprint(L"sbat section base:0x%lx size:0x%lx\n", SBATBase, SBATSize); - if (checked_add((uint64_t)SBATBase, SBATSize, &boundary) || - (boundary > (uint64_t)data + datasize)) { + if (checked_add((uint64_t)(uintptr_t)SBATBase, SBATSize, &boundary) || + (boundary > (uint64_t)(uintptr_t)data + datasize)) { perror(L"Section exceeds bounds of image\n"); return EFI_UNSUPPORTED; } |
