summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2023-02-28 21:23:09 +0300
committerArd Biesheuvel <ardb@kernel.org>2023-03-18 13:37:56 +0300
commit34343eb06afc04af9178a9883d9354dc12beede0 (patch)
tree6e53401fc61d24099546c7b9ec9fd8b3ddc29546
parent8b3a149db461d3286d1e211112de3b44ccaeaf71 (diff)
downloadlinux-34343eb06afc04af9178a9883d9354dc12beede0.tar.xz
efi/libstub: smbios: Use length member instead of record struct size
The type 1 SMBIOS record happens to always be the same size, but there are other record types which have been augmented over time, and so we should really use the length field in the header to decide where the string table starts. Fixes: 550b33cfd4452968 ("arm64: efi: Force the use of ...") Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r--drivers/firmware/efi/libstub/smbios.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/efi/libstub/smbios.c b/drivers/firmware/efi/libstub/smbios.c
index 460418b7f5f5..aadb422b9637 100644
--- a/drivers/firmware/efi/libstub/smbios.c
+++ b/drivers/firmware/efi/libstub/smbios.c
@@ -36,7 +36,7 @@ const u8 *__efi_get_smbios_string(u8 type, int offset, int recsize)
if (status != EFI_SUCCESS)
return NULL;
- strtable = (u8 *)record + recsize;
+ strtable = (u8 *)record + record->length;
for (int i = 1; i < ((u8 *)record)[offset]; i++) {
int len = strlen(strtable);