|
From: <sv...@va...> - 2005-09-30 10:48:32
|
Author: sewardj
Date: 2005-09-30 11:48:27 +0100 (Fri, 30 Sep 2005)
New Revision: 4838
Log:
ML_(generic_PRE_sys_mmap): reject non-page-aligned offsets.
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2005-09-30 10:34:06 UTC (=
rev 4837)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-09-30 10:48:27 UTC (=
rev 4838)
@@ -1736,6 +1736,14 @@
return VG_(mk_SysRes_Error)( VKI_EINVAL );
}
=20
+ if (!VG_IS_PAGE_ALIGNED(arg6)) {
+ /* zap any misaligned offsets. */
+ /* SuSV3 says: The off argument is constrained to be aligned and
+ sized according to the value returned by sysconf() when
+ passed _SC_PAGESIZE or _SC_PAGE_SIZE. */
+ return VG_(mk_SysRes_Error)( VKI_EINVAL );
+ }
+
/* Figure out what kind of allocation constraints there are
(fixed/hint/any), and ask aspacem what we should do. */
mreq.start =3D arg1;
|