Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/compat/linux/common Pullup rev 115 (requested by tv...



details:   https://anonhg.NetBSD.org/src/rev/039ece656dbe
branches:  netbsd-1-6
changeset: 530934:039ece656dbe
user:      jmc <jmc%NetBSD.org@localhost>
date:      Wed Oct 22 03:47:43 2003 +0000

description:
Pullup rev 115 (requested by tv in ticket #1426)

Don't allow non-page-aligned offsets.

diffstat:

 sys/compat/linux/common/linux_misc.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r 9b48f9011114 -r 039ece656dbe sys/compat/linux/common/linux_misc.c
--- a/sys/compat/linux/common/linux_misc.c      Wed Oct 22 03:44:27 2003 +0000
+++ b/sys/compat/linux/common/linux_misc.c      Wed Oct 22 03:47:43 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_misc.c,v 1.109.4.2 2002/12/12 21:29:13 he Exp $  */
+/*     $NetBSD: linux_misc.c,v 1.109.4.3 2003/10/22 03:47:43 jmc Exp $ */
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.109.4.2 2002/12/12 21:29:13 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.109.4.3 2003/10/22 03:47:43 jmc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -444,9 +444,11 @@
                syscallarg(linux_off_t) offset;
        } */ *uap = v;
        struct sys_mmap_args cma;
-       int flags, fl = SCARG(uap, flags);
+       int flags = 0, fl = SCARG(uap, flags);
        
-       flags = 0;
+       if (SCARG(uap, offset) & PAGE_MASK)
+               return EINVAL;
+
        flags |= cvtto_bsd_mask(fl, LINUX_MAP_SHARED, MAP_SHARED);
        flags |= cvtto_bsd_mask(fl, LINUX_MAP_PRIVATE, MAP_PRIVATE);
        flags |= cvtto_bsd_mask(fl, LINUX_MAP_FIXED, MAP_FIXED);



Home | Main Index | Thread Index | Old Index