Fix user data alignment in MEMBLOCK#1471
Fix user data alignment in MEMBLOCK#1471aquynh merged 2 commits intocapstone-engine:masterfrom mbikovitsky:patch-1
Conversation
Kernel memory allocations on Windows should be aligned on MEMORY_ALLOCATION_ALIGNMENT (16 bytes on x64 and 8 bytes on x86).
|
cool! with this patch, Windows kernel driver works well now? |
|
It depends. For one, the current implementation returns 4-byte aligned memory on x86 (due to the On Windows, the kernel memory allocation APIs all return memory that is aligned at least on The point is that while the current implementation probably works fine, it is still worth fixing. I don't know whether the driver will work well now, but it will certainly work better :) |
|
@tandasat, can you please ack? |
|
I’m traveling now. I’ll check it by the end of this weekend. |
|
@tandasat, at the same time, please could you confirm that in the "v4" branch, your Windows driver still compiles without any issues? thanks! |
|
Will do. If you have the issue for this already, let me know so I can quickly catch up problems if any. |
|
I notice there are two implementation of windows driver support: Is the first one usable? When I merged the second one, it did not even compile (and so I had to create the 2nd one). I ask this because the patch is for the first one, and I am thinking of deprecating or deleting it and consolidate Windows kernel support implementation into one. Thoughts? Note that the patch itself looks reasonable. except that it should be done in |
|
Now that I look more closely at it, the version in I pushed a commit with the same change in |
|
Thank you @mbikovitsky. The changes look good to me. @aquynh not to block a merge of this PR but want to hear your thoughts on deleting |
|
the one under contrib\ is from @zer0mem, but i am not sure he still wants to maintain it. lets go ahead with this for now. |
|
so i will just merge this? |
|
Yes, let’s merge this. |
* Fix user data alignment in MEMBLOCK Kernel memory allocations on Windows should be aligned on MEMORY_ALLOCATION_ALIGNMENT (16 bytes on x64 and 8 bytes on x86). * Fix user data alignment in CS_WINKERNEL_MEMBLOCK
* Fix user data alignment in MEMBLOCK Kernel memory allocations on Windows should be aligned on MEMORY_ALLOCATION_ALIGNMENT (16 bytes on x64 and 8 bytes on x86). * Fix user data alignment in CS_WINKERNEL_MEMBLOCK
|
merged for all branches "master", "v4" & "next", thanks! @tandasat so you confirmed that all builds without any issues on "v4" branch? (i want to release v4.0.2 based on "v4" branch next week) |
|
I have not been able to check that yet. I’ll give you an update by the end of this weekend. |
|
I am working on windows-kernel support for v4 in this issue: #1474 |
Kernel memory allocations on Windows should be aligned on
MEMORY_ALLOCATION_ALIGNMENT(16 bytes on x64 and 8 bytes on x86).