msync shouldn't go over bss sections
PATCH 1/1 msync shouldn't go over bss sections
This changes the behaviour of msync_interval() to make it impossible to try to sys_msync() anything not file mapped.
msync.c 2004-05-24 16:10:24.000000000 +0200 renamed from msync_orig.c 2004-05-23 21:31:32.000000000 +0200 +1 -1
@@ -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))
Quoted 4 lines · Alexander Nyberg
This changes the behaviour of
msync_interval()to make it impossible to try tosys_msync()anything not file mapped.
Well the patch doesn't "make it impossible". It makes it return -ENOMEM.
Quoted 1 line
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.
Quoted 11 lines
msync.c 2004-05-24 16:10:24.000000000 +0200 renamed from msync_orig.c 2004-05-23 21:31:32.000000000 +0200 +1
-1@@ -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))