diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-06-06 17:30:17 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-06-06 17:32:04 +0200 |
commit | 808f7561179320650090085bb98f8d0cd4634624 (patch) | |
tree | 88cea62d25832690bab3daaaa90a2999ed0d3ea8 /vm | |
parent | 2a648479d659e37faa86e6a9c0214add000afe91 (diff) | |
download | gnumach-808f7561179320650090085bb98f8d0cd4634624.tar.gz gnumach-808f7561179320650090085bb98f8d0cd4634624.tar.bz2 gnumach-808f7561179320650090085bb98f8d0cd4634624.zip |
vm_map: Allow exagerated max_prot for now
glibc's mmap implementation assumes that gnumach will cap the prot for it,
so for now let's revert back to capping rather than rejecting.
That fixes mmap(SHARED|READ) for read-only objects.
Diffstat (limited to 'vm')
-rw-r--r-- | vm/vm_user.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vm/vm_user.c b/vm/vm_user.c index 934e3e50..42ee5e08 100644 --- a/vm/vm_user.c +++ b/vm/vm_user.c @@ -357,9 +357,9 @@ kern_return_t vm_map( if (!copy) { - /* Disallow protection beyond proxy's own limits. */ - if ((cur_protection & ~prot) || (max_protection & ~prot)) - return KERN_PROTECTION_FAILURE; + /* Reduce the allowed access to the memory object. */ + max_protection &= prot; + cur_protection &= prot; } else { |