Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/usermode/dev Zero the memory we claim for the stacks



details:   https://anonhg.NetBSD.org/src/rev/84b4742d0a04
branches:  trunk
changeset: 772451:84b4742d0a04
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Wed Jan 04 15:14:57 2012 +0000

description:
Zero the memory we claim for the stacks

diffstat:

 sys/arch/usermode/dev/cpu.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r c6206bdcacae -r 84b4742d0a04 sys/arch/usermode/dev/cpu.c
--- a/sys/arch/usermode/dev/cpu.c       Wed Jan 04 15:10:45 2012 +0000
+++ b/sys/arch/usermode/dev/cpu.c       Wed Jan 04 15:14:57 2012 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
        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 @@
 
        /* 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;



Home | Main Index | Thread Index | Old Index