Kernel: Keep the user pointer const through copy_from_user()
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6e4cd6300d
commit
79a5b98d65
@ -466,7 +466,7 @@ namespace MemoryManager
|
||||
// Userspace pointer not aligned on page boundary
|
||||
if (user_ptr != user_page)
|
||||
{
|
||||
if (!validate_user_writable_page(user_page)) return false;
|
||||
if (!validate_user_readable_page(user_page)) return false;
|
||||
}
|
||||
|
||||
while (size--)
|
||||
@ -474,10 +474,10 @@ namespace MemoryManager
|
||||
// Crossed a page boundary, gotta check the page tables again before touching any memory!!
|
||||
if (user_ptr % ARCH_PAGE_SIZE)
|
||||
{
|
||||
if (!validate_user_writable_page(user_ptr)) return false;
|
||||
if (!validate_user_readable_page(user_ptr)) return false;
|
||||
}
|
||||
|
||||
*kernel_ptr++ = *(char*)user_ptr;
|
||||
*kernel_ptr++ = *(const char*)user_ptr;
|
||||
user_ptr++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user