[PATCH] dmicheck: fix handling of type 16 capacities > 2 TiB
Alex Hung
alex.hung at canonical.com
Wed Oct 3 00:33:11 UTC 2018
Hi Robert,
Thanks for the patch, and this seems to be similar to
http://patchwork.ozlabs.org/patch/974876/.
Do you have comments on the other one, ex. yours is more complete?
On Wed, Oct 3, 2018 at 8:21 AM Robert Elliott <elliott at hpe.com> wrote:
>
> 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
>
>
> --
> fwts-devel mailing list
> fwts-devel at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel
--
Cheers,
Alex Hung
More information about the fwts-devel
mailing list