Module Name: src
Committed By: reinoud
Date: Wed Jan 4 15:14:57 UTC 2012
Modified Files:
src/sys/arch/usermode/dev: cpu.c
Log Message:
Zero the memory we claim for the stacks
To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/usermode/dev/cpu.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/arch/usermode/dev/cpu.c
diff -u src/sys/arch/usermode/dev/cpu.c:1.59 src/sys/arch/usermode/dev/cpu.c:1.60
--- src/sys/arch/usermode/dev/cpu.c:1.59 Tue Jan 3 12:10:04 2012
+++ src/sys/arch/usermode/dev/cpu.c Wed Jan 4 15:14:57 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.59 2012/01/03 12:10:04 reinoud Exp $ */
+/* $NetBSD: cpu.c,v 1.60 2012/01/04 15:14:57 reinoud Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <[email protected]>
@@ -30,7 +30,7 @@
#include "opt_hz.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.59 2012/01/03 12:10:04 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.60 2012/01/04 15:14:57 reinoud Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -333,9 +333,9 @@ cpu_lwp_fork(struct lwp *l1, struct lwp
memcpy(pcb2, pcb1, sizeof(struct pcb));
stacksize = 2*PAGE_SIZE;
- stack_ucp = malloc(stacksize, M_TEMP, M_WAITOK);
- stack_syscall_ucp = malloc(stacksize, M_TEMP, M_WAITOK);
- stack_pagefault_ucp = malloc(stacksize, M_TEMP, M_WAITOK);
+ stack_ucp = malloc(stacksize, M_TEMP, M_WAITOK | M_ZERO);
+ stack_syscall_ucp = malloc(stacksize, M_TEMP, M_WAITOK | M_ZERO);
+ stack_pagefault_ucp = malloc(stacksize, M_TEMP, M_WAITOK | M_ZERO);
pcb2->pcb_needfree = true;
KASSERT(stack_ucp);
@@ -415,7 +415,7 @@ cpu_startup(void)
/* set up the ucontext for the pagefault */
stacksize = 8*PAGE_SIZE;
- stack_pagefault_ucp = malloc(stacksize, M_TEMP, M_WAITOK);
+ stack_pagefault_ucp = malloc(stacksize, M_TEMP, M_WAITOK | M_ZERO);
lwp0pcb.pcb_pagefault_ucp.uc_stack.ss_sp = stack_pagefault_ucp;
lwp0pcb.pcb_pagefault_ucp.uc_stack.ss_size = stacksize;