You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SdtHeaderIterator can be used to iterate over every SdtHeader, but the iterator only maps the size of the SdtHeader (36 bytes), whilst the validation requires that the whole header is mapped (for SSDTs this can be quite large, spanning over multiple pages).
impl<H>IteratorforSdtHeaderIterator<'_,H>whereH:AcpiHandler,{typeItem = SdtHeader;fnnext(&mutself) -> Option<Self::Item>{// ...// SAFETY: `address` needs to be valid for the size of `SdtHeader`, or the ACPI tables are malformed (not a// software issue).let header_mapping = unsafe{self.handler.map_physical_region::<SdtHeader>(table_phys_ptr asusize, mem::size_of::<SdtHeader>())};let r = header_mapping.validate(header_mapping.signature);// ...}}
The
SdtHeaderIterator
can be used to iterate over everySdtHeader
, but the iterator only maps the size of the SdtHeader (36 bytes), whilst the validation requires that the whole header is mapped (for SSDTs this can be quite large, spanning over multiple pages).This can be seen in acpi/src/lib.rs:503:
The last line calls
SdtHeader::validate()
Which in turn calls
SdtHeader::validate_checksum()
:The SAFETY-assumption is that the entire table is mapped, whilst only the header was mapped.
The text was updated successfully, but these errors were encountered: