Merge frame pinning to themis-synch #60

Merged
sb3923 merged 6 commits from vm/virtual-memory/frame-synch/saleh into vm/virtual-memory/themis-synch 2024-12-06 00:21:03 +00:00
6 changed files with 46 additions and 115 deletions
Showing only changes of commit 5cf79b5389 - Show all commits

View File

@@ -426,6 +426,10 @@ syscall_mmap (int fd, void *addr)
if (file_size == 0) if (file_size == 0)
return MMAP_FAILURE; return MMAP_FAILURE;
/* ensures the page for mmap does not 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 /* Check and ensure that there is enough space in the user virtual memory to
hold the entire file. */ hold the entire file. */
for (off_t ofs = 0; ofs < file_size; ofs += PGSIZE) for (off_t ofs = 0; ofs < file_size; ofs += PGSIZE)