FADT table checksum corrupted when FACS table is faked
Jiri Vohanka
jvohanka at redhat.com
Mon Nov 23 14:54:14 UTC 2015
Hello,
I discovered the problem in 'checksum' test on aarch64 systems. The FACS table
is not accessible in /sys/firmware/acpi/tables/ (nor by acpidump) on these
systems. Unfortunately, I am not comfortable with sharing the ACPI tables of
aarch64 systems, since our machines are prototypes and there may be some
confidentiality agreements.
But you can reproduce the problem also on x86_64 system if you fake the fact
that FACS table is missing.
# acpidump > acpi.log
# acpixtract -a acpi.log
# rm facs.dat
# fwts -r checksum.log -t . checksum
Is this enough for your testing, or do you need further help?
Regards,
Jiri
On 11/20/2015 03:45 AM, Alex Hung wrote:
> Jiri,
>
> Thanks for the patch.
>
> Please share your acpi table. You can use "sudo acpidump > acpi.log"
> to generate it, and we can verify the before/after behaviours of the
> patch.
>
> I may also need two things:
> 1. please use git send-email to send this patch
> 2. please sign the patch
>
> Thanks,
> Alex Hung
>
> On Thu, Nov 19, 2015 at 10:28 PM, Jiri Vohanka <jvohanka at redhat.com> wrote:
>> Hello,
>>
>> I discovered a problem in src/lib/src/fwts_acpi_tables.c that causes
>> a false FAIL in the 'checksum' test.
>>
>> If a FACS ACPI table is not found, a fake one is created and a fake physical
>> address is assigned to it. This fake physical address is written to
>> FIRMWARE_CTRL and X_FIRMWARE_CTRL fields of FADT table:
>>
>> facs_fake_addr = fwts_fake_physical_addr(size);
>> fadt->firmware_control = (uint32_t)facs_fake_addr;
>> if (fadt->header.length >= 140)
>> fadt->x_firmware_ctrl = (uint64_t)facs_fake_addr;
>>
>> (By the way, the ACPI 6.0 specification states that only one of
>> FIRMWARE_CTRL,
>> X_FIRMWARE_CTRL could be nonzero.)
>> The problem is that the checksum of the FADT table is not updated to reflect
>> the change in 'firmware_control' and 'x_firmware_ctrl' fields.
>>
>> I created a patch that changes the update of physical address of FACS in
>> FADT.
>> It tries to use the physical address from 'x_firmware_ctrl' and
>> 'firmware_control' fields of FADT table. If both fields are zero then
>> a fake physical address is assigned to FACS, written to FADT table and the
>> checksum of FADT is updated.
>>
>> Unpatched test:
>> No FACS found, fwts has faked one instead.
>> ...
>> FAILED [MEDIUM] ACPITableChecksum: Test 1, Table FACP has incorrect
>> checksum,
>> expected 0xe8, got 0xcf.
>>
>> Patched test:
>> No FACS found, fwts has faked one instead.
>> ...
>> PASSED: Test 1, Table FACP has correct checksum 0xcf
>>
>> Regards,
>> Jiri Vohanka
>>
>> --
>> fwts-devel mailing list
>> fwts-devel at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/fwts-devel
>>
>
>
>
More information about the fwts-devel
mailing list