Allow a POSIX shared memory object that is opened for read but not for
write to nonetheless be mapped PROT_WRITE and MAP_PRIVATE, i.e., copy-on-write. (This is a regression in the new implementation of POSIX shared memory objects that is used by HEAD and RELENG_8. This bug does not exist in RELENG_7's user-level, file-based implementation.) PR: 150260 MFC after: 3 weeks
This commit is contained in:
+2
-1
@@ -1373,7 +1373,8 @@ vm_mmap_shm(struct thread *td, vm_size_t objsize,
|
||||
{
|
||||
int error;
|
||||
|
||||
if ((*maxprotp & VM_PROT_WRITE) == 0 &&
|
||||
if ((*flagsp & MAP_SHARED) != 0 &&
|
||||
(*maxprotp & VM_PROT_WRITE) == 0 &&
|
||||
(prot & PROT_WRITE) != 0)
|
||||
return (EACCES);
|
||||
#ifdef MAC
|
||||
|
||||
Reference in New Issue
Block a user