diff --git a/projects/rocr-runtime/src/fmm.c b/projects/rocr-runtime/src/fmm.c index 9aeca436af..5de949ec82 100644 --- a/projects/rocr-runtime/src/fmm.c +++ b/projects/rocr-runtime/src/fmm.c @@ -1121,11 +1121,14 @@ static void *fmm_allocate_host_cpu(uint64_t MemorySizeInBytes, { void *mem = NULL; vm_object_t *vm_obj; - int mmap_prot = PROT_READ | PROT_WRITE; + int mmap_prot = PROT_READ; if (flags.ui32.ExecuteAccess) mmap_prot |= PROT_EXEC; + if (!flags.ui32.ReadOnly) + mmap_prot |= PROT_WRITE; + /* mmap will return a pointer with alignment equal to * sysconf(_SC_PAGESIZE). */