refuse the write to a read-only memory

It was able to change a read-only memory using a system call that
forwarded to host.

To fix this, when read-only mmap(), it places read-only vm_area in the
mcexec's space.
This commit is contained in:
NAKAMURA Gou
2013-11-06 16:02:30 +09:00
parent 89be2af09a
commit bdc02bb687
4 changed files with 161 additions and 42 deletions

View File

@@ -140,8 +140,8 @@ int add_process_memory_range(struct process *process,
unsigned long start, unsigned long end,
unsigned long phys, unsigned long flag,
struct memobj *memobj, off_t objoff);
int remove_process_memory_range(
struct process *process, unsigned long start, unsigned long end);
int remove_process_memory_range(struct process *process, unsigned long start,
unsigned long end, int *ro_freedp);
int split_process_memory_range(struct process *process,
struct vm_range *range, uintptr_t addr, struct vm_range **splitp);
int join_process_memory_range(struct process *process, struct vm_range *surviving,