Author: alc Date: Sun Sep 19 19:42:04 2010 New Revision: 212873 URL: http://svn.freebsd.org/changeset/base/212873
Log: 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 Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sun Sep 19 19:18:35 2010 (r212872) +++ head/sys/vm/vm_mmap.c Sun Sep 19 19:42:04 2010 (r212873) @@ -1373,7 +1373,8 @@ vm_mmap_shm(struct thread *td, vm_size_t { 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 _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"