ShellPkg/Acpiview: Refactor EINJ table parser validation

ACPI defines Injection Header Size as the length of the EINJ
injection header, not necessarily the absolute offset of the
instruction entries. Update parser validation to use the correct
entry offset calculation and accept the layout used by Linux and
existing firmware tables.

Signed-off-by: Simon Wang <simowang@nvidia.com>
This commit is contained in:
Simon Wang 2026-05-23 12:56:57 +08:00 committed by mergify[bot]
parent 750c92dc8b
commit 2816ff0ab0

View file

@ -327,7 +327,9 @@ ParseAcpiEinj (
);
// Validate Error Source Descriptors Count.
if ((mEinjInjectionHdrSize == NULL) || (*mEinjInjectionHdrSize != Offset)) {
if ((mEinjInjectionHdrSize == NULL) ||
(*mEinjInjectionHdrSize != (Offset - sizeof (EFI_ACPI_DESCRIPTION_HEADER))))
{
IncrementErrorCount ();
Print (L"ERROR: Invalid Injection Header...\n");
return;