mirror of
https://github.com/reactos/reactos.git
synced 2025-07-05 15:51:22 +00:00
[NTOSKRNL] Fix a bug in MiDeleteVirtualAddresses
When a PDE gets empty, we skip the address to the next PDE boundary, which might introduce an AddressGap, which wasn't handled before.
This commit is contained in:
parent
57c84dd658
commit
f606b36cff
1 changed files with 8 additions and 3 deletions
|
@ -714,10 +714,15 @@ MiDeleteVirtualAddresses(IN ULONG_PTR Va,
|
||||||
if (MiDecrementPageTableReferences((PVOID)Va) == 0)
|
if (MiDecrementPageTableReferences((PVOID)Va) == 0)
|
||||||
{
|
{
|
||||||
ASSERT(PointerPde->u.Long != 0);
|
ASSERT(PointerPde->u.Long != 0);
|
||||||
|
|
||||||
/* Delete the PDE proper */
|
/* Delete the PDE proper */
|
||||||
MiDeletePde(PointerPde, CurrentProcess);
|
MiDeletePde(PointerPde, CurrentProcess);
|
||||||
/* Jump */
|
|
||||||
|
/* Continue with the next PDE */
|
||||||
Va = (ULONG_PTR)MiPdeToAddress(PointerPde + 1);
|
Va = (ULONG_PTR)MiPdeToAddress(PointerPde + 1);
|
||||||
|
|
||||||
|
/* Use this to detect address gaps */
|
||||||
|
PointerPte++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -733,8 +738,8 @@ MiDeleteVirtualAddresses(IN ULONG_PTR Va,
|
||||||
|
|
||||||
if (Va > EndingAddress) return;
|
if (Va > EndingAddress) return;
|
||||||
|
|
||||||
/* Otherwise, we exited because we hit a new PDE boundary, so start over */
|
/* Check if we exited the loop regularly */
|
||||||
AddressGap = FALSE;
|
AddressGap = (PointerPte != MiAddressToPte(Va));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue