* [PATCH] msync shouldn't go over bss sections
@ 2004-05-24 14:14 Alexander Nyberg
2004-05-24 20:43 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Nyberg @ 2004-05-24 14:14 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
This changes the behaviour of msync_interval() to make it impossible to
try to sys_msync() anything not file mapped.
--- mm/msync_orig.c 2004-05-23 21:31:32.000000000 +0200
+++ mm/msync.c 2004-05-24 16:10:24.000000000 +0200
@@ -137,7 +137,7 @@ static int filemap_sync(struct vm_area_s
static int msync_interval(struct vm_area_struct * vma,
unsigned long start, unsigned long end, int flags)
{
- int ret = 0;
+ int ret = -ENOMEM;
struct file * file = vma->vm_file;
if ((flags & MS_INVALIDATE) && (vma->vm_flags & VM_LOCKED))
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] msync shouldn't go over bss sections
2004-05-24 14:14 [PATCH] msync shouldn't go over bss sections Alexander Nyberg
@ 2004-05-24 20:43 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2004-05-24 20:43 UTC (permalink / raw)
To: Alexander Nyberg; +Cc: linux-kernel
Alexander Nyberg <alexn@telia.com> wrote:
>
> This changes the behaviour of msync_interval() to make it impossible to
> try to sys_msync() anything not file mapped.
>
Well the patch doesn't "make it impossible". It makes it return -ENOMEM.
>From my reading of the spec your patch converts correct behaviour to
incorrect behaviour, and even if that's untrue, I think we're stuck with
the current behaviour - this change can break current applications.
> --- mm/msync_orig.c 2004-05-23 21:31:32.000000000 +0200
> +++ mm/msync.c 2004-05-24 16:10:24.000000000 +0200
> @@ -137,7 +137,7 @@ static int filemap_sync(struct vm_area_s
> static int msync_interval(struct vm_area_struct * vma,
> unsigned long start, unsigned long end, int flags)
> {
> - int ret = 0;
> + int ret = -ENOMEM;
> struct file * file = vma->vm_file;
>
> if ((flags & MS_INVALIDATE) && (vma->vm_flags & VM_LOCKED))
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-05-24 20:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-24 14:14 [PATCH] msync shouldn't go over bss sections Alexander Nyberg
2004-05-24 20:43 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox