svn commit: r247643 - in user/dchagin/lemul/sys: amd64/linux32 i386/linux
Dmitry Chagin
dchagin at FreeBSD.org
Sat Mar 2 17:08:15 UTC 2013
Author: dchagin
Date: Sat Mar 2 17:08:14 2013
New Revision: 247643
URL: http://svnweb.freebsd.org/changeset/base/247643
Log:
Linux do not allow an mmap() offset which is not modulo the pagesize.
Modified:
user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c
user/dchagin/lemul/sys/i386/linux/linux_machdep.c
Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c Sat Mar 2 17:06:39 2013 (r247642)
+++ user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c Sat Mar 2 17:08:14 2013 (r247643)
@@ -522,6 +522,13 @@ linux_mmap_common(struct thread *td, l_u
fp = NULL;
/*
+ * Linux do not allow an offset which is not
+ * modulo the pagesize.
+ */
+ if (pos & PAGE_MASK)
+ return (EINVAL);
+
+ /*
* Linux mmap(2):
* You must specify exactly one of MAP_SHARED and MAP_PRIVATE
*/
Modified: user/dchagin/lemul/sys/i386/linux/linux_machdep.c
==============================================================================
--- user/dchagin/lemul/sys/i386/linux/linux_machdep.c Sat Mar 2 17:06:39 2013 (r247642)
+++ user/dchagin/lemul/sys/i386/linux/linux_machdep.c Sat Mar 2 17:08:14 2013 (r247643)
@@ -426,6 +426,13 @@ linux_mmap_common(struct thread *td, l_u
fp = NULL;
/*
+ * Linux do not allow an offset which is not
+ * modulo the pagesize.
+ */
+ if (pos & PAGE_MASK)
+ return (EINVAL);
+
+ /*
* Linux mmap(2):
* You must specify exactly one of MAP_SHARED and MAP_PRIVATE
*/
More information about the svn-src-user
mailing list