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 'dmi-for-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

Pull dmi updates from Jean Delvare:
"Bug fixes:

- KCFI violation in dmi-id

- stop decoding on broken (short) DMI table entry

New features:

- print info about populated memory slots at boot"

* tag 'dmi-for-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
firmware: dmi: Add info message for number of populated and total memory slots
firmware: dmi: Stop decoding on broken entry
firmware: dmi-id: add a release callback function

+23 -1
+6 -1
drivers/firmware/dmi-id.c
··· 169 169 return 0; 170 170 } 171 171 172 + static void dmi_dev_release(struct device *dev) 173 + { 174 + kfree(dev); 175 + } 176 + 172 177 static struct class dmi_class = { 173 178 .name = "dmi", 174 - .dev_release = (void(*)(struct device *)) kfree, 179 + .dev_release = dmi_dev_release, 175 180 .dev_uevent = dmi_dev_uevent, 176 181 }; 177 182
+17
drivers/firmware/dmi_scan.c
··· 42 42 u8 type; /* DDR2, DDR3, DDR4 etc */ 43 43 } *dmi_memdev; 44 44 static int dmi_memdev_nr; 45 + static int dmi_memdev_populated_nr __initdata; 45 46 46 47 static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s) 47 48 { ··· 101 100 while ((!dmi_num || i < dmi_num) && 102 101 (data - buf + sizeof(struct dmi_header)) <= dmi_len) { 103 102 const struct dmi_header *dm = (const struct dmi_header *)data; 103 + 104 + /* 105 + * If a short entry is found (less than 4 bytes), not only it 106 + * is invalid, but we cannot reliably locate the next entry. 107 + */ 108 + if (dm->length < sizeof(struct dmi_header)) { 109 + pr_warn(FW_BUG 110 + "Corrupted DMI table, offset %zd (only %d entries processed)\n", 111 + data - buf, i); 112 + break; 113 + } 104 114 105 115 /* 106 116 * We want to know the total length (formatted area and ··· 459 447 bytes = (u64)size << 20; 460 448 else 461 449 bytes = (u64)get_unaligned((u32 *)&d[0x1C]) << 20; 450 + 451 + if (bytes) 452 + dmi_memdev_populated_nr++; 462 453 463 454 dmi_memdev[nr].size = bytes; 464 455 nr++; ··· 839 824 return; 840 825 841 826 dmi_memdev_walk(); 827 + pr_info("DMI: Memory slots populated: %d/%d\n", 828 + dmi_memdev_populated_nr, dmi_memdev_nr); 842 829 dump_stack_set_arch_desc("%s", dmi_ids_string); 843 830 } 844 831