ACK: [PATCH][V2] acpi: acpidump: don't assume FPDT tables are correct about their record sizes (LP: #1375258)

Keng-Yu Lin keng-yu.lin at canonical.com
Fri Oct 3 07:11:56 UTC 2014


On Fri, Oct 3, 2014 at 11:22 AM, Alex Hung <alex.hung at canonical.com> wrote:
> On 10/01/2014 05:07 PM, Colin King wrote:
>> From: Colin Ian King <colin.king at canonical.com>
>>
>> Section 5.2.23.4 and 5.2.23.5 Performance Record Formats of the
>> ACPI specification states that the length field is a minimum
>> of 16 bytes for these two record types. Currently fwts believes
>> this data from the firmware, however, some firmware has been known
>> to set this to zero causing fwts to loop on the dumping of multiple
>> records.
>>
>> fwts should instead not trust this field and anything less than 16
>> bytes should be dumped out as a hex dump since it can't be decoded.
>>
>> Signed-off-by: Colin Ian King <colin.king at canonical.com>
>> ---
>>  src/acpi/acpidump/acpidump.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
>> index 7b45932..e3fe4b1 100644
>> --- a/src/acpi/acpidump/acpidump.c
>> +++ b/src/acpi/acpidump/acpidump.c
>> @@ -1641,6 +1641,15 @@ static void acpidump_fpdt(fwts_framework *fw, const fwts_acpi_table_info *table)
>>       while (ptr < data + table->length) {
>>               fwts_acpi_table_fpdt_header *fpdt = (fwts_acpi_table_fpdt_header *)ptr;
>>
>> +             /* fpdt not long enough, bail out early */
>> +             if (fpdt->length < 16) {
>> +                     size_t offset = ptr - data;
>> +                     fwts_log_info_verbatum(fw, "Cannot decode FPDT header, size %"
>> +                             PRIu8 " less than 16 bytes. Data:", fpdt->length);
>> +                     acpi_dump_raw_data(fw, ptr, table->length - offset, offset);
>> +                     break;
>> +             }
>> +
>>               fwts_log_nl(fw);
>>
>>               switch (fpdt->type) {
>>
>
> Acked-by: Alex Hung <alex.hung at canonical.com>
>

Acked-by: Keng-Yu Lin <kengyu at canonical.com>



More information about the fwts-devel mailing list