Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AML: PkgLength handling in *Field #187

Closed
alnyan opened this issue Aug 23, 2023 · 1 comment
Closed

AML: PkgLength handling in *Field #187

alnyan opened this issue Aug 23, 2023 · 1 comment

Comments

@alnyan
Copy link
Contributor

alnyan commented Aug 23, 2023

While working on my PR, I noticed that PkgLength may sometimes be handled incorrectly for *Field opcode parsing: it seems like the length needs to be checked against the corresponding Operation Region length and not the AML bytecode slice length.

The following code should be valid, but parsing it results in InvalidPkgLength if there's "not enough" bytes after the Field opcode:

OperationRegion (GIO0, SystemIO, 0x125, 0x100)

Field (GIO0, ByteAcc, NoLock, WriteAsZeros) {
   IDX0, 8,
   DAT0, 8,
   IDX1, 8,
   DAT1, 16,
   Offset(0x90),  // This line fails, but should be valid, as it's still within the GIO0 opreg
   IDX2, 8,
   DAT2, 8
}
@alnyan
Copy link
Contributor Author

alnyan commented Oct 3, 2023

#191 should fix the issue

@alnyan alnyan closed this as completed Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant