From: Andrew Morton <akpm@digeo.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: ch@murgatroid.com, fbecker@intrinsyc.com,
linux-arm-kernel@lists.arm.linux.org.uk,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: 2.5.55-rmk1: user space lossage
Date: Thu, 23 Jan 2003 02:06:27 -0800 [thread overview]
Message-ID: <20030123020627.5603a268.akpm@digeo.com> (raw)
In-Reply-To: <17281.1043316072@passion.cambridge.redhat.com>
David Woodhouse <dwmw2@infradead.org> wrote:
>
>
>
> - if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_WRITE))
> +- if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_WRITE))
> ++ if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_MAYWRITE))
Yup.
We cannot clear VM_MAYWRITE in there - it turns writeable MAP_PRIVATE
mappings into readonly ones.
So change it back to the 2.4 form - disallow a writeable MAP_SHARED mapping
against filesystems which do no implement ->writepage().
filemap.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff -puN mm/filemap.c~generic_file_readonly_mmap-fix mm/filemap.c
--- 25/mm/filemap.c~generic_file_readonly_mmap-fix 2003-01-23 01:55:41.000000000 -0800
+++ 25-akpm/mm/filemap.c 2003-01-23 02:04:05.000000000 -0800
@@ -1308,11 +1308,13 @@ int generic_file_mmap(struct file * file
return 0;
}
+/*
+ * This is for filesystems which do not implement ->writepage.
+ */
int generic_file_readonly_mmap(struct file *file, struct vm_area_struct *vma)
{
- if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_WRITE))
+ if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_MAYWRITE))
return -EINVAL;
- vma->vm_flags &= ~VM_MAYWRITE;
return generic_file_mmap(file, vma);
}
#else
_
next prev parent reply other threads:[~2003-01-23 9:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3E2F2354.7060508@intrinsyc.com>
2003-01-23 2:34 ` 2.5.55-rmk1: user space lossage Christopher Hoover
2003-01-23 9:48 ` David Woodhouse
2003-01-23 9:48 ` David Woodhouse
2003-01-23 9:56 ` Andrew Morton
2003-01-23 10:01 ` David Woodhouse
2003-01-23 10:01 ` David Woodhouse
2003-01-23 10:06 ` Andrew Morton [this message]
2003-01-23 17:57 ` Hugh Dickins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030123020627.5603a268.akpm@digeo.com \
--to=akpm@digeo.com \
--cc=ch@murgatroid.com \
--cc=dwmw2@infradead.org \
--cc=fbecker@intrinsyc.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.