Implement VM #63

Merged
td1223 merged 94 commits from vm/merged/themis into master 2024-12-06 05:07:14 +00:00
148 changed files with 15789 additions and 119 deletions
Showing only changes of commit 7860f3863f - Show all commits

View File

@@ -426,6 +426,10 @@ syscall_mmap (int fd, void *addr)
if (file_size == 0)
return MMAP_FAILURE;
/* Ensure that the mmap page doesn't overlap with the stack. */
if (addr >= (thread_current ()->curr_esp) - PGSIZE)
return MMAP_FAILURE;
/* Check and ensure that there is enough space in the user virtual memory to
hold the entire file. */
for (off_t ofs = 0; ofs < file_size; ofs += PGSIZE)