Skip to content

Commit 46f4945

Browse files
committed
Merge tag 'efi-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull EFI updates from Ingo Molnar: "A handful of EFI changes for this cycle: - EFI CPER parsing improvements - Don't take the address of efi_guid_t internal fields" * tag 'efi-core-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi: cper: check section header more appropriately efi: Don't use knowledge about efi_guid_t internals efi: cper: fix scnprintf() use in cper_mem_err_location()
2 parents 4a2b88e + 1be72c8 commit 46f4945

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

drivers/firmware/efi/cper.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg)
221221
return 0;
222222

223223
n = 0;
224-
len = CPER_REC_LEN - 1;
224+
len = CPER_REC_LEN;
225225
if (mem->validation_bits & CPER_MEM_VALID_NODE)
226226
n += scnprintf(msg + n, len - n, "node: %d ", mem->node);
227227
if (mem->validation_bits & CPER_MEM_VALID_CARD)
@@ -258,13 +258,12 @@ static int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg)
258258
n += scnprintf(msg + n, len - n, "responder_id: 0x%016llx ",
259259
mem->responder_id);
260260
if (mem->validation_bits & CPER_MEM_VALID_TARGET_ID)
261-
scnprintf(msg + n, len - n, "target_id: 0x%016llx ",
262-
mem->target_id);
261+
n += scnprintf(msg + n, len - n, "target_id: 0x%016llx ",
262+
mem->target_id);
263263
if (mem->validation_bits & CPER_MEM_VALID_CHIP_ID)
264-
scnprintf(msg + n, len - n, "chip_id: %d ",
265-
mem->extended >> CPER_MEM_CHIP_ID_SHIFT);
264+
n += scnprintf(msg + n, len - n, "chip_id: %d ",
265+
mem->extended >> CPER_MEM_CHIP_ID_SHIFT);
266266

267-
msg[n] = '\0';
268267
return n;
269268
}
270269

@@ -633,7 +632,7 @@ int cper_estatus_check(const struct acpi_hest_generic_status *estatus)
633632
data_len = estatus->data_length;
634633

635634
apei_estatus_for_each_section(estatus, gdata) {
636-
if (sizeof(struct acpi_hest_generic_data) > data_len)
635+
if (acpi_hest_get_size(gdata) > data_len)
637636
return -EINVAL;
638637

639638
record_size = acpi_hest_get_record_size(gdata);

security/integrity/platform_certs/efi_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int __init parse_efi_signature_list(
5555
memcpy(&list, data, sizeof(list));
5656
pr_devel("LIST[%04x] guid=%pUl ls=%x hs=%x ss=%x\n",
5757
offs,
58-
list.signature_type.b, list.signature_list_size,
58+
&list.signature_type, list.signature_list_size,
5959
list.signature_header_size, list.signature_size);
6060

6161
lsize = list.signature_list_size;

0 commit comments

Comments
 (0)