Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/compat/linux/common Pull up revision 1.58 (requeste...



details:   https://anonhg.NetBSD.org/src/rev/60eecf1e23ec
branches:  netbsd-1-4
changeset: 470890:60eecf1e23ec
user:      he <he%NetBSD.org@localhost>
date:      Sat Sep 09 15:54:59 2000 +0000

description:
Pull up revision 1.58 (requested by simonb):
  More carefully check length of user-supplied data, in particular
  make sure we don't overrun the available stack gap in stack gap
  allocations.

diffstat:

 sys/compat/linux/common/linux_misc_notalpha.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r 6d10e15cf04b -r 60eecf1e23ec sys/compat/linux/common/linux_misc_notalpha.c
--- a/sys/compat/linux/common/linux_misc_notalpha.c     Sat Sep 09 15:54:38 2000 +0000
+++ b/sys/compat/linux/common/linux_misc_notalpha.c     Sat Sep 09 15:54:59 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_misc_notalpha.c,v 1.50 1999/02/09 20:37:19 christos Exp $        */
+/*     $NetBSD: linux_misc_notalpha.c,v 1.50.2.1 2000/09/09 15:54:59 he Exp $  */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -224,6 +224,7 @@
        struct linux_utimbuf lut;
 
        sg = stackgap_init(p->p_emul);
+       tvp = (struct timeval *) stackgap_alloc(&sg, sizeof(tv));
        LINUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
 
        SCARG(&ua, path) = SCARG(uap, path);
@@ -234,7 +235,6 @@
                tv[0].tv_usec = tv[1].tv_usec = 0;
                tv[0].tv_sec = lut.l_actime;
                tv[1].tv_sec = lut.l_modtime;
-               tvp = (struct timeval *) stackgap_alloc(&sg, sizeof(tv));
                if ((error = copyout(tv, tvp, sizeof tv)))
                        return error;
                SCARG(&ua, tptr) = tvp;



Home | Main Index | Thread Index | Old Index