Skip to content

Commit 34343eb

Browse files
committed
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: 550b33c ("arm64: efi: Force the use of ...") Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent 8b3a149 commit 34343eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/efi/libstub/smbios.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const u8 *__efi_get_smbios_string(u8 type, int offset, int recsize)
3636
if (status != EFI_SUCCESS)
3737
return NULL;
3838

39-
strtable = (u8 *)record + recsize;
39+
strtable = (u8 *)record + record->length;
4040
for (int i = 1; i < ((u8 *)record)[offset]; i++) {
4141
int len = strlen(strtable);
4242

0 commit comments

Comments
 (0)