Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpkern Explicitly zerofill some fields wh...



details:   https://anonhg.NetBSD.org/src/rev/6c3a5cb5c320
branches:  trunk
changeset: 761905:6c3a5cb5c320
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Feb 10 13:40:35 2011 +0000

description:
Explicitly zerofill some fields which are not within the boundaries
of p_start/endzero for whatever reasons.

Obviously, this fixes remote physio when running with MALLOC_OPTIONS J.
Otherwise PS_WEXIT is set in struct proc, proc_vmspace_getref() fails,
and copyout_proc() with it.

Reported by njoly

diffstat:

 sys/rump/librump/rumpkern/lwproc.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r c8a2e6bed48e -r 6c3a5cb5c320 sys/rump/librump/rumpkern/lwproc.c
--- a/sys/rump/librump/rumpkern/lwproc.c        Thu Feb 10 13:39:32 2011 +0000
+++ b/sys/rump/librump/rumpkern/lwproc.c        Thu Feb 10 13:40:35 2011 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: lwproc.c,v 1.14 2011/02/10 13:31:30 pooka Exp $       */
+/*      $NetBSD: lwproc.c,v 1.15 2011/02/10 13:40:35 pooka Exp $       */
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lwproc.c,v 1.14 2011/02/10 13:31:30 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lwproc.c,v 1.15 2011/02/10 13:40:35 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -112,6 +112,16 @@
            offsetof(struct proc, p_endcopy)
              - offsetof(struct proc, p_startcopy));
 
+       /* some other garbage we need to zero */
+       p->p_sigacts = NULL;
+       p->p_aio = NULL;
+       p->p_dtrace = NULL;
+       p->p_mqueue_cnt = p->p_exitsig = 0;
+       p->p_flag = p->p_sflag = p->p_slflag = p->p_lflag = p->p_stflag = 0;
+       p->p_trace_enabled = 0;
+       p->p_xstat = p->p_acflag = 0;
+       p->p_stackbase = 0;
+
        p->p_stats = pstatscopy(parent->p_stats);
 
        p->p_vmspace = vmspace_kernel();



Home | Main Index | Thread Index | Old Index