Module Name: src Committed By: riastradh Date: Fri Aug 28 21:39:28 UTC 2020
Modified Files: src/sys/kern: kern_proc.c Log Message: Zero out more lock snapshots in sysctl exposure. To generate a diff of this commit: cvs rdiff -u -r1.256 -r1.257 src/sys/kern/kern_proc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_proc.c diff -u src/sys/kern/kern_proc.c:1.256 src/sys/kern/kern_proc.c:1.257 --- src/sys/kern/kern_proc.c:1.256 Wed Aug 26 22:56:55 2020 +++ src/sys/kern/kern_proc.c Fri Aug 28 21:39:28 2020 @@ -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 @@ static void 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 @@ fill_proc(const struct proc *psrc, struc 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;