Security fix for allocating pages for user-mode

This commit is contained in:
Alex 2023-02-07 03:21:39 +02:00
parent de5d8154ab
commit 3bc76edec0
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -124,6 +124,11 @@ namespace Memory
} }
AllocatedPagesList.push_back({Address, Count}); AllocatedPagesList.push_back({Address, Count});
/* For security reasons, we clear the memory
if the page is user accessible. */
if (User)
memset(Address, 0, Count * PAGE_SIZE);
return Address; return Address;
} }