Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Make sure `olddelta' is a valid pointer before perf...



details:   https://anonhg.NetBSD.org/src/rev/5a2610a66b0f
branches:  trunk
changeset: 473576:5a2610a66b0f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Jun 07 22:33:53 1999 +0000

description:
Make sure `olddelta' is a valid pointer before performing the guts of
the adjtime(2) system call.  Fixes PR #7721, Darren Reed.

diffstat:

 sys/kern/kern_time.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r e30a2d0c9eef -r 5a2610a66b0f sys/kern/kern_time.c
--- a/sys/kern/kern_time.c      Mon Jun 07 21:30:57 1999 +0000
+++ b/sys/kern/kern_time.c      Mon Jun 07 22:33:53 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_time.c,v 1.36 1998/08/18 06:27:01 thorpej Exp $   */
+/*     $NetBSD: kern_time.c,v 1.37 1999/06/07 22:33:53 thorpej Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -50,6 +50,9 @@
 #include <sys/mount.h>
 #include <sys/syscallargs.h>
 
+#include <vm/vm.h>
+#include <uvm/uvm_extern.h>
+
 #if defined(NFS) || defined(NFSSERVER)
 #include <nfs/rpcv2.h>
 #include <nfs/nfsproto.h>
@@ -344,6 +347,10 @@
        error = copyin(SCARG(uap, delta), &atv, sizeof(struct timeval));
        if (error)
                return (error);
+       if (SCARG(uap, olddelta) != NULL &&
+           uvm_useracc((caddr_t)SCARG(uap, olddelta), sizeof(struct timeval),
+            B_WRITE) == FALSE)
+               return (EFAULT);
 
        /*
         * Compute the total correction and the rate at which to apply it.



Home | Main Index | Thread Index | Old Index