[0.4.12] Revert "[NTOSKRNL] Properly align VACB writes"

to avoid CORE-15384 "ros corrupts FAT16 partition"

This reverts commit 0.4.11-dev-210-g
2a80ae2bb6
Like we did in 0.4.11rls.

I would happily switch over to a proper working fix from master later.
I would also do that if it appeared only after this interim solution got committed.

(cherry picked from commit 78cd6265d9)
This commit is contained in:
Joachim Henze 2018-12-17 00:14:06 +01:00
parent 8449527b88
commit b053803df1

View file

@ -81,7 +81,7 @@ NTAPI
CcReadVirtualAddress (
PROS_VACB Vacb)
{
ULONG Size;
ULONG Size, Pages;
PMDL Mdl;
NTSTATUS Status;
IO_STATUS_BLOCK IoStatus;
@ -95,11 +95,10 @@ CcReadVirtualAddress (
}
Size = LargeSize.LowPart;
Size = ROUND_TO_PAGES(Size);
ASSERT(Size <= VACB_MAPPING_GRANULARITY);
ASSERT(Size > 0);
Pages = BYTES_TO_PAGES(Size);
ASSERT(Pages * PAGE_SIZE <= VACB_MAPPING_GRANULARITY);
Mdl = IoAllocateMdl(Vacb->BaseAddress, Size, FALSE, FALSE, NULL);
Mdl = IoAllocateMdl(Vacb->BaseAddress, Pages * PAGE_SIZE, FALSE, FALSE, NULL);
if (!Mdl)
{
return STATUS_INSUFFICIENT_RESOURCES;
@ -178,10 +177,6 @@ CcWriteVirtualAddress (
} while (++i < (Size >> PAGE_SHIFT));
}
Size = ROUND_TO_PAGES(Size);
ASSERT(Size <= VACB_MAPPING_GRANULARITY);
ASSERT(Size > 0);
Mdl = IoAllocateMdl(Vacb->BaseAddress, Size, FALSE, FALSE, NULL);
if (!Mdl)
{