Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Zero out more lock snapshots in sysctl exposure.



details:   https://anonhg.NetBSD.org/src/rev/2028e919fb76
branches:  trunk
changeset: 943231:2028e919fb76
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Aug 28 21:39:28 2020 +0000

description:
Zero out more lock snapshots in sysctl exposure.

diffstat:

 sys/kern/kern_proc.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r 8e391ca2f1f2 -r 2028e919fb76 sys/kern/kern_proc.c
--- a/sys/kern/kern_proc.c      Fri Aug 28 20:57:54 2020 +0000
+++ b/sys/kern/kern_proc.c      Fri Aug 28 21:39:28 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_proc.c,v 1.256 2020/08/26 22:56:55 christos Exp $ */
+/*     $NetBSD: kern_proc.c,v 1.257 2020/08/28 21:39:28 riastradh Exp $        */
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.256 2020/08/26 22:56:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.257 2020/08/28 21:39:28 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kstack.h"
@@ -2576,10 +2576,10 @@
 fill_proc(const struct proc *psrc, struct proc *p, bool allowaddr)
 {
        COND_SET_STRUCT(p->p_list, psrc->p_list, allowaddr);
-       COND_SET_STRUCT(p->p_auxlock, psrc->p_auxlock, allowaddr);
+       memset(&p->p_auxlock, 0, allowaddr);
        COND_SET_STRUCT(p->p_lock, psrc->p_lock, allowaddr);
-       COND_SET_STRUCT(p->p_stmutex, psrc->p_stmutex, allowaddr);
-       COND_SET_STRUCT(p->p_reflock, psrc->p_reflock, allowaddr);
+       memset(&p->p_stmutex, 0, allowaddr);
+       memset(&p->p_reflock, 0, allowaddr);
        COND_SET_STRUCT(p->p_waitcv, psrc->p_waitcv, allowaddr);
        COND_SET_STRUCT(p->p_lwpcv, psrc->p_lwpcv, allowaddr);
        COND_SET_PTR(p->p_cred, psrc->p_cred, allowaddr);
@@ -2591,7 +2591,7 @@
        COND_SET_PTR(p->p_sigacts, psrc->p_sigacts, allowaddr);
        COND_SET_PTR(p->p_aio, psrc->p_aio, allowaddr);
        p->p_mqueue_cnt = psrc->p_mqueue_cnt;
-       COND_SET_STRUCT(p->p_specdataref, psrc->p_specdataref, allowaddr);
+       memset(&p->p_specdataref, 0, allowaddr);
        p->p_exitsig = psrc->p_exitsig;
        p->p_flag = psrc->p_flag;
        p->p_sflag = psrc->p_sflag;



Home | Main Index | Thread Index | Old Index