mirror of
https://github.com/chipsec/chipsec
synced 2026-06-08 13:31:00 +00:00
81f859c572
Commit81fa32bd7e("drivers/linux: enforce address requirement for IOCTL_ALLOC_PHYSMEM") tried to enforce the physical address constraints provided by the user. However, it's broken for the memory range 16M-4G as there's no DMA32 kmalloc cache, making the request allocate from the normal zone which is free to return an address above 4GB for systems with enough RAM. Commitd010b82b0d("Fix malloc issue in Linux driver") worked around that issue by simple dropping the DMA32 allocation and only using DMA allocations for which kmalloc slabs do exist. As the DMA zone is a scarce resource and might be exhausted already, use a different allocation scheme for chipsec that directly allocates memory from the page allocator which honours both, DMA and DMA32 requests. Also fix the allocation list handling while at it. The stored physical address might be truncated on 32-bit PAE systems because of the use of 'physaddr_t' instead of 'phys_addr_t'. Signed-off-by: Mathias Krause <minipli@grsecurity.net>