Expected sys_msync() behaviour?

From: Alexander Nyberg
Date: Sat May 22 2004 - 12:06:24 EST


I looked at a bugzilla filed because of sys_msync() returning ok even if
you specify a addr + len that goes over bss section or MAP_PRIVATE's.

http://bugzilla.kernel.org/show_bug.cgi?id=2728
(my patch should return -ENOMEM instead of -EINVAL according
to specification link below).


This brings up a question on the expected behaviour of sys_msync().
Should it only sync a single vma?

Should it traverse several vma's until the the ending address has been
reached? In that case it should skip anything not MAP_SHARED, but that
also makes the system call quite random as it doesn't sync a flat memory
region.

Personally I think that it should sync a single vma, or parts of it, not
search around or "accidently" touch other mappings which aren't
intended, this should be the work of the user space program.

So before syncing it should check that the region is backed by a
MAP_SHARED file which is writeable and then sync it, yes?

The Open Group Base Specifications Issue 6:
http://www.opengroup.org/onlinepubs/009695399/functions/msync.html

Alex

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/