ACK: [PATCH] acpi: LPIT: check for monotonically increasing UID
Colin Ian King
colin.king at canonical.com
Mon Dec 11 06:11:17 UTC 2017
On 21/11/17 03:21, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
> src/acpi/lpit/lpit.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/src/acpi/lpit/lpit.c b/src/acpi/lpit/lpit.c
> index eb4e3af..de7073c 100644
> --- a/src/acpi/lpit/lpit.c
> +++ b/src/acpi/lpit/lpit.c
> @@ -162,8 +162,10 @@ static int lpit_test1(fwts_framework *fw)
>
> /* Got enough data to be able to inspect the initial 2 x 32 bit words.. */
> while (length > 8) {
> + fwts_acpi_table_lpit_c_state *lpi = (fwts_acpi_table_lpit_c_state *)data;
> uint32_t *ptr = (uint32_t *)data;
> uint32_t lpi_length = *(ptr + 1);
> + uint16_t uid = 0;
>
> /* Stated LPI length must not be longer than what's left in the table */
> if (length < lpi_length) {
> @@ -181,6 +183,16 @@ static int lpit_test1(fwts_framework *fw)
> switch (*ptr) {
> case 0x0:
> lpit_check_type_0(fw, &length, &data, &passed);
> +
> + if (uid > lpi->id && (lpi->id - uid) > 1) {
> + passed = false;
> + fwts_failed(fw, LOG_LEVEL_CRITICAL,
> + "LPITNativeCStateBadUID",
> + "Unique ID of Native C-state based LPI "
> + "structure must be a zero-based monotonically "
> + "increasing value");
> + }
> + uid = lpi->id;
> break;
> default:
> passed = false;
>
Acked-by: Colin Ian King <colin.king at canonical.com>
More information about the fwts-devel
mailing list