Date: Sun, 19 Sep 2010 19:42:04 +0000 (UTC) From: Alan Cox <alc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212873 - head/sys/vm Message-ID: <201009191942.o8JJg4QO013375@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009191942.o8JJg4QO013375>