[PATCH] dmicheck: fix handling of type 16 capacities > 2 TiB
Robert Elliott
elliott at hpe.com
Wed Oct 3 00:23:51 UTC 2018
In the SMBIOS type 16 (Physical Memory Array) record, a Maximum Capacity
field of 0x80000000 means that the capacity is reported in the
Extended Maximum Capacity field. However, that value triggers this
error:
FAILED [HIGH] DMIValueOutOfRange: Test 2, Out of range value 0x80000000 (range
allowed 0x0000..0x7fffffff) while accessing entry 'Physical Memory Array (Type
16)' @ 0x8a02f1fd, field 'Maximum Capacity', offset 0x07
check: Out of range value 0x80000000 (range allowed 0x0000..0x7fffffff) while accessing entry 'Physical Memory Array (Type 16)' @ 0x8a02f1fd, field 'Maximum Capacity',
offset 0x07
Modify the Maximum Capacity range check to exclude that value.
Signed-off-by: Robert Elliott <elliott at hpe.com>
---
src/dmi/dmicheck/dmicheck.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
index d0096bd4..3733fd98 100644
--- a/src/dmi/dmicheck/dmicheck.c
+++ b/src/dmi/dmicheck/dmicheck.c
@@ -1512,7 +1512,8 @@ static void dmicheck_entry(fwts_framework *fw,
data[0x4], table, addr, "Location", 0x4);
dmi_min_max_uint8_check(fw, table, addr, "Use", hdr, 0x5, 0x1, 0x7);
dmi_min_max_uint8_check(fw, table, addr, "Error Corrrection Type", hdr, 0x6, 0x1, 0x7);
- dmi_min_max_uint32_check(fw, table, addr, "Maximum Capacity", hdr, 0x7, 0, 0x80000000 - 1);
+ if (GET_UINT32(data + 0x7) != 0x80000000)
+ dmi_min_max_uint32_check(fw, table, addr, "Maximum Capacity", hdr, 0x7, 0, 0x80000000 - 1);
if (hdr->length < 0x17)
break;
if (GET_UINT64(data + 0xf) != 0 && GET_UINT32(data + 0x7) != 0x80000000)
--
2.14.4
More information about the fwts-devel
mailing list