Source-Changes-HG archive

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

[src/trunk]: src/sys/kern PR/51916: Kamil Rytarowski: Don't multiply es_argle...



details:   https://anonhg.NetBSD.org/src/rev/597322fc6417
branches:  trunk
changeset: 821141:597322fc6417
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jan 25 17:55:47 2017 +0000

description:
PR/51916: Kamil Rytarowski: Don't multiply es_arglen with ptrsz since it is
already in bytes and contains the maximum possible size:
        ELF_AUX_ENTRIES * sizeof(auxv) + MAXPATHLEN + ALIGN

diffstat:

 sys/kern/core_elf32.c        |  6 +++---
 sys/kern/sys_ptrace_common.c |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r e23850f6fe79 -r 597322fc6417 sys/kern/core_elf32.c
--- a/sys/kern/core_elf32.c     Wed Jan 25 17:31:55 2017 +0000
+++ b/sys/kern/core_elf32.c     Wed Jan 25 17:55:47 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: core_elf32.c,v 1.50 2017/01/06 22:53:17 kamil Exp $    */
+/*     $NetBSD: core_elf32.c,v 1.51 2017/01/25 17:55:47 christos Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.50 2017/01/06 22:53:17 kamil Exp $");
+__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.51 2017/01/25 17:55:47 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_coredump.h"
@@ -416,7 +416,7 @@
 
        size_t ptrsz = PROC_PTRSZ(p);
        uauxv = (void *)((char *)pss.ps_envstr + (pss.ps_nenvstr + 1) * ptrsz);
-       size_t len = p->p_execsw->es_arglen * ptrsz;
+       size_t len = p->p_execsw->es_arglen;
 
        kauxv = kmem_alloc(len, KM_SLEEP);
        error = copyin_proc(p, uauxv, kauxv, len);
diff -r e23850f6fe79 -r 597322fc6417 sys/kern/sys_ptrace_common.c
--- a/sys/kern/sys_ptrace_common.c      Wed Jan 25 17:31:55 2017 +0000
+++ b/sys/kern/sys_ptrace_common.c      Wed Jan 25 17:55:47 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_ptrace_common.c,v 1.10 2017/01/14 06:36:52 kamil Exp $     */
+/*     $NetBSD: sys_ptrace_common.c,v 1.11 2017/01/25 17:55:47 christos Exp $  */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.10 2017/01/14 06:36:52 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.11 2017/01/25 17:55:47 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -619,7 +619,7 @@
                case PIOD_READ_AUXV:
                        req = PT_READ_D;
                        uio.uio_rw = UIO_READ;
-                       tmp = t->p_execsw->es_arglen * PROC_PTRSZ(t);
+                       tmp = t->p_execsw->es_arglen;
                        if (uio.uio_offset > tmp)
                                return EIO;
                        if (uio.uio_resid > tmp - uio.uio_offset)



Home | Main Index | Thread Index | Old Index