From: Derrick Brashear Date: Tue, 25 Jan 2005 06:54:31 +0000 (+0000) Subject: linux-mmap-ro-means-no-write-20050125 X-Git-Tag: BP-disconnected~27 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=96cf60ef3e830d16325fba664044f751ca164f85;p=packages%2Fo%2Fopenafs.git linux-mmap-ro-means-no-write-20050125 don't allow a write map of a file which cannot be written to --- diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 333b5bebe..ab196b5fa 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -518,6 +518,9 @@ afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap) if (!code) code = afs_VerifyVCache(vcp, &treq); + if (!code && (vcp->states & CRO) && + (vmap->vm_file->f_flags & (FWRITE | FTRUNC))) + code = EACCES; if (code) code = -code;