FADT table checksum corrupted when FACS table is faked
Alex Hung
alex.hung at canonical.com
Fri Nov 20 02:45:37 UTC 2015
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
>
--
Cheers,
Alex Hung
More information about the fwts-devel
mailing list