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 1.59 (requested by t...



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

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

Don't allow non-page-aligned offsets.

diffstat:

 sys/compat/linux/common/linux_oldmmap.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 039ece656dbe -r 715eaeccb40a sys/compat/linux/common/linux_oldmmap.c
--- a/sys/compat/linux/common/linux_oldmmap.c   Wed Oct 22 03:47:43 2003 +0000
+++ b/sys/compat/linux/common/linux_oldmmap.c   Wed Oct 22 03:47:58 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_oldmmap.c,v 1.58 2002/03/29 20:49:40 christos Exp $      */
+/*     $NetBSD: linux_oldmmap.c,v 1.58.4.1 2003/10/22 03:47:58 jmc Exp $       */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_oldmmap.c,v 1.58 2002/03/29 20:49:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_oldmmap.c,v 1.58.4.1 2003/10/22 03:47:58 jmc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -83,6 +83,9 @@
        if ((error = copyin(SCARG(uap, lmp), &lmap, sizeof lmap)))
                return error;
 
+       if (lmap.lm_pos & PAGE_MASK)
+               return EINVAL;
+
        SCARG(&nlmap,addr) = (unsigned long)lmap.lm_addr;
        SCARG(&nlmap,len) = lmap.lm_len;
        SCARG(&nlmap,prot) = lmap.lm_prot;



Home | Main Index | Thread Index | Old Index