Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Addendum to previous: copyin_proc() must not be use...



details:   https://anonhg.NetBSD.org/src/rev/7c1ecaafd26a
branches:  trunk
changeset: 582811:7c1ecaafd26a
user:      kleink <kleink%NetBSD.org@localhost>
date:      Wed Jul 06 20:56:49 2005 +0000

description:
Addendum to previous: copyin_proc() must not be used on curproc.

diffstat:

 sys/kern/core_elf32.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 5f433788fe8e -r 7c1ecaafd26a sys/kern/core_elf32.c
--- a/sys/kern/core_elf32.c     Wed Jul 06 20:31:33 2005 +0000
+++ b/sys/kern/core_elf32.c     Wed Jul 06 20:56:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: core_elf32.c,v 1.19 2005/07/06 20:31:33 kleink Exp $   */
+/*     $NetBSD: core_elf32.c,v 1.20 2005/07/06 20:56:49 kleink Exp $   */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.19 2005/07/06 20:31:33 kleink Exp $");
+__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.20 2005/07/06 20:56:49 kleink Exp $");
 
 /* If not included by core_elf64.c, ELFSIZE won't be defined. */
 #ifndef ELFSIZE
@@ -268,7 +268,10 @@
                int i;
 
                end -= slen;
-               error = copyin_proc(p, (void *) end, buf, slen);
+               if (__predict_true(p == curproc))
+                       error = copyin((void *) end, buf, slen);
+               else
+                       error = copyin_proc(p, (void *) end, buf, slen);
                if (error)
                        return (error);
 



Home | Main Index | Thread Index | Old Index