On 1/18/2024 10:38 AM, Oliver Smith-Denny wrote:
I am suspicious that we are checking for the alignment before we
adjust the memory for the guard. I'm wondering if we actually
should do AdjustMemoryF (recalling function from memory) before
we check the alignment.


Following up on this, this is very suspicious to me. If you change
the CoreInternalFreePages alignment check to something like:

EFI_PHYSICAL_ADDRESS CheckMemory = Memory;
UINTN                CheckPages   = NumberOfPages;

AdjustMemoryF (&CheckMemory, &CheckPages);

if ((CheckMemory & (Alignment - 1)) != 0) {
    Status = EFI_INVALID_PARAMETER;
    goto Done;
}

Does this solve your issue? I have to run to a meeting, but I can
write this in actual patch form (and give it a quick test) later.

Thanks,
Oliver


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114008): https://edk2.groups.io/g/devel/message/114008
Mute This Topic: https://groups.io/mt/103810212/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to