kernel: Properly check memory bounds in strdup_from_user()
All checks were successful
continuous-integration/drone/push Build is passing

Missed this one in 097353e779.
This commit is contained in:
apio 2023-08-08 10:27:19 +02:00
parent 2e63b93e48
commit 7c254e5e15
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -508,7 +508,7 @@ namespace MemoryManager
{ {
TRY(result.try_append(*(char*)address)); TRY(result.try_append(*(char*)address));
address++; address++;
if (address % ARCH_PAGE_SIZE) if ((address % ARCH_PAGE_SIZE) == 0)
{ {
if (!validate_page_access(address, MMU::User)) return err(EFAULT); if (!validate_page_access(address, MMU::User)) return err(EFAULT);
} }