Update validate_user_pointer to start from the beginning of the page rather than the given ptr
This commit is contained in:
@@ -475,7 +475,7 @@ validate_user_pointer (const void *start, size_t size)
|
||||
|
||||
/* We now need to check if the entire memory block is mapped to physical
|
||||
memory by the page table. */
|
||||
for (const void *ptr = start; ptr <= end; ptr += PGSIZE)
|
||||
for (const void *ptr = pg_round_down (start); ptr <= end; ptr += PGSIZE)
|
||||
if (pagedir_get_page (thread_current ()->pagedir, ptr) == NULL)
|
||||
syscall_exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user