Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'efi-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi into x86/urgent

Pull an EFI fix from Matt Fleming:

- Fix a bug in the Common Platform Error Record (CPER) driver that
caused old UEFI spec (< 2.3) versions of the memory error record
structure to be declared invalid. (Tony Luck)

Signed-off-by: Ingo Molnar <mingo@kernel.org>

+33 -4
+12 -3
drivers/firmware/efi/cper.c
··· 305 305 return ret; 306 306 } 307 307 308 - static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem) 308 + static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem, 309 + int len) 309 310 { 310 311 struct cper_mem_err_compact cmem; 311 312 313 + /* Don't trust UEFI 2.1/2.2 structure with bad validation bits */ 314 + if (len == sizeof(struct cper_sec_mem_err_old) && 315 + (mem->validation_bits & ~(CPER_MEM_VALID_RANK_NUMBER - 1))) { 316 + pr_err(FW_WARN "valid bits set for fields beyond structure\n"); 317 + return; 318 + } 312 319 if (mem->validation_bits & CPER_MEM_VALID_ERROR_STATUS) 313 320 printk("%s""error_status: 0x%016llx\n", pfx, mem->error_status); 314 321 if (mem->validation_bits & CPER_MEM_VALID_PA) ··· 412 405 } else if (!uuid_le_cmp(*sec_type, CPER_SEC_PLATFORM_MEM)) { 413 406 struct cper_sec_mem_err *mem_err = (void *)(gdata + 1); 414 407 printk("%s""section_type: memory error\n", newpfx); 415 - if (gdata->error_data_length >= sizeof(*mem_err)) 416 - cper_print_mem(newpfx, mem_err); 408 + if (gdata->error_data_length >= 409 + sizeof(struct cper_sec_mem_err_old)) 410 + cper_print_mem(newpfx, mem_err, 411 + gdata->error_data_length); 417 412 else 418 413 goto err_section_too_small; 419 414 } else if (!uuid_le_cmp(*sec_type, CPER_SEC_PCIE)) {
+21 -1
include/linux/cper.h
··· 340 340 __u64 mm_reg_addr; 341 341 }; 342 342 343 - /* Memory Error Section */ 343 + /* Old Memory Error Section UEFI 2.1, 2.2 */ 344 + struct cper_sec_mem_err_old { 345 + __u64 validation_bits; 346 + __u64 error_status; 347 + __u64 physical_addr; 348 + __u64 physical_addr_mask; 349 + __u16 node; 350 + __u16 card; 351 + __u16 module; 352 + __u16 bank; 353 + __u16 device; 354 + __u16 row; 355 + __u16 column; 356 + __u16 bit_pos; 357 + __u64 requestor_id; 358 + __u64 responder_id; 359 + __u64 target_id; 360 + __u8 error_type; 361 + }; 362 + 363 + /* Memory Error Section UEFI >= 2.3 */ 344 364 struct cper_sec_mem_err { 345 365 __u64 validation_bits; 346 366 __u64 error_status;