mirror of
https://github.com/chipsec/chipsec
synced 2026-06-08 13:31:00 +00:00
81fa32bd7e
Try harder to fulfill the physical address constraint for the IOCTL_ALLOC_PHYSMEM ioctl by trying to allocate memory from the zones that fit the maximum address best, but fall-back to the normal zone in case the allocation fails. If we fail to allocate memory that fulfills the maximum physical address constraint, make the ioctl() fail as well instead of emitting a warning. This is safer then making, e.g., the tools.smm.smm_ptr module corrupt unrelated memory just because the allocation happens to be above 4GB but the pointer passed to SMM is truncated to 32 bit. Signed-off-by: Mathias Krause <minipli@grsecurity.net>